Assignment For DSP
Assignment For DSP
(a) Plot the Following signals from n = 20 to n = 20. Use the command stem to plot the signals.
Clearly mark the time origin in each case.
1
(i) ( )n u[n] 2n u[n 5]
3
n
+ )
4
3
n
(iii)
3 sin(3 + )
4
3
(what is the difference from above signal? Why?)
(ii)
3 sin(
(iv)
e0.1n cos(
n
)
8
sin( n
)
6
(v)
n
6
(b) Suppose you sample an analog signal x(t) = 1 t during the interval 0 6 t 6 1sec with a
sampling period of 0.125 to generate x[n]. Plot x[n], x[n], xeven [n] and xodd [n].
(c) Let x[n] = [2, 4, 3, 1, 5, 4, 7] 3 6 n 6 3. Generate and plot the samples of the following
sequences using stem function.
(i)
(ii)
(iii)
(ii) Compare with the quality of the a standard speech recording (available in moodle)
(iii) Find the max/min/average values and energy of the entire signal
(iv) Split the signal into segments of 20ms long and compute the energy of each segment and
plot it.
(v) Quantize the above recorded file to (i) Single bit (ii) 4 Bits (iii) 16 bits and listen to it.
Observe the quantization noise.
(g) A coarse way to approximate a musical note is to generate a set of harmonics (integer multiples
of a base frequency) and perform a weighted sum with an amplitude that is slowly starting and
stopping. Here we try to generate the following approximation to a musical note:
x[n] = sin(n) + sin(2n) + 2 sin(2n)
w[n] = e1 n (1 e2 n )
y[n] = w[n]x[n]
Start with parameters: = 0.2742830, = 0.5, 1 = 1e 4 and 2 = 1e 3. Generate 8000
samples (n = 0......7999) of the signal and save the signal as wav file with sampling frequency
16000Hz. (ie., a note of length 0.5s)