freqeuncy complex data convert to FIR filter
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sangwoo ha
le 24 Juin 2021
Commenté : sangwoo ha
le 29 Juin 2021
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 commentaires
Réponse acceptée
Mathieu NOE
le 25 Juin 2021
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 commentaires
Mathieu NOE
le 29 Juin 2021
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
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Digital Filter Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!