Digital Signal Processing Lab Experiment 2
Digital Signal Processing Lab Experiment 2
EXPERIMENT 2
1) Generate an approximate analog signal given by x(t) = 5 cos (2π × 100t),t ≥ 0
● with the spacing between the samples to be very small (≈0), say 10μs =
0.00001.
● Choose the time duration, say x(t) exists for 0.1seconds.
DISCUSSION:
DISCUSSION:
● On taking the Nyquist rate to sample the signal, we can observe that a periodic
signal can be approximated well on a basic level.
● Nyquist rate is given as sampling frequency is greater than or equal to twice of
the message signal frequency.
● In the Nyquist rate, per time period, there will be 2 samples in one oscillation of
signal.
● In this case, for a sinusoidal signal with one frequency component, we have two
samples in one time period, one at the positive peak (+5) and one at the negative
peak (-5)
3) Undersampling and Oversampling: Repeat step 2 for different sampling
frequencies, i.e.,
f௦ = 1.3 × f & f௦ = 2.2 × f
DISCUSSION:
DISCUSSION:
● The ‘shape’ of the aliased signal is completely different from the original signal.
This is due to aliasing
● Due to the shape of the signal not being preserved, we are not able to extract the
original signal
5) Natural Sampling
DISCUSSION:
● Unlike Ideal Sampling the Natural Sampling does not have proper ‘samples’. The
resultant signal is the same pulse train with amplitude varying with analog signal
● The pulse train can be generated using the square() function and to restrict it to
positive values, we can set all values of the resulting 1D matrix to 0 if it is a
negative number
EXERCISES
1) Load Speech/Music data (1D), Gray scale image (2D) and Video (3D) data and
understand the Matrix representation of the same using MATLAB workspace.
3) Apply the upsampling and downsampling operations on an audio file (say, an audio
with sampling frequency 44100 Hz) and listen to the original audio and the audio files
after the Operations.
DISCUSSION :
Upsampling
● Upsampling increases the data rate and introduces new samples.It might
increase the file size without improving audio quality significantly.
● If we need to upsample the file by n times, we will be adding n-1 0’s between each
sample
● Upsampling increases the length of the audio file by n times. In our experiment,
we used an audio file of 10s. On upsampling by 5 times, we got the file to about
52s
Downsampling
● Both operations have implications for the signal's frequency content and can
impact the perceived audio quality.
● The choice between upsampling and downsampling depends on the specific
requirements of the application, such as file size, bandwidth constraints, or
processing efficiency.