MATLAB Answers

From Fir2 output to transfer function

7 ビュー (過去 30 日間)
Giacomo
Giacomo 2019 年 8 月 12 日
回答済み: David Wilson 2019 年 8 月 13 日
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 件のコメント

サインインしてコメントする。

回答 (1 件)

David Wilson
David Wilson 2019 年 8 月 13 日
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 件のコメント

サインインしてコメントする。

製品


リリース

R2010b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by