System impulse response and Convolution by matlab

Hi everyone, i am very new to matlab, and would like to konw how to obtain y(t) from below
Generate a unit step function as the input function, x(t), and an exponentially decay function as the impulse response function, h(t), such as h(t)=exp(-t/2) (note: 2 is the time constant of the system dynamic response). Using MATLAB to calculate the output of the system, y(t).
Thank you so much in advance

2 comentarios

Seikh Rana
Seikh Rana el 22 de Abr. de 2018
Convolution (random position zero) in matlab plz help me
Seikh Rana
Seikh Rana el 22 de Abr. de 2018

</matlabcentral/answers/uploaded_files/114156/convooooo.JPG> this picture problem solved in matlab plz help me

Iniciar sesión para comentar.

Respuestas (3)

psyx21
psyx21 el 29 de Abr. de 2011

1 voto

hey friends what will be the peak acceleration response for 100g 6ms half sine pulse with zeta=0. I need a matlab script with natural frequency on x axis..thanks
Paulo Silva
Paulo Silva el 20 de Feb. de 2011
t=0:0.1:10;
u=0*t;
u(t>=0)=1;
h=exp(-t/2);
y=u.*h;
plot(t,y)

8 comentarios

gedaa
gedaa el 21 de Feb. de 2011
thank you sooo much, but I have one more question if it's not 2 much, what is u=0*t and how did u come up with that?
Paulo Silva
Paulo Silva el 21 de Feb. de 2011
it's the same as
u=zeros(size(t))
It creates a variable with the same size as t but full of zeros. I learned that trick here at matlabcentral :)
David Young
David Young el 21 de Feb. de 2011
Paulo - I just wonder if this is right. In the time domain, don't you need to convolve the input and the impulse response rather than multiplying them?
Paulo Silva
Paulo Silva el 21 de Feb. de 2011
Yes you are correct, try
t=0:0.1:10;
u=0*t;
u(t>=0)=1;
h=exp(-t/2);
y=conv(u,h);
plot(y)
Paulo Silva
Paulo Silva el 21 de Feb. de 2011
Correction for the amplitude and time scale
T=0.1;
t=0:T:10;
u=0*t;
u(t>=0)=1;
h=exp(-t/2);
y=conv(u,h);
plot(t,T*y(1:numel(t)))
gedaa
gedaa el 21 de Feb. de 2011
ok, so if the problem asks for a pulse function instead of a unit step function, it would be the exact same codes except with the addition of PulseWidth=1, am i correct?
Paulo Silva
Paulo Silva el 21 de Feb. de 2011
I'm not sure about the amplitude at
plot(t,T*y(1:numel(t)))
with the step function is good compared to
step(tf([1],[1 1/2])) but with the impulse it's plot(t,y(1:numel(t))) without the T, I can't figure out why that happens.
gedaa
gedaa el 23 de Feb. de 2011
hey, paulo, i actually checked with my professor and he said that T doesn't need to be multiplied in the last line. Thank you soo much

Iniciar sesión para comentar.

Arpan Patel
Arpan Patel el 25 de Feb. de 2021

0 votos

t=0:0.1:10;
u=0*t;
u(t>=0)=1;
h=exp(-t/2);
y=u.*h;
plot(t,y)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Feb. de 2011

Respondida:

el 25 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by