[SciPy-user] firwin for even order NOT linear phase; returns 0 coefficients
Tom K.
tpk at kraussfamily.org
Wed May 6 23:18:06 EDT 2009
This filter is not linear phase:
signal.firwin(4,.3)
--> array([ 0.02051616, 0.23560318, 0.50827748, 0.23560318])
These two filters are identical except that the 2nd has zeros at either end,
the 1st has a zero at the beginning - neither filter is actually the length
requested (19 and 19 instead of 20 and 21).
In [46]: signal.firwin(20,.3)
Out[46]:
array([ 9.34176168e-19, 2.92890318e-03, 6.34234732e-03,
3.78304197e-03, -1.23878481e-02, -3.43265728e-02,
-3.18598611e-02, 2.65312166e-02, 1.37863165e-01,
2.51347679e-01, 2.99555858e-01, 2.51347679e-01,
1.37863165e-01, 2.65312166e-02, -3.18598611e-02,
-3.43265728e-02, -1.23878481e-02, 3.78304197e-03,
6.34234732e-03, 2.92890318e-03])
In [47]: signal.firwin(21,.3)
Out[47]:
array([ 9.34176168e-19, 2.92890318e-03, 6.34234732e-03,
3.78304197e-03, -1.23878481e-02, -3.43265728e-02,
-3.18598611e-02, 2.65312166e-02, 1.37863165e-01,
2.51347679e-01, 2.99555858e-01, 2.51347679e-01,
1.37863165e-01, 2.65312166e-02, -3.18598611e-02,
-3.43265728e-02, -1.23878481e-02, 3.78304197e-03,
6.34234732e-03, 2.92890318e-03, 9.34176168e-19])
Can anyone explain this behavior? I don't think either filter should end in
zero. I suspect something funny about the way the windows are defined -
like, they are designed for spectral analysis, not FIR filter design.
--
View this message in context: http://www.nabble.com/firwin-for-even-order-NOT-linear-phase--returns-0-coefficients-tp23419504p23419504.html
Sent from the Scipy-User mailing list archive at Nabble.com.
More information about the SciPy-User
mailing list