Introduction To Digital Signal Processing
Introduction To Digital Signal Processing
Band
limited ADC Computer DAC Smoothing
filter filter
1
Forth Class Electrical Dept.
Communication II Nada Nasih
2. Causality:
A DSP system is said to be causal if the present value of the output is
not the function of a future value of the input.
3. Stability:
A DSP system is said to be stable if the output is bounded for bounded
input.
For example, if y(n)=2x(n)-0.5x(n-1), |x(n)|<G where G is finite, then
|y(n)|<2G-0.5G. hence if x(n) is bounded by G then y(n) is also
bounded i.e. the system is stable.
2
Forth Class Electrical Dept.
Communication II Nada Nasih
y(t)=x(t) h(t)
y(n)=x(n) h(n) or
y(n) x(k )h(n k ) h(k ) x(n k ) which is called the discrete
k k
convolution.
3
Forth Class Electrical Dept.
Communication II Nada Nasih
1 1
0
-3 -2 -1 0 1 2
ii. IIR (Infinite Impulse Response): where h(n) has infinite number
of elements such as : h(n)=(1/2)n u(n) where is the unit step
function:
0 1 2 3 4 5
h(n)
1
0.5
0.25
0.125
0.0625 0.03125
0 1 2 3 4 5
4
Forth Class Electrical Dept.
Communication II Nada Nasih
Sol:
y(n) x(k )h(n k )
k
And so on, shifting of h(n) (left and right) until the over lapping
between x(k) and h(n-k) disappears giving 0's at the output y(n).
x(n) 3
h(n)
2
2
1
1
-1 0 1 -2 -1 0 1
-1 -1
h(-n)
2
-1 0 1
-1
h(-1-n) h(1-n)
2
2
1 1
-2 -1 0 0 1 2
-1
-1
5
Forth Class Electrical Dept.
Communication II Nada Nasih
h(n)={1,-1,2} , x(n)={2,1,-1,3}
Sol:
2 1 -1 3
1 2 1 -1 3
-1 -2 -1 1 -3
sum
2 4 2 -2 6
y(-3)=2 sum
y(-2)=-1 sum
sum
y(-1)=2 sum
y(0)=6 sum
y(1)=-5 y(2)=6
Then y(n)={2,-1,2,6,-5,6}
3. Add-overlap Method:
This is a modified method from the tabular method, when either h(n)
and x(n) has large number of elements, then this can be divided into
sub-segments of smaller length.
6
Forth Class Electrical Dept.
Communication II Nada Nasih
Sol:
Here x(n) is divided into three segments, first two segments of
length 3, and last segment of length 2.
Hence previous tabular method will be repeated 3 times.
1 -1 2
1 1 -1 2
y1(n)={1,1,-1,5,-2} 2 2 -2 4
-1 -1 1 -2
1 -1 2
3 3 -3 6
y2(n)={3,1,1,9,-2} 4 4 -4 8
-1 -1 1 -2
1 -1 2
0 0 0 0
y3(n)={0,3,-3,6} 3 3 -3 6
Then, add y1, y2, and y3, with y2 shifted to the left by 3 elements (length
of each segment) and y3 shifted to the left by 6 elements:
y1 1 1 -1 5 -2
y2 3 1 1 9 -2
y3 0 3 -3 6
y(n) 1 1 -1 8 -1 1 9 1 -3 6
y(n)={1,1,-1,8,-1,1,9,1,-3,6}
7
Forth Class Electrical Dept.
Communication II Nada Nasih
4. Matrix Method:
Here, [Y]=[A][h], where [y(n)]=output, [h]=[h(n)] and the [A] matrix
has N=N1+N2-1 rows and N2 columns (number of elements of h(n)).
The 1st row in [A] is the 1st element in x(n) (from the left) and the
remaining elements are 0's. the 2nd row in [A] is the 2nd element in
x(n), then the 1st element in x(n) and the remaining elements are 0's.
and so on until the last element in x(n) is entered at the N 1th row (N1 is
the number of elements in x(n)). After that 0's are applied instead of
the elements of x(n) until the last row at N=N1+N2-1.
Sol:
2 0 0
1 2 0
1
1 1 2
[h] 1 [ A]
2 3 1 1
0 3 1
0 0 3
2 0 0 2
1 2 0 1
1
1 1 2 2
then [Y ] 1
3 1 1 2 6
0 3 1 5
0 0 3 6
8
Forth Class Electrical Dept.
Communication II Nada Nasih
Sol:
Note, since x(n) has infinite number of elements, then we must use
z-transform method.
Now, taking the z-transform of both h(n) and x(n):
1
H ( z) h( n) z
n 1
n
1.z 1 (1).z 0 2.z 1 z 1 2 z 1
X ( z) x(n) z n (0.5) n z n (0.5z 1 ) n
n n 0 n 0
1 z
X ( z) 1
1 0.5 z z 0.5
Then Y(z)=H(z).X(z)=[z-1+2z-1].[z/(z-0.5)]
z.z z 2
z 0.5 z 0.5 z 0.5
And y(n)=(0.5)n+1u(n+1)-(0.5)nu(n)+2(0.5)n-1u(n-1)
c. z a .z and z b .z
[u (n a)] [u (n b)]
z 1 z 1
z b z z
Z 1[ z a z . ] Z 1[ z ( a b1) . ] (n (a b))u (n (a b 1))
z 1 z 1 ( z 1) 2
9
Forth Class Electrical Dept.
Communication II Nada Nasih
Discrete Deconvolution:
To find h(n) if both x(n) and y(n) are given, we use the z-transform
method since it is valid for both FIR and IIR DSP system.
H(n)=Z-1[H(z)]=Z-1[Y(z)/X(z)]
Sol:
X(z)=1-z-1+3z-2 and Y(z)=2+3z-1-z-2 +17z-3-6z-4 then we use the long
division
2+5z-1-2z-2
1-z-1+3z-2 2+3z-1- z-2 +17z-3-6z-4
2-2z-1+6z-2
5z-1-7z-2 +17z-3-6z-4
5z-1-5z-2 +15z-3
-2z-2 +2 z-3 -6z-4
-2z-2 +2 z-3 -6z-4
0 0 0
Sol:
z 2.z z
X ( z) and Y ( z )
z 1 z 1 z 0.5
2z z
z 1 2z 1 z 1
Then H(z)= z 1 z 0.5 2
z
z z 0.5 z 0.5 z 0.5
z 1
10
Forth Class Electrical Dept.
Communication II Nada Nasih
a. FIR systems:
Here h(n) has finite number of elements:
h(n)={h(0), h(1), h(2), ……. h(m)} with (m+1) elements.
H(z)= h(0)+h(1)z-1+ h(2) z-2, ……. h(m) z-m and if:
H(z)=Y(z)/X(z), then:
y(n)= h(0)x(n)+ h(1)x(n-1)+ h(2)x(n-2) ……. h(m)x(n-m)
x(n)
Z-1 Z-1 Z-1 ---- ---- ---- ---- Z-1
Z-1≡Ts
h(0) h(1)
h(m
)
Ʃ y(n)
Note that the FIR system is always stable, where the system is open
loop without feed back and that is why it is called non-recursive.
11
Forth Class Electrical Dept.
Communication II Nada Nasih
b. IIR systems:
For IIR system having m-zeros and r-poles, then:
Y ( z ) a0 a1 z 1 a 2 z 2 ........ a m z m
H ( z)
X ( z) 1 b1 z 1 b2 z 2 ........ br z r
Where we can always set the first term at the denominator to unity by
dividing with a suitable constant(b0).
Fro which :
y(n)= a0x(n)+ a1x(n-1)+a 2x(n-2)+ … + amx(n-m)- b1y(n-1)-b2y(n-2)-
… -bry(n-r)
x(n)
a0
Ʃ y(n)
Z-1 a1 b1 Z-1
Z-1 Z-1
Z-1 Z-1
Z-1 Z-1
Z-1 Z-1
Z-1 am br Z-1
12
Forth Class Electrical Dept.
Communication II Nada Nasih
Sol:
This is an IIR system. First we divide by 2 to set the first term at the
dominator to unity, then:
2 1z 2
H ( z)
1 1.5 z 1 0.5 z 2 0.5 z 3
This needs a tapped delay line with 2 taps for x and a tapped delay line
with 3 taps for y.
x(n)
2
Ʃ y(n)
Z-1 1.5
Z-1
0.5 Z-1
13