You are on page 1of 4

KINZA PERVEZ

EE-20141
LAB SESSION 1

1. Simulate and plot two CT signals of 10 Hz and 110 Hz for 0 < t < 0.2 secs.
2. Sample at Fs = 100 Hz and plot them in discrete form.
3. Observe and note the aliasing effects.
4. Explore and learn.
KINZA PERVEZ
EE-20141
LAB SESSION 1

OBSERVATION:
It is observed that the signal of 110Hz has taken an alias identity of that of 10Hz. This happened
due to the aliasing effect. According to the Nyquist Principle, the critical condition to avoid
aliasing is given as:
𝐹𝑠 = 2𝐹𝑚𝑎𝑥
Here, Fmax = 110Hz.
𝐹𝑠 = 100𝐻𝑧 < 2(110𝐻𝑧)
Hence, the aliasing is justified by the Nyquist principle.
TASK#1:
clc; clear all; close all;
%frequencies of analog signals
F1 = 500; F2 = 2000;
F3 = 3000; F4 = 4500;
%sampling rate and time
Fs = 5000; Ts = 1/Fs;
%analog singals
t=[0:1/(F4*100):(99*Ts)];
x1t = sin(2*pi*F1*t); x2t = sin(2*pi*F2*t);
x3t = sin(2*pi*F3*t); x4t = sin(2*pi*F4*t);
%sampled signals
nTs = [0:Ts:99*Ts];
x1n = sin(2*pi*F1*nTs); x2n = sin(2*pi*F2*nTs);
x3n = sin(2*pi*F3*nTs); x4n = sin(2*pi*F4*nTs);
%plotting CTCV signals
figure;
subplot(221); plot(t,x1t,'r','LineWidth',2)
grid on; xlim([0 0.002]);
title('CTCV at F1 = 500Hz');
subplot(222); plot(t,x2t,'g','LineWidth',2)
grid on; xlim([0 0.002]);
title('CTCV at F2 = 2000Hz');
subplot(223); plot(t,x3t,'b','LineWidth',2)
grid on; xlim([0 0.002]);
title('CTCV at F3 = 3000Hz');
subplot(224); plot(t,x4t,'m','LineWidth',2)
grid on; xlim([0 0.002]);
title('CTCV at F4 = 4500Hz');
%plotting DTCV signals
figure;
subplot(221); stem(nTs,x1n,'r','LineWidth',2)
grid on; title('DTCV at F1 = 500Hz');
subplot(222); stem(nTs,x2n,'g','LineWidth',2)
grid on; title('DTCV at F2 = 2000Hz');
subplot(223); stem(nTs,x3n,'b','LineWidth',2)
grid on; title('DTCV at F3 = 3000Hz');
subplot(224); stem(nTs,x4n,'m','LineWidth',2)
grid on; title('DTCV at F4 = 4500Hz');
KINZA PERVEZ
EE-20141
LAB SESSION 1

OBSERVATION:
It is observed that 0.5kHz & 2kHz are sampled correctly. But in the case of 3kHz & 4.5kHz,
aliasing is happening i.e., the signals are taking the false identity of another signal. The
frequency of those signals can be found as follows:
𝐹3′ = 𝐹3 − 𝐹𝑠 = 3000𝐻𝑧 − 5000𝐻𝑧 = −2000 𝐻𝑧
𝐹4′ = 𝐹4 − 𝐹𝑠 = 4500𝐻𝑧 − 5000𝐻𝑧 = −500𝐻𝑧
It can be observed in the DTCV signals of F3 & F4, that the cycle of the wave is starting from
the negative side. Hence, verifying the false frequencies found above.
KINZA PERVEZ
EE-20141
LAB SESSION 1

TASK#2:
%generating tone of different frequencies
Fs = 8000; Ts = 1/Fs;
%frequencies
F1 = 1000; F2 = 2000;
F3 = 3000; F4 = 4000;
F5 = 5000; F6 = 6000;
F7 = 7000; F8 = 8000;
F9 = 9000; F10 = 25000;
F11 = -1000; F12 = -2000;
F13 = -3000;
nTs = 0:Ts:0.5;
%creating signals of above frequencies
x1n = sin(2*pi*F1*nTs); x2n = sin(2*pi*F2*nTs);
x3n = sin(2*pi*F3*nTs); x4n = sin(2*pi*F4*nTs);
x5n = sin(2*pi*F5*nTs); x6n = sin(2*pi*F6*nTs);
x7n = sin(2*pi*F7*nTs); x8n = sin(2*pi*F8*nTs);
x9n = sin(2*pi*F9*nTs); x10n = sin(2*pi*F10*nTs);
x11n = sin(2*pi*F11*nTs); x12n = sin(2*pi*F12*nTs);
x13n = sin(2*pi*F13*nTs);
%listening to the signals created above with pauses
sound(x1n,Fs); n=1; pause(n);
sound(x2n,Fs); n=1; pause(n);
sound(x3n,Fs); n=1; pause(n);
sound(x4n,Fs); n=1; pause(n);
sound(x5n,Fs); n=1; pause(n);
sound(x6n,Fs); n=1; pause(n);
sound(x7n,Fs); n=1; pause(n);
sound(x8n,Fs); n=1; pause(n);
sound(x9n,Fs); n=1; pause(n);
sound(x10n,Fs); n=1; pause(n);
sound(x11n,Fs); n=1; pause(n);
sound(x12n,Fs); n=1; pause(n);
sound(x13n,Fs); n=1; pause(n);

OBSERVATION:
While listening to the tones generated, it was observed that at F4 & F8 no sound was generated.
Also, F5 sounded like F3, F6 like F2 and F7 like F1. Meanwhile, no significant difference was
observed between F9, F10 & F11. This can be explained by Nyquist criteria.
In the case of F4 & F8, no sound was generated because of the critical condition i.e., Fs = 2F. At
these frequencies, the sound was not generated because of the definition of signal i.e., sine wave.
A sine wave is 0 at multiples of 𝜋.
The similarity of F5 with F3 and so on can be explained as:
𝐹5′ = 𝐹5 − 𝐹𝑠 = 5000 − 8000 = −3000𝐻𝑧
For a sine wave, sin(-x) = sinx.
The same explanation goes for other frequencies.

You might also like