You are on page 1of 2

1b

clear all
close all
clc
t=-5:0.01:5;
x=0.5*cos(10*pi*t)+ sin(7*pi*t)+0.2*sin(14*pi*t);
fm=0.3;
fs=fm;
ts=-5:1/fs:5;
xs=0.5*cos(10*pi*ts)+ sin(7*pi*ts)+0.2*sin(14*pi*ts);
subplot(3,1,1)
plot(t,x)
hold on
stem(ts,xs,'r')
fs=2*fm;
ts=-5:1/fs:5;
xs=0.5*cos(10*pi*ts)+ sin(7*pi*ts)+0.2*sin(14*pi*ts);
subplot(3,1,2)
plot(t,x)
hold on
stem(ts,xs,'r')
fs=10*fm;
ts=-5:1/fs:5;
xs=0.5*cos(10*pi*ts)+ sin(7*pi*ts)+0.2*sin(14*pi*ts);
subplot(3,1,3)
plot(t,x)
hold on
stem(ts,xs,'r')
1c
clear all
close all
clc
t=-5:0.01:5;
x=stepfun(t,0)-stepfun(t,1);
fm=0.3;
fs=fm;
ts=-5:1/fs:5;
xs=stepfun(ts,0)-stepfun(ts,1);
subplot(3,1,1)
plot(t,x)
hold on
stem(ts,xs,'r')
fs=2*fm;
ts=-5:1/fs:5;
xs=stepfun(ts,0)-stepfun(ts,4);
subplot(3,1,2)
plot(t,x)
hold on
stem(ts,xs,'r')
fs=10*fm;
ts=-5:1/fs:5;
xs=stepfun(ts,0)-stepfun(ts,4);
subplot(3,1,3)

plot(t,x)
hold on
stem(ts,xs,'r')
1d
clear all
close all
clc
t=-5:0.01:5;
x=exp(-t+1).*(stepfun(t,0)-stepfun(t,-1));
fm=0.3;
fs=fm;
ts=-5:1/fs:5;
xs=exp(-ts+1).*(stepfun(ts,0)-stepfun(ts,-1));
subplot(3,1,1)
plot(t,x)
hold on
stem(ts,xs,'r')
fs=2*fm;
ts=-5:1/fs:5;
xs=exp(-ts+1).*(stepfun(ts,0)-stepfun(ts,-1));
subplot(3,1,2)
plot(t,x)
hold on
stem(ts,xs,'r')
fs=10*fm;
ts=-5:1/fs:5;
xs=exp(-ts+1).*(stepfun(ts,0)-stepfun(ts,-1));
subplot(3,1,3)
plot(t,x)
hold on
stem(ts,xs,'r')

You might also like