Assignment 1
Assignment 1
Assignment 1
1. Determine the periodic signal x(n) with N=8 if its DTFS coefficient
ck = { ….0, 0.25, 0.5, 1, 2, 1, 0.5, 0.25, 0 ….}
2. Consider sampling of the signal x(t) = (1/t) sin(t) (a) Sketch the FT of the sampled signal
for the sampling intervals =0.25 and =0.5 (b) Let x(n) = x(n). Sketch the DTFT of the
above signal for the sampling rates given above.
4. Determine the 4 point circular convolution of the sequences x1(n) = {1, 2, 3, 1} and
x2(n) = {4, 3, 2, 2} using (a) time domain formula (b) DFT
5. Consider the finite length sequence x [n] = {1, 1, 1, 1, 1, 1} and let X ( z ) be its z-transform.
2 k
j
If we sample X (z) at zk e 4 for k = 0, 1, 2, 3 we obtain a set of DFT coefficients X-4 (k).
Find the sequence, x4 (n),the IDFT of X-4 ( k )
6. Find the values of X[k] and Y[k], given that v[n] = x[n] + j y[n] and
V[k] = {3+j8, 2+j6, 1 – j5, 4+j8, 5+j2, 3 – j3, j5, - 3+j2}
7. Compute the 8 point IDFT of the following sequence using the radix 2 DIT algorithms.
Follow exactly the signal flow graphs and keep track of all the intermediate quantities.
X (k) = { 2 1.707-j0.707 0.293-j0.707 1-j 0 1+j 0.293+j0.707 1.707-j0.707} for
k= 0,1,2,…,7
8. Let X(k) denote the N point DFT of the N point sequence x(n). Compute X(ej) and X(k) if
(i) x(n)= x(N-1-n) and N is even
(ii) x(n)= x(N-1-n) and N is odd
(iii) x(n)= -x(N-1-n) and N is even
(iv) x(n)= -x(N-1-n) and N is odd
9. Draw the signal flowgraph for a 24 point FFT. Optimise it for minimum number of
multiplications
10. Let x(n) be an arbitrary signal with DTFT X(ej). Express the DTFT of
x1(n) = x(Dn) in terms of X(ej) where D is an integer - Decimation
x2(m) = x(m/U) m=0, U, 2U …
0 otherwise - Interpolation
in terms of X(ej).
Matlab exercises
For Matlab exercises, you need to make a report with your observations and
figures and upload it to moodle. You can work in groups of two.
Effect of Sampling and quantisation
1. Sample the analog signal x(t)=sin(10t) at i) 1000Hz ii) 15 Hz and iii) 7.5 Hz. Plot the discrete
time signal and observe the effect of aliasing.
Sample Solution
% Demo of sampling
t=0:0.001:2;
xa=sin(2*pi*5*t);
plot(t,xa);
hold on;
%%
fs=15; ts=0:1/fs:2;
xs=sin(2*pi*5*ts);
plot(ts,xs,'ro-');
%%
fs=7.5; ts=0:1/fs:2;
xs=sin(2*pi*5*ts);
plot(ts,xs,'go-');
Modify the code to sample the analog signal x(t)=3cos(100t) at i) 400Hz ii) 100 Hz and
iii) 60 Hz. Plot the discrete time signal and observe the effect of aliasing.
4. Record your own voice for half a minute and observe the time-domain waveform.
i) Find the average value and energy of the entire signal.
ii) Split the signal into segments of 20ms long and compute the energy of each segment
and plot it.
5. For the LTI systems described by the following difference equations, generate its impulse
response, and unit step response. Comment on the properties of the system.
6. For the LTI systems described by the following difference equations, generate its frequency
response. Comment on the type of response.
y[n]-0.3695y[n-1]+0.1958y[n-2]=0.2066x[n]+0.4131x[n-1] +0.2066x[n-2]
Sample Solution Frequency response
Magnitude Response (dB) 0
-20
% ex6.m
% Frequency domain response of -40
% y[n]–0.3695y[n-1]+0.1958y[n-2] = -80
0.2066x[n]+0.4131x[n-1]+0.2066x[n-2] 0 0.1 0.2 0.3 0.4 0.5 0.6
Normalized frequency (Nyquist == 1)
0.7 0.8 0.9 1
freqz(b1,a1,64); -100
-200
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized frequency (Nyquist == 1)
i y(n) = 0.77y(n-1)+x(n)+x(n-1)
ii y(n) = 0.77y(n-1)+0.77x(n)-x(n-1)
iii H(z) = 1-z-1/1+0.77z-1
iv H(z) = 1-z-1+z-2-z-3+z-4-z-5
v y(n) = x(n)+x(n-1)+x(n-2)+x(n-3)+x(n-4)+x(n-5)
vi H(z)=3-3z-1
9. Compute and plot the DFT of the following sequences and observe their properties
a) Unit impulse signal; xi = {1 0 0 0 0 0 0 0}
b) All ones; x1 = {1 1 1 1 1 1 1 1}
c) Three point boxcar; xb = {1 1 1 0 0 0 0 0}
d) Symmetric boxcar; xbsy = {1 1 0 0 0 0 0 1}
e) Sinusoid; s[n]= A cos(0n + ) Try for different lengths of sequence.
f) Real exponential; x[n] = (0.9)n u[n] 0 n 31. Compare it with samples of Y(ejw) =
(1-0.9 e -jw)-1, the DTFT of the infinitely long exponential and explain the difference
in terms of windowing.
10. Compare the characteristics of the following window functions from their frequency
spectrum plots. (use wvtool)
a) Rectangular window w_rect[n] = 1 0 n M-1
b) Hanning window w_hann[n] = 0.5-0.5cos(2n/M-1) 0 n M-1
c) Hamming window w_hamm[n] = 0.54-0.46cos(2n/M-1) 0 n M-1
d) Blackmann window w_blk[n] = 0.42-0.5cos(2n/M-1)+0.08cos(4n/M-1)
0 n M-1
11. Generate a signal s[n] with three sinusoidal components at 50, 120 and 240Hz corrupted
by AWGN. Plot the spectrum and identify the signal components.
Sample Solution:
% identification of sinusoids in noise
fs=2000;
t = (0:199)/fs;
s = sin(2*pi*50.*t) + sin(2*pi*120.*t) +sin(2*pi*240.*t);
Sn = fft(sn,200);
f = 0:10:990;
sfmag = abs(Sn);
subplot(212), plot(f,sfmag(1:100));
title(' Spectral estimation'); grid;
12. During recording an ECG signal sampled at 300Hz gets contaminated by 60Hz hum. Two
beats of the original and contaminated signal (600 samples each) are provided as ecgo
and ecg. Load these signals and plot them. Compute the 600point DFT of the
contaminated signal and zero out the DFT components corresponding to 60Hz signal.
Take the IDFT to obtain filtered ECG signal. Display the filtered and original signals.
13. a) Generate 600 samples of the signal x(n) = cos(0.1n) + cos(0.4n) + cos(0.7n). Plot its
DFT magnitude.
(b) Generate 200 samples each of the three signals x1(n) = cos(0.1n), x2(n)= cos(0.4n),
and x3(n) = cos(0.7n). Concatenate them {x1(n), x2(n), x3(n)} to form a 600 sample
signal. Plot its DFT magnitude.
(c) Obtain a time-frequency plot using spectrogram
14. We wish to compute the radix 2 FFT of the signal samples acquired from the signal x(t) =
Acos(2F0t) + B Cos(2(F0+F)t) where F0=100Hz at a sampling frequency Fs=480Hz.
(a) If A=B=1, what is the smallest number of signal samples Nmin required for a
frequency resolution of F=2Hz if (i) rectangular window (ii) Hanning window (iii)
Blackman window is used. Plot the FFT in each case.
(b) If A=1 and B=0.02, Which of the following windows – Rectangular, Bartlett, Hanning,
Hamming, Blackman – can you use to get a frequency resolution of F=2Hz . Which
one will require the minimum number of samples and why? Plot the FFT in each
case.
15. Plot (“dot” plot) time vs length for the function fft for N=100 to 1000