lsim not working with a single pole system

2 vues (au cours des 30 derniers jours)
Miguel Perez Andrade
Miguel Perez Andrade le 12 Mai 2019
I'm trying to simualte the response of a first oreder low pass system, but I'm getting a strange result so I tried to simulate first a sine input. The result does not appear to be another sine with modified amplitude and phase, so it looks like the output of a non-linear system, so I must be doing something wrong. Here is the code
% system definition
p = -200e3;
z = [];
sys = zpk(z, p, prod(abs(p)));
% input definition
f = 300e3;
x = linspace(0, 2*pi/f, 100e3);
y = sin(f*x);
% simualte
lsim(sys,y,x);
I'm trying to define a low-pass system with a cutoff frequency of 200 kHz. This is the output I'm getting
output.png

Réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 13 Mai 2019
Hi,
Everything you have done is ok except for one small (but crucial point):
y = sin(f*x); has to be y = sin(2*pi*f*x);
Then you will get a nice and neat response that can be also verified in Simulink.
Good luck.

Community Treasure Hunt

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

Start Hunting!

Translated by