DIGITAL SIGNAL PROCESSING
LABORATORY EXAMINATION
REPORT
PUNIT KUMAR OJHA
18EE01011
Design a digital sinusoidal oscillator having frequency of 100 Hz and amplitude of 2.
Assume the sampling rate is 1000Hz.
Matlab Code:
num = [1.1756 0];
den = [1 -1.618 1];
imp = zeros(500);
imp(1) = 1;
y = filter(num, den, imp);
Y = fft(y);
figure;
plot(y);
title('Output of DSO');
ylabel('Amplitude');
xlabel('n');
figure;
plot(abs(Y(1:250)));
title('Magnitude response');
Graphs:
From magnitude response, we can see there is a maximum at x = 51,
𝑓 = 𝑥 ∗ 𝐹𝑠 / 𝑁 = 51 ∗ 1000 / 500 = 102𝐻𝑧
But the actual frequency we want to generate is 100 Hz. but from our method we get an error
in frequency of signal and the amount of error = 102-100 = 2 Hz.
Design a digital DTMF transmitter and receiver which can transmit the number 7 and
decode the dialled number
Matlab Code:
f1 = 852;
Fs = 5000;
num1 = [0.8775 0];
den1 = [1 -0.9591 1];
imp = zeros(500);
imp(1) = 1;
y1 = filter(num1, den1, imp);
f2 = 1209;
num2 = [0.99867 0];
den2 = [1 -0.103 1];
y2 = filter(num2, den2, imp);
y = y1 + y2;
Y = fft(y);
figure;
plot(y)
title('Output Signal');
ylabel('Amplitude');
xlabel('n');
figure;
plot(abs(Y(1:500)))
title('Magnitude response')
Graphs:
From the magnitude response, we can see two local maximums at x1 = 85, x2 = 121. From
these we get the following frequencies:
f1 = x1 * Fs / N = 85 * 5000/500 = 850 Hz
f2 = x2 * Fs / N = 121 * 5000/500 = 1210 Hz.
Error in 1st frequency = 852 – 850 Hz = 2 Hz
Error in 2nd frequency = 1210 – 1209 Hz = 1 Hz.