Вы находитесь на странице: 1из 5

CE725 ADVANCED DIGITAL SIGNAL PROCESSING

ASSIGNMENT 1 (January 22, 2018)

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.

3. Compute the 8 point DFT of the sequence x (n) = { 2 -1 1 -1 2 3 4 3 }

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(10t) 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(100t) at i) 400Hz ii) 100 Hz and
iii) 60 Hz. Plot the discrete time signal and observe the effect of aliasing.

Time domain analysis


2. Consider the discrete time signal x(n) = cos (2πn/7).
(i) Obtain and plot the downsampled(decimated) signal y(n) = x(2n) along with x(n)
(ii) Obtain and plot the upsampled (interpolated) signal z(n) = x(n/2) for n even and z(n) =
0 otherwise along with x(n)

3. In DTMF dialling a number is represented by a dual frequency tone.


(i) Do a web search and find the frequencies of each digit
(ii) Generate DTMF tones corresponding to the telephone number 0824-2474040 by
sampling the sum of sinusoids at the required frequencies at Fs = 8192 Hz.
Concatenate the signals by putting 50 zeros between each signal (to represent
silence) and listen to the signal.

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.

(i) y[n]-0.3695y[n-1]+0.1958y[n-2]=0.2066x[n]+0.4131x[n-1] +0.2066x[n-2]


(ii) y(n) = 0.77 y(n-1) + x(n) +x(n-1)
(iii) y(n) = 0.77 y(n-1) + 0.77 x(n) +x(n-1)

Frequency domain analysis


Note: Use freqz for all the questions in this section on Discrete Time Fourier transorm (DTFT).
Do not use fft

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

difference equations -60

% 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

b1 = [0.2066 0.4131 0.2066];


a1 = [1 –0.3695 0.1958]; -50
Phase (degrees)

freqz(b1,a1,64); -100

title(‘ Frequency response’) -150

-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)

7. Observe the relation between location


of poles and zeroes in z plane, impulse response and frequency response for the
following systems

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

8. Let x(n)=cos(0.2n) + 0.5 cos(0.4n); 0≤ n ≤ 99.


(i) Plot the spectrum of this signal.
(ii) Generate zero interpolated signal y(n)=x(n/2) and plot its spectrum. Comment on
your observations.
(iii) Generate the decimated signal d(n)=x(2n) and plot the spectrum. Comment on your
observations.
(iv) Generate the decimated signal d(n)=x(3n) and plot the spectrum. Comment on your
observations.
Discrete Fourier Transform
Note: use fft in this section

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(2n/M-1) 0 n  M-1
c) Hamming window w_hamm[n] = 0.54-0.46cos(2n/M-1) 0 n  M-1
d) Blackmann window w_blk[n] = 0.42-0.5cos(2n/M-1)+0.08cos(4n/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);

awgn = (0.5*randn(1,200)+.25); % N(0.25, 0.25)


sn = s+awgn;
subplot(211), plot(t,sn);
title(' Sinusoid with noise'); grid;

Sn = fft(sn,200);
f = 0:10:990;
sfmag = abs(Sn);
subplot(212), plot(f,sfmag(1:100));
title(' Spectral estimation'); grid;

Repeat using Simulink

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(2F0t) + 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

Вам также может понравиться