Basic fir1 question-what is N?

조회 수: 8 (최근 30일)
Louise Wilson
Louise Wilson 2019년 7월 23일
답변: Star Strider 2019년 7월 23일
HI everyone, I am working through code from a colleague (retired) and slowly interpreting what everything means as I learn matlab.
One of the lines is:
hp = fir1(128, 0.10, 'high'); %create hp filt to be applied later
%designs N'th order highpass filter
%0.10 (Wn) is cut-off frequency
...which I understand is creating a filter that I will later multiply my data array with. I am wondering where the 128 comes from? I see the filter has N+1 values (129) but wondering where the reasoning is for using 128 in first place. Or how do you decide from the start what to put N as?
Thanks!

답변 (1개)

Star Strider
Star Strider 2019년 7월 23일
The order (the ‘n’ parameter in fir1) for FIR filters is actually somewhat arbitrary. It has to be long enough to provide a decent filter response. (I use kaiserord to design FIR filters, since it arrives at the optimal value for this and several other parameters on its own.)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by