DSP Lab Project #2
DSP Lab Project #2
N M
Difference equation: ak yn k bk xn k ; a0 0 (5)
k 0 k 0
M
Y z
bk z k
H z k 0
Transfer function H(z): X z N (6)
1 a k z k
k 1
Table P2-1: MATLAB DSP Tool box Commands for DT Systems Analysis
Commands/ Numerical Results and Description
Operations
conv Convolution and polynomial multiplication.
Notes
For the simulation of causal LTI discrete-time systems described by difference equation,
the command filter can be used. There are several versions of this command. If the
numerator and denominator coefficients are denoted as follows:
num = [ p0 p1 ... pM]; num ⇒ numerator coefficient vector
den = [ d0 d1 ... dN]; den ⇒ denominator coefficient vector
Then y = filter (num, den,x) generates an output vector y of the same length as the
specified input vector x with zero initial conditions, that is, y[-1] y[-2] = ... = y[-N] = 0.
The output can also be computed using y = filter(num, den, x, ic)
Where ic = [y[-1], y[-2], ..., y[-N]] is the vector of initial conditions.
Access to final conditions can be obtained using [y, fc] = filter (num, den,x, ic).
a. Use the MATLAB filter command to find the output signal for an input signal:
System No. 2: yn 0.53 yn 1 0.46 yn 2 0.45xn 0.5 xn 1 0.45xn 2
a. Compute the responses of the above two systems for a sinusoidal input:
2n 200n
xn cos cos , 0 n 299
256 256
b. In this project both filters are lowpass filters but with different attenuation in the
stopband, especially at the frequencies of the input signal. Which filter has better
characteristics for suppression of the high-frequency component of the input signal x[n]?
hn 0, n 0 & n M
yn is output sequence
xn is input sequence
hk is system impulse response
(ii) Infinite-impulse response (IIR)
yn hn xn hk xn k (8)
k 0
1 0 1 2
Y z
bk z k
H z k 0
X z N
1 a k z k (9)
k 1
Notes
Thus for complex exponential input sequence, the output of an LTI DT system is also a
complex exponential signal of the same frequency multiplied by a complex constant,
H
that is:
yn H e jwn
(11)
In the most general case if the input to an LTI DT system consists of an arbitrary linear
combination of sinusoids of the form
N
xn Ai cosi n i , - n (12)
i 1
Then the response of the system is simply:
N
yn Ai H i cosi n i i , (13)
i 1