From Fir2 output to transfer function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have the output of a fir2 function, that is a digital fir filter. I can evaluate it for a given frequency range using freqz, but I need to evaluate it even for the complex variable "s". Therefore, my idea was to transform the fir filter into a continuous transfer function (TF) and, then, evaluate TF for a given complex number using evalfr. But when I do the bode of the transfer function, the response is completely different. Can you help me? (see the code below):
FiltFreq=[0:100];
FiltAmp=cos(FiltFreq/100*pi/2); %target fir response
BF=fir2(50,FiltFreq/FiltFreq(end),FiltAmp); % Fir
RespDig=freqz(BF,1,FiltFreq/FiltFreq(end)*pi); % Fir response
%Comparison target rersponse vs FIR
figure;
plot(FiltFreq,FiltAmp); hold all
plot(FiltFreq,abs(RespDig));
legend('Target response magnitude','Fir response magnitude')
tr_fun=tf(BF,1); % Generation Transfer Function
% Bode plot of the TF that is supposed to represent the FIR above ...
figure;
bode(tr_fun);
0 Kommentare
Antworten (1)
David Wilson
am 13 Aug. 2019
tr_fun should be a discrete transfer function, (not continuous) say
tr_fun=tf(BF,1,1); % Generate a DISCRETE Transfer Function with Ts =1.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Filter Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!