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 Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!