필터 지우기
필터 지우기

Calculating Response of a system with lsim versus convolution

조회 수: 4 (최근 30일)
S H
S H 2019년 2월 23일
A square wave is applied to two high-pass and low-pass filters in the following codes. Could you explain why lsim shows different response than convolution for the high-pass and almost the same response for the low-pass filter? What are missing in these codes to calculate the response correctly?
syms s
tfunc1=(5e-25*s^2+1e-08*s)/(1e-24*s^2+1e-08*s+1); %high-pass filter
tfunc2=(5e-17*s+1)/(5e-25*s^2+1e-08*s+1); %low-pass filter
tfunc=tfunc2; %choose tfunc1 for high-pass filter and tfunc2 for low-pass filter
[symNum,symDen]=numden(tfunc);
TFnum=sym2poly(symNum);
TFden=sym2poly(symDen);
sys=tf(TFnum,TFden);
[yy,tt]=impulse(sys);
[xt,time]=gensig('square',tt(end),4*tt(end),tt(2)-tt(1));
out=(tt(2)-tt(1))*conv(yy,xt,'full');
lsimplot(sys,xt,time)
hold on
plot(time,out(1:length(time)),'r')

답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by