You are on page 1of 2

EE301

IIT Kanpur
Course Instructor: Dr. Naren Naik
Assignment -1 (22 January 2019)
Objectives: By the end of this assignment the student should become familiar with plotting and
visualising discrete representations of signals in MATLAB. The student should also be able to analyse
and interpret visually and quantitatively the discrete signals presented and perform elementary
signal analysis.

Q1. To plot a sine wave of frequency 2kHz in the continuous and discrete domain for 5 cycles.

1. Initialize an array “t” to describe the continuous time. Choose appropriate minimum and
maximum values for “t”. What is the spacing between elements of “t”?
Note: It is impossible to plot a truly continuous signal on the computer and discretisation is
inevitable. It may seem confusing to use a fixed set of points to describe a continuous signal.
Look at it the same way you would plot a sine wave on paper with fixed number of points
and interpolation between them.
2. The sine wave is given by
x(t)= sin(2*pi*F*t)
where F is the signal frequency. Plot x(t) using the ‘plot’ function in MATLAB.
3. The discrete version of x(t) is given by
x[k]=sin(2*pi*F*n/Fs)
Here ‘n’ is the time index and carries integer values only, and F s is the sampling frequency.
Initialize an array [n]=1:N where N is the maximum number of samples. Choose N wisely.
4. Plot x[k] with (a) Fs = 3*pi*F
(b) Fs = 3*F
(c) Fs = (5/3)*F
(d) Fs = 7*F

Use the ‘stem’ function to plot the signal.

(i) Comment on the output observed in each case.


(ii) In which of the cases above is the discrete time signal periodic and for which cases is
it aperiodic? State the period for each discrete signal
(iii) Can you comment on when the discrete time signal corresponding to a periodic
continuous time signal is periodic (or aperiodic)?
(iv) How would you choose a suitable Fs?

Q2. To compute the Discrete Fourier Transform/ Fast Fourier Transform of a signal

1. For the continuous time signal generated in 1.2. Plot the magnitude spectrum.
2. For the discrete time signals generated in 1.4(a)-(d) Plot the magnitude spectrum.
3. Obtain the frequency of the discretised signals from the magnitude spectrum.
4. Vary the number of samples (N1, N2, N3, N4) and the number of FFT points (L1, L2, L3, L4).
What effect does this have on the observed frequency?
Q3. A rock band is playing the Open Air Theatre in New SAC. The band stands in the front of the
stage. Each of the stage walls contributes to a 70% echo in the sound produced. The distance of the
back-wall from the centre of the stage is 17.15 meters. And the distance of the sidewalls is 8.575
meters. The speed of sound is 343metres/s. A recorder is placed near the band to record the audio.
The band plays the audio clip below (Audio1).

1. Open the wav file in MATLAB using the ‘wavread’ function. What is the sampling frequency?
What are the units? What is the sampling frequency in Hz? Listen to the audio in MATLAB
using the ‘sound’ command.
2. Due to the echo from the walls, the signal recorded by the recorder is given by
y[n] = x[n] + A1*x[n-N1] + A2*x[n-N2] + A3*x[n-N3]

What are the values of A1,A2,A3 and N1,N2,N3? Can you generate the signal generated by
the recorder?

3. What is the system response of this system? Is it possible to remove the echo from the
signal?
4. Given the audio clip with echo (Audio2).
Plot the autocorrelation functions for Audio1 and Audio2 separately using the function
‘xcorr’ in MATLAB. Observe the peaks in each case. Can you spot the echo in the plot for
Audio 2? What time index does it correspond to?
Note: Autocorrelation helps to bring out the self-similarity in a given signal.
5. Given that the echo is of the same magnitude as the original signal, can you obtain the signal
without echo?
Note: Adding and subtracting “echo” are important applications in audio signal processing.
The techniques developed above are simplistic methods for adding echo as well as
subtracting. Using time dependent reflection amplitudes it is possible to generate different
types of echoes.

You might also like