Problem with toolbox filter design?
이전 댓글 표시
Hi everybody, I need help with disigning filters in matlab:
I was designed a bandpass filter in the toolbox and export it like an object to my workspace, then I tried to filter data with it using the comand filtfilt, the problem es that this comand don't recognize this filter as a matrix so when i use the follow linecommand: a11=filtfilt(Fil1,a1); i recived the follow error "Not enough input arguments". The Fs frecuency of the filter is 1000Hz, the Flowpass is 10Hz and the Fhighpass is 14Hz. Apass 1dB. Type Chebychev Type 1.
thanks
답변 (1개)
Wayne King
2013년 6월 15일
편집: Wayne King
2013년 6월 15일
Assume that Fil1 is your filter object, if you enter
class(Fil1)
does it return dfilt.df2sos?
If so, then depending on what version of MATLAB you are using, try:
out = filtfilt(Fil1.sosMatrix,Fil1.ScaleValues,a1);
where a1 is your data.
If you have an older version of MATLAB where the above command does not work, write back.
댓글 수: 7
Stefan Leiva
2013년 6월 15일
편집: Stefan Leiva
2013년 6월 15일
Wayne King
2013년 6월 16일
Did the command at least run? It did not throw an error?
Do you have NaNs in your data? If you have any NaNs in your data, then you will only get NaNs out.
Stefan Leiva
2013년 6월 16일
Wayne King
2013년 6월 16일
That is strange because I don't have any trouble with your filter. Can you try this:
n = 0:499;
x = cos(0.01*pi*n)+sin(pi/4*n)+randn(size(n));
y = filtfilt(Fil1.sosMatrix,Fil1.ScaleValues,x);
Do you get NaNs in your output with the above?
Stefan Leiva
2013년 6월 16일
편집: Stefan Leiva
2013년 6월 16일
Wayne King
2013년 6월 17일
Are you using the MathWorks' version of filtfilt()? If you enter
>>which filtfilt
what do you get returned?
Stefan Leiva
2013년 6월 17일
카테고리
도움말 센터 및 File Exchange에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!