I have a big issue, basically my goal is to create a low-pass butterworth filter around 0-35Hz with a sampling frequency of 5000Hz. My Matlab code is

[order,wn] = buttord(Wp,Ws,Rp_db,Rs_db);

But it doesn't work, becouse the filter explodes enter image description here

enter image description here

As you can see the filter is unstable.But if i change the sampling frequency from 5000Hz to 500Hz things change enter image description here enter image description here

with the cutt-off frequency 0.135 (33,75 Hz).

Why does the sampling frequency affect so much the filter result? Thanks in advance


Limited numerical precision. The higher the sample rate, the closer the poles move to the unit circle, the closer to the unit circle, the less stable the filter is.

There are different implementation methods that are better than others: design as poles, and zeros and not as transfer function, use cascaded second order sections, use correct section ordering, higher precision data types, etc.

In most cases very high order filters with poles close to the unit circle are a bad idea. You get very high group delay and phase distortions and massive time domain ringing.

  • $\begingroup$ Thanks for your reply!.So do you think one possible solution would be applying low pass filter (0-500),to respect Shannon-Nyquist theorem, and than downsampling (5khz to 500hz)? $\endgroup$ – Edoardo De Gaspari Aug 28 '19 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.