Skip to main content
Tweeted twitter.com/#!/StackSignals/status/504995162658181121
added 77 characters in body
Source Link
jojeck
  • 11.2k
  • 6
  • 38
  • 75

Assume signal x$x$, sampled at fs = 44100 Hz$f_s = 44100\; \mathrm{Hz}$. I tried to filter it using the Butterworth bandpass filter ( 30 Hz - 70 Hz$30\; \mathrm{Hz} - 70\; \mathrm{Hz}$) of order 8$8$. However, as a result I get a vector with most elements being NaNNaN (and some of them extremely small ~ -2, approx.5 * 10^306 $-2.5 \cdot 10^{306}$`).

If I try the same filter of order 6$6$, I get results as expected. What could be possible reason for order 8$8$ filter to explode'explode'?

Here is the MatlabMATLAB code, just in case I made an error which I don't see:

[b, a] = butter(4, [60 / fs, 140/fs]);
x_filtered = filter(b, a, x);

[b, a] = butter(4, [60 / fs, 140/fs]);
x_filtered = filter(b, a, x);

Assume signal x, sampled at fs = 44100 Hz. I tried to filter it using Butterworth bandpass filter ( 30 Hz - 70 Hz) of order 8. However, as a result I get a vector with most elements being NaN (and some of them extremely small ~ -2.5 * 10^306).

If I try the same filter of order 6, I get results as expected. What could be possible reason for order 8 filter to explode?

Here is the Matlab code, just in case I made an error which I don't see:

[b, a] = butter(4, [60 / fs, 140/fs]);
x_filtered = filter(b, a, x);

Assume signal $x$, sampled at $f_s = 44100\; \mathrm{Hz}$. I tried to filter it using the Butterworth bandpass filter ( $30\; \mathrm{Hz} - 70\; \mathrm{Hz}$) of order $8$. However, as a result I get a vector with most elements being NaN (and some of them extremely small, approx. $-2.5 \cdot 10^{306}$`).

If I try the same filter of order $6$, I get results as expected. What could be possible reason for order $8$ filter to 'explode'?

Here is the MATLAB code, just in case I made an error which I don't see:

[b, a] = butter(4, [60 / fs, 140/fs]);
x_filtered = filter(b, a, x);
Source Link
kruk
  • 33
  • 3

The reasons for filter explosion

Assume signal x, sampled at fs = 44100 Hz. I tried to filter it using Butterworth bandpass filter ( 30 Hz - 70 Hz) of order 8. However, as a result I get a vector with most elements being NaN (and some of them extremely small ~ -2.5 * 10^306).

If I try the same filter of order 6, I get results as expected. What could be possible reason for order 8 filter to explode?

Here is the Matlab code, just in case I made an error which I don't see:

[b, a] = butter(4, [60 / fs, 140/fs]);
x_filtered = filter(b, a, x);