From Fir2 output to transfer function

10 次查看(过去 30 天)
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);

回答(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.

类别

Help CenterFile Exchange 中查找有关 Filter Design 的更多信息

产品


版本

R2010b

Community Treasure Hunt

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

Start Hunting!

Translated by