[Scilab-users] iir() generates unstable filters
Matt Bruensteiner
matt_bruensteiner at yahoo.com
Wed Jun 5 19:37:43 CEST 2013
I've seen similar issues brought up in the archives, but I don't find any
resolution.
I'm using iir() to generate a butterworth lpf.
The resulting filter has poles outside the unit circle. I am by no means a
DSP expert, but from what I understand, this indicates a non-stable filter.
When I apply this filter to a measured waveform using flts(), the result
blows up, with the output increasing exponenntially over time.
I tried both even and odd filter orders:
-->lpfilt = iir(4, 'lp', 'butt', [.0875 0], [0 0])
lpfilt =
2 3 4
0.0030512 + 0.0122049z + 0.0183073z + 0.0122049z + 0.0030512z
-------------------------------------------------------------
2 3 4
0.2139357 - 1.3042473z + 2.6500338z - 2.5712226z + z
-->roots(denom(lpfilt))
ans =
1.0361719
0.6177887 + 0.5547720i
0.6177887 - 0.5547720i
0.2994733
-->lpfilt5 = iir(5, 'lp', 'butt', [0.0875 0], [0 0])
lpfilt5 =
2 3 4
5
0.0007227 + 0.0036136z + 0.0072273z + 0.0072273z + 0.0036136z +
0.0007227z
--------------------------------------------------------------------------
2 3 4 5
- 0.1155084 + 1.2115289z - 3.1061603z + 4.3810649z - 3.226861z + z
-->roots(denom(lpfilt5))
ans =
1.1204851 + 0.4583414i
1.1204851 - 0.4583414i
0.4264616 + 0.6409903i
0.4264616 - 0.6409903i
0.1329677
<end transcript>
When I do the equivalent thing in Octave, I get the same zeros but different
poles:
octave:2> [b, a] = butter(5, 0.0875 * 2)
b =
7.2273e-004 3.6136e-003 7.2273e-003 7.2273e-003 3.6136e-003
7.2273e-004
a =
1.00000 -3.22686 4.38106 -3.07823 1.11122 -0.16406
(Note octave gives the coefficients in the reverse order from SciLab).
When I plug Octave's denominator back in to SciLab, the filter has the
expected features (LPF with -3 dB at f/Fs = 0.0875).
I am currently using SciLab 5.3.3 64-bit on Win 7.
I know that SciLab 5.4 is available, but the updater doesn't play nice with
the network setup (proxies?) at my office.---I'll certainly upgrade if this
is a known bug that has been fixed in 5.4.
My question is:
* Is this a bug or do I simply not know what I'm doing with either SciLab or
DSP?
* If it's not a bug, how should I use SciLab to generate a stable filter?
Thanks,
Matt
--
View this message in context: http://mailinglists.scilab.org/iir-generates-unstable-filters-tp4026779.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
More information about the users
mailing list