Wrong results using "group" command to calculate group delay of filter. Using th
Reported by nico
-- Bug description --
Wrong results using "group" command to calculate group delay of filter. Using the transfer function of a FIR filter, the group delay shall be constant over the complete frequency values.
1)Using the following commands:
z=poly(0,'z');
h=(1+z^-1+z^-2)/(1);
[tg,fr]=group(128,h);
plot(fr,tg);
The result of "tg" is constant "1", which is correct.
2) Using the following commands:
z=poly(0,'z');
h=(1+z^-1+z^-2+z^-3)/(1);
[tg,fr]=group(128,h);
plot(fr,tg);
The result of "tg" is as follows:
tg =
column 1 to 15
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 16 to 30
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 31 to 45
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 46 to 60
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 61 to 75
1.5 1.5 1.5 1.5 3.266D+16 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 76 to 90
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 91 to 105
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 106 to 120
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
column 121 to 128
1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
As one can see, the value of tg(65)
ans =
3.266D+16
which is not correct!
I also tried to use the "group" command as follows (directly after starting scilab):
[tg,fr]=group(128,[1 1 1],[1])
!--error 4
Undefined variable: tg
at line 136 of function group called by :
[tg,fr]=group(128,[1 1 1],[1])
Maybe, this is another problem of the "group" command. I hope, the way I use the commands is correct. And I hope, I have reported the bug at the correct place. It's my first bug report.
-- Scilab error message --
-- How to reproduce the bug --