How to calculate the filter order of given specification ??
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
Hi, i designed a filter using :
d1=designfilt('lowpassfir','PassbandFrequency',0.45,'StopbandFrequency',0.5,'PassbandRipple',3,'StopbandAttenuation',60,'DesignMethod','equiripple');
When i tried to use fdatool to get the filter coefficient i need to put the filter order but i don't know how to calculate it . can anyone tell me please?
채택된 답변
Star Strider
2017년 7월 7일
There is a way to calculate the order necessary for IIR filters, since they have both numerator and denominator polynomials, but not for FIR filters, with only numerator polynomials. With FIR filters, I usually begin with a filter order of 24, then use freqz to test it, and increase the length until I get the result I want. The window you choose will affect the filter passband shape.
댓글 수: 17
Is there any other way to extact the filter coefficients because i found that i can use sos = lpfilt.Coefficients but they said that this function "Output the filter coefficients, expressed as second-order sections." and i don't undestand what does this mean :expressed as second-order sections??
The second-order-section form produces the most stable filter implementation, so that is preferable.
If you want to convert the second-order-second representation to a transfer function so that you can get the filter coefficients, use the sos2tf function.
Yes, actually i just want to get the coefficients of the filter that i used with
d1=designfilt('lowpassfir','PassbandFrequency',0.45,'StopbandFrequency',0.5,'PassbandRipple',3,'StopbandAttenuation',60,'DesignMethod','equiripple');
a = filtfilt(d1,deriv1);
because i need to implement this filter in c langage so how is it possible to generate c code in Matlab for filtfilt
i use the sos2tf but i got this error message SOS matrix must have six columns.
I am lost. The second-order-section representation should have the necessary 6 columns.
Check to see what the function is actually returning.
When I run this:
d1=designfilt('lowpassfir','PassbandFrequency',0.45,'StopbandFrequency',0.5,'PassbandRipple',3,'StopbandAttenuation',60,'DesignMethod','equiripple');
Coefs = d1.Coefficients;
the ‘Coefs’ variable is a vector of 61 coefficients for your FIR filter, so this may be all you need to do.
when i run it i got 66 coefficients . Conceerning the use of the filtfilt which have the syntax y = filtfilt(b,a,x). so for my case coefs =b and a=1 because it is a FIR ? am i right?
‘so for my case coefs =b and a=1 because it is a FIR ? am i right?’
Yes.
Sorry to ask that but really i'm very lost and confused because i should implement this filter that i used in c langage and i couldn't find any code c for this so if you have any idea can you help me ? and if i just look for low pass fir filter it dosen't matter ? Thanks for replying
My pleasure.
I have not programmed in C in many years. Unfortunately, I cannot help you with C code.
ok no problem Thanks
My pleasure.
I would look through Numerical Recipes in C by Press, et al. to see if a filter algorithm of some type exists already. You may have to adapt an algorithm to code the filtfilt function.
Ok i will do that, thanks for the advice.
Another question please i want to know does the filter coefficients change with the length of the signal because i have a signal with a lenght 2560 and i will partion it to 4 parts and i use for each part the same filter coefficients so is this right?
The filter coefficients will be whatever you designed them to be, and do not change with the length of the signal. Your filter has a length of about 64 if I remember correctly, and your signal segments will be 640. You should not have any problems with it.
You could get transients at the beginning and end of each segment. For this reason, I would partition the signal after filtering to get the best results.
My filter length is about 66. Actually i need to partion my signal like this because i need to implement in a processor which cannot handle the all length of the signal,that's why i asked to just clarify is there a problem with that.
The only problem are the (possible) filter transients at the beginning and end of each segment. These are more apparent with longer filters.
Ok, i undestand thanks.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Digital and Analog Filters에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
