freqeuncy complex data convert to FIR filter
조회 수: 5 (최근 30일)
이전 댓글 표시
i have frequency domain data of plate.
i want to convert to this data to FIR filter to model my system. i heard if i want to FIR filter this filter have 2*n +1 tap (n is maximum freqeuncy)
i think i have to use ifft or invfreqz but the detail code can not access in the mathWorks please help me
댓글 수: 0
채택된 답변
Mathieu NOE
2021년 6월 25일
hello
here you are my friend !
tried to fit minimum size IIR filter first , then FIR coefficients are equal to impulse response to IIR
data = importdata ('plate_tf.mat');
freq = data.Hz; % frequency
frf = data.com; % FRF complex
% IIR model
Fs = 1e3;
W = linspace(0,pi,length(freq));
ind = find(freq>50 & freq <150); % frequency weighting ; data reliable between 5 and 80 Hz
WT = zeros(size(W));
WT(ind) = 1;
NB = 2;
NA = 2;
[B,A] = invfreqz(frf,W,NB,NA,WT,Fs);
% check bode plots
[H,WW] = freqz(B,A,length(frf));
figure(1),
subplot(2,1,1),plot(freq,20*log10(abs(frf)),'b',freq,20*log10(abs(H)),'r');grid
subplot(2,1,2),plot(freq,180/pi*(angle(frf)),'b',freq,180/pi*(angle(H)),'r');grid
% Impulse response
[FIR,X] = dimpulse(B,A);
samples = length(FIR);
time = 1/Fs*(1:samples);
figure(2),
plot(time,FIR,'r');grid
title('Impulse response (FIR model)')
xlabel('Time (s)');
ylabel('Amplitude')
댓글 수: 8
Mathieu NOE
2021년 6월 29일
It still can be used if you have data and model FRFs in good match and make sure also your IIR model is stable (using isstable and impulse or step response)
the warning may be due to under or over parametrization; keep in mind to have the right amount of zeroes and poles in your model
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!