# How do you determine the arguments to the `buttord` function?

조회 수: 3 (최근 30일)
L'O.G. 2022년 6월 2일
댓글: Star Strider 2022년 6월 2일
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.

댓글을 달려면 로그인하십시오.

### 채택된 답변

Star Strider 2022년 6월 2일
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없음 표시없음 숨기기
L'O.G. 2022년 6월 2일
@Star Strider Thank you. Is there a way of filtering the time domain signal in an automatic way without having to, as you mention, select the frequencies for the filter? Like a general criterion for selecting the passband and stopband to input into buttord to create a robust anti-aliasing filter? Any tips / examples?
Star Strider 2022년 6월 2일
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.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

R2021b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by