How do you determine the arguments to the `buttord` function?
3 views (last 30 days)
Show older comments
This is more of a conceptual question -- there are examples on the page for this function, but how do you select what the passband and stopband, etc. should be? I am trying to use this to build an antialiasing filter. I have a signal (time domain) that isn't bandlimited, and I'm trying to filter it before sampling, etc.
0 Comments
Accepted Answer
Star Strider
on 2 Jun 2022
I use the fft function to determine the signal spectrum, and then I use that information to select the frequencies for the filter. This is useful for band-limited frequencies (although I usually use an elliptic filter because it is computationally more efficient).
For broadband noise, I use the sgolayfilt function with an order 3 polynomial and then choose a framelen value that gives the results I want.
2 Comments
Star Strider
on 2 Jun 2022
That in general depends on what the signal is. For example, to filter an electrocardiogram (EKG) signal, I know that designing a bandpass filter with a lower passband of 1 Hz and an upper passband of 45 to 100 Hz will produce the result I want, unless it is contaminated with broadband noise (requiring sgolayfilt) or has line frequency noise (requiring an additional notch filter). Beyond that, unless you have some intrinsic knowledge of what the signal is, there are no specific requirements.
For an anti-aliasing filter, the stopband of the lowpass filter has to be at the Nyquist frequency (one-half the sampling frequency) of the ADC. If you are resampling a signal, then the resample function already has its own built-in FIR anti-aliasing filter, so I would simply use those (or refer to that documentation for the correct procedure if you want to do it yourself).
Otherwise, if you want to remove an aliased signal from a signal that was sampled without having a hardware anti-aliasing filter at the time it was digitised, that is simply impossible. Aliased signals are already part of the sampled signal and cannot be removed.
More Answers (0)
See Also
Categories
Find more on Digital Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!