Digital Signal Processing Lab Work (TEC-317) : NAME: Samyak I.D.: 53589
Digital Signal Processing Lab Work (TEC-317) : NAME: Samyak I.D.: 53589
Signal processing
Lab work (TEC- 317)
Contents:
1. Experiment 0
2. Experiment 1 NAME: Samyak
3. Experiment 2
I.D.: 53589
4. Experiment 3
5. Experiment 4
6. Experiment 5
7. Experiment 6
8. Experiment 7
9. Experiment 8
1
EXPERIMENT:0
Objective :
Mathematical/Signal operations on signals using Matlab
a) Perform basic signal manipulations in Matlab. The signal manipulations
should be able to perform time-shifting, time-reversal, up-sampling, and down-
sampling
Matlab codes:
Results:
Original signal:
Time-shifting:
Reflection:
Downsampling:
Matlab codes:
Experiment No. 2
System Analysis. The objective is to write a modular and efficient DSP
code for LTI system taking input to it. Plot the frequency spectrums of
the input and output. Use this method to design a system that clips the
input sinusoidal signal and analyze the output in terms of SNR and total
harmonic distortions.
Part a) Write the codes in Matlab analyze them. Then Explain what is happening
in the code in your lab report with the figures obtained.
Matlab codes
Experiment No. 3
Aliasing. The effect of sampling on an audio signal and its removal using
a low pass filter. Hear the effects using your system’s audio card.
Part (a) – Sampling an audio signal at four different rates and then
played back to hear the effects of aliasing. See the spectral graphs so
obtain.
Matlab codes:
Part (b) – It is the same experiment as before , but this time illustrating
the effect of lowpass filtering is done brfore decimation to avert aliasing.
Write and complete the code given below in MATLAB and hear how low
pass filtering helps in averting the adverse effects of sampling.
Matlab codes:
Experiment No. 4
Windowing. The objective of this lab experiment is to illustrate (1) the
magnitude of the frequency response of different windows and (2) the
truncation effects on a signal by the windowing process.
Matlab codes:
Results:
Part (b) – Plot a cosine signal and its spectra. Now, truncate the signal in
the time domain and then plot its spectra. In the end, compare the
spectra of the truncated and the original signal in one plot.
Matlab codes
Results:
Cosine spectrum
Truncated cosine
Experiment No. 5
Speech Analysis
Part (a) – Plot different sections of a given speech signal. Complete the
code and hear the audio file.
Matlab codes:
Part (b) – Play the speech signal after being quantized after a specified
number of levels. Plot the parts of speech using the method shown above.
Also plot the quantization error. Complete the code.
Matlab codes:
Experiment N0. 6
FIR filter Design
Part(a) – Consider a comtinuos sinusoidal signal defined as x(t) = 2
+cos(10t). Design a low pass digital filter to filter out the sinusoidal term
from the signal. Use different windows (Rectangular, Hanning,
Hamming, Blackman) for the designing purpose and analyze the results.
Find the coefficient of filter, h(n), using the rectangular window.
Matlab codes:
When we sample x(t), we should sample at a frequency that is at least twice the maximum
frequency in the signal. The maximum frequency in x(t) is fm = 10/2π = 1.59 Hz. Thus fs should
be at least 2(1.59) = 3.18 Hz. The sampling frequency corresponds to the sampling period 1/3.18
= 0.31 seconds. Let us take Ts = 0.1 seconds as a sampling period. This value of Ts still prevents
aliasing. The analog frequency that we would like to suppress is the ωc = 5rad/sec will suppress
the cos(10t) term. This ωc= 5rad/sec analogue frequency corresponds to thedigital frequency Ωc =
ωcTs = 5(0.1) = 0.5. Thus, we will design a low pass digital filter with Ωc= 0.5 as the cutoff
frequency.
Output :