In Matlab do the following. In Matlab do the following. Task2: (1) Plot CT unit-
ID: 2085382 • Letter: I
Question
In Matlab do the following.
In Matlab do the following. Task2: (1) Plot CT unit-step function u(t) from t = -5 to t = 5 seconds. syms x fplot (heaviside (x), [-2, 2]) (2) Generate and plot the DT unit-step u[n] from t = -5 to t = 5 seconds. (3) Plot x(t) = u(-t) and y[n] = u[-n]. (4) Plot the CT unit-ramp function r(t) from t = -5 to t = 5 seconds. (5) Plot the DT unit-ramp function r[n] from t = -5 to t = 5 seconds. (6) Plot x(t) = r(-t) and y[n] = r[-n]. (7) Plot a sin function with period T = 5, from t = -5 to t = 5 seconds. (8) Let x_1(t) = cos (pi*t/2) and x_2(t) = cos (pi*t/3). Plot x_1(t) + x_2(t) and find its fundamental period. (9) Plot CT rectangular function x(t) from t = -5 to t = 5 seconds. Now plot x(a*t) for values of a = [1/4, 1/2, 2, 4]. Use "hold on" to overlay all plots in one figure. Verify and explain the compression and expansion effects.Explanation / Answer
(1) Program to plot continuous time unit step function.
syms x
fplot(heaviside(x), [-5, 5])
(2) Program to plot discrete time unit step function
(3)
Program to plot x(t)=u(-t)
Program to plot y[n] = u(-n)
% the length of sequence %
n = 10;
t = 0:1:-n+1;
y = ones(1,-n);
plot(t,y);
stem(t,y);
end
(4) Program to plot ct unit ramp function
n=10 %Enter the length of ramp
s=0.5 %Enter the slop of the ramp
t=-5:0.4:5;
plot(t,s*t);
(5) Discrete time unit Ramp Function
N=10 (' no of samples: ');
a=input (' Max Amplitude: ');
n=-5:1:5;
x=a*n/N;
stem(n,x);
(7) program to plot sine function
t = 0:10e-6:4; %time taken 0 to 4 sec in steps 10micro sec
f=0.2; %frequency =1/T
w=2*pi*f;
A=220
v_out = A*sine(w*t);
plot(t,v_out)
(8)program for cos(pi*t/2)+cos(pi*t/3)
t = 0:10e-6:4;
w1=pi/2
w2=pi/3
y= cos(w1*t)+cos(w2*t);
plot(t,y)
(9) program to plot rectangular function
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.