octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #10352] adding islinphase.m


From: Leonardo
Subject: [Octave-patch-tracker] [patch #10352] adding islinphase.m
Date: Wed, 28 Jun 2023 13:06:15 -0400 (EDT)

Follow-up Comment #4, patch #10352 (project octave):

I guess the problem with this filter is that at ω = 0 we have undefined or
indeterminate angle.

H(0) = (1 - e^(-j * 0)) / (1 - 2e^(-j * 0)) = 0 / (-1)

arg(0) = ?

In another approach, the numerator might be expressed by:
B(ω) = e^(-jω/2)(e^(jω/2) - e^(-jω/2)) = e^(-jω/2)(2j sin(ω/2))
arg(B(ω)) = -ω/2 + angle(2j sin(ω/2))

and the denominator by:
A(ω) = e^(-jω/2)(3jsin(ω/2) - cos(ω/2)) 
ang(A(ω)) = -ω/2 + arctan((3sin(ω/2)) / (-cos(ω/2)))

angle(H(ω)) = angle(2j sin(ω/2)) - arctan((3sin(ω/2)) / (-cos(ω/2)))

for ω > 0
angle(H(ω)) = π/2 - arctan((3sin(ω/2)) / (-cos(ω/2)))

for ω = 0 it is undefined.

That is causing the warning. 

Here is the compared result of grpdelay in GNU Octave and Matlab for that
particular filter:

GNU Octave
octave:1> pkg load signal
octave:2> b = [1 -1]; a = [1 -2];
octave:3> [gd, w] = grpdelay (b, a);
octave:4> [gd(1:10)'; w(1:10)']
ans =

  -1.0000  -1.4999  -1.4995  -1.4990  -1.4982  -1.4972  -1.4959  -1.4945 
-1.4928  -1.4909
        0   0.0061   0.0123   0.0184   0.0245   0.0307   0.0368   0.0430  
0.0491   0.0552


MATLAB
>> b = [1 -1]; a = [1 -2];
>> [gd, w] = grpdelay (b, a);
>> [gd(1:10)'; w(1:10)']

ans =

   -1.5000   -1.4999   -1.4995   -1.4990   -1.4982   -1.4972   -1.4959  
-1.4945   -1.4928   -1.4909
         0    0.0061    0.0123    0.0184    0.0245    0.0307    0.0368   
0.0430    0.0491    0.0552


Maybe we should point this to Paul Kienzle and Julius O. Smith III who have
created the grpdelay.m function in GNU Octave.

To avoid this warning in the tests, we could just remove this one.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10352>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]