Is this how to correctly find the output signal using unit-amp and unit-step responses?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I'm quite new to Matlab and for an assignment I have to do the following;
1.Construct an anonymous function yu(t) for computing the unit-step response of the circuit. Construct an anonymous function yr(t) for computing the unit-ramp response of the circuit. Consider the system to be initially relaxed (zero initial conditions).
2. Express the output signal y(t) of the circuit given the input x(t), in terms of scaled and time shifted versions of the unit-step response and the unit-ramp response. Consider the system to be initially relaxed (zero initial conditions). Create an anonymous function for y(t). Compute it in the time interval (-2 <t <7) seconds with an increment of 0.01 seconds.
The input signal is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170140/image.png)
The answer I have is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170141/image.png)
And here is my code:
r = @(t) t.*(t>=0);
u = @(t) 1.*(t>=0);
x = @(t) (r(t).*(t<=1))-(2*u(t-1))+((r(2*(t-3))).*((t>=3)&(t<=4)))+((r(t-4)+2).*((t>4)&(t<5)))+(3*u(t-5));
x1 = x(t);
yu = @(t) (1-exp(-4*t)).*(t>=0);
yr = @(t) (t.*(1-exp(-4*t))).*(t>=0);
y = @(t) (yr(t).*(t<=1))-(2*yu(t-1))+((yr(2*(t-3))).*((t>=3)&(t<=4)))+((yr(t-4)+2).*((t>4)&(t<5)))+(3*yu(t-5));
y1 = y(t);
t = [-2:0.01:7];
figure(1);
plot(t,x1);
axis([-2 7 -2.5 2]);
title('Signal x(t)');
xlabel('time (sec)');
ylabel('Amplitude');
grid;
figure(2);
plot(t,x1,'b-',t,y1,'r--');
axis([-2 7 -2.5 2]);
title('Signals x(t) and y(t)');
xlabel('Time (sec)');
ylabel('Amplitude');
grid;
legend('Signal x(t)','Signal y(t)',...
'Location','SouthEast');
I have no idea if the answer I have got is anywhere close to the right answer so any advice/help would be great :)
0 commentaires
Réponses (2)
vijaya lakshmi
le 26 Fév 2018
Hi Ellen,
I would suggest you that first convert the time domain signal into s-domain(Laplace transform) and then find out the unit step and unit ramp response of the signal.
step(sys)
impulse(sys)
0 commentaires
mariam alazmii
le 24 Sep 2018
sketch by matlab consider the signal x1(t) shown in Figure 1.34(a) plot x1(t-1) , x1(-t+2),x1(t-1)+x1(-t+2),x1(t-1)-x1(-t+2), andx1(t-1)x1(-t+2)
please any one know how to solve it >>?
0 commentaires
Voir également
Catégories
En savoir plus sur Digital Filter Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!