Professional Documents
Culture Documents
Contents
ID 13684
LAB 4
SAMPLING
TASK 1
write a program to plot y=cos(2*pi*f1*t)+cos(2*pi*f2*t).
ID:13672
LAB 4
SAMPLING
TASK 1
write a program to plot y=cos(2*pi*f1*t)+cos(2*pi*f2*t).
t=0:0.1:10;
f1=9;
f2=8;
a1=1;
a2=2;
y=a1*cos(2*pi*f1*t)+a2*cos(2*pi*f2*t);
plot (t,y)
xlabel('time')
ylabel('amplitude')
title ('sum of two cos waves')
grid on
Published with MATLAB® R2017a
TASK 2
Contents
Highest value between F1 and F2
Highest value between F1 and F2
t=0:0.1:10;
f1=9;
f2=8;
a1=1;
a2=2;
y=a1*cos(2*pi*f1*t)+a2*cos(2*pi*f2*t);
plot (t,y)
fplot(y)
xlabel('time')
ylabel('amplitude')
title ('Highest value between F1 and F2')
grid on
TASK 3:
Contents
NYQUIST CRITERIA GREATER THEN 2fm:
ORIGINAL SIGNAL:
SAMPLED DISCRETE SIGNAL:
RECONSTRUCTION OF SIGNAL:
NYQUIST CRITERIA GREATER THEN 2fm:
ORIGINAL SIGNAL:
f=4;
t=1/f;
t=0:0.001:f*t;
y=sin(2*pi*f*t);
subplot(3,1,1)
plot(t,y)
xlabel('Samples')
ylabel('Amplitude')
title('Original Signal')
grid on
TASK 4:
Contents
NYQUIST CRITERIA EQUAL TO 2fm:
ORIGINAL SIGNAL:
SAMPLED DISCRETE SIGNAL:
RECONSTRUCTION OF SIGNAL:
NYQUIST CRITERIA EQUAL TO 2fm:
ORIGINAL SIGNAL:
f=6;
t=1/f;
t=0:0.001:f*t;
y=sin(2*pi*f*t);
subplot(3,1,1)
plot(t,y)
xlabel('Samples')
ylabel('Amplitude')
title('Original Signal')
grid on
TASK 5:
Contents
NYQUIST CRITERIA LESS THEN 2fm:
ORIGINAL SIGNAL:
SAMPLED DISCRETE SIGNAL:
RECONSTRUCTION OF SIGNAL:
NYQUIST CRITERIA LESS THEN 2fm:
ORIGINAL SIGNAL:
f=8;
t=1/f;
t=0:0.001:f*t;
y=sin(2*pi*f*t);
subplot(3,1,1)
plot(t,y)
xlabel('Samples')
ylabel('Amplitude')
title('Original Signal')
grid on