DIGITAL SIGNAL PROCESSING LAB REPORT
Experiment 1 : Sampling
A.Sampling of a sinusoidal waveform
An analog waveform (band-limited) is sampled at a frequency greater
than the nyquist frequency (2fmax). Since signal was composed of
sinusoidal signals of frequency 1000 Hz, 2000 Hz & 4000 Hz, peaks
are clearly observed at these locations. To compute spectrum of the
signal numerically we applied DFT on truncated signal in
time-domain, where N marked the number of data points into
consideration. From the above plot, it can be clearly seen that as N
increases, peaks are more sharp, i.e. less spreading of spectrum.
This behaviour was very much expected, since more the number of
data points, frequency response leads to ideal response.
B.Sampling at below Nyquist rate and effect of aliasing
Analog waveform (band-limited) is having nyquist frequency (2fmax
=12KHz). Sampling it below the nyquist frequency leads to loss of
information. As shown in the previous plots, frequency component at
1KHz, 2KHz, 4KHz should be present. But at f < 12KHz, component
at f = 4 KHz is not present due to aliasing effect.
C.Spectrum of a square wave
As expected frequency response of square wave is composed of
odd-harmonics with f0 = 1Khz ( T= 1ms). Signal was sampled at rate
much above Nyquist rate and was truncated with N = 256. Since the
signal is real, harmonic symmetry is also clearly observed.
D.Interpolation or Upsampling
There are various strategies for interpolation, one of the is zero interpolation. Analog
band-limited was sampled at frequency f = 2fmax Sampled signal was upsampled to
twice the number of samples by inserting zero between any two data points. It was then
passed to a low pass filter to interpolate at the newly inserted points. Since a sudden fall
and rise at each zero-insertion point causes high frequency component to creep in, low
pass filter will eliminate by by interpolating at those points. I used butterworth filter as a
low pass filter. Resultant signal should be ideally equivalent to a signal sampled at fs =
24KHz. This can be clearly seen from the last plot. Delay between the two signals can
be clearly seen. This delay is introduced due to the filter. As we increase the order of
the filter more delay is expected to creep in.