You are on page 1of 60

EE 402 Digital Signal Processing

Fall 2012
Adil Masood Siddiqui
dradil@mcs.edu.pk
Week # 2

Conv Sum by Analytical Method
a
a
n y
a a a n y
a a y
a y
a y
n a n h
n u n x
n
n
n

=
+ + + + =
+ + =
+ =
= =
=
=
+
1
1
] [
..... 1 ] [
1 ] 2 [
1 ] 1 [
1 ] 0 [
] [ ] [
] [ ] [
1
2
2
0
Example:

Conv Sum by Analytical Method

<
|
|
.
|

\
|

s s

<
=
+ + + + =
+ + =
+ =
= =
=
=
+
+
n N
a
a
a
N n
a
a
n
n y
a a a n y
a a y
a y
a y
n u a n h
N n u n u n x
N
N n
n
n
n
1
1
1
1 0
1
1
0 0
] [
..... 1 ] [
1 ] 2 [
1 ] 1 [
1 ] 0 [
] [ ] [
] [ ] [ ] [
1
1
2
2
0
Example:
2D Convolution
Example of 2D Convolution
Low Pass Filtering/Image Smoothing
Noise Removal Using Median Filtering
High Pass Filtering/Edge Detection
Properties of Convolution
Stability
Stability
Causality
Example
Linear Constant Coefficient Difference
Equation
For all computationally realizable LTI systems, the input and the output
satisfy a difference equation of the form



This leads to the recurrence formula



Which can be used to compute the present output from the present and
M past values of the input and past N values of output



LCCDE: Linear Constant Co-efficient
Difference Equation
This addition and multiplication are infinite, if
the h[n] is infinite.
E.g. in Accumulator

] [ ] 1 [ ] [
] 1 [ ] [ ] [
] [ ] 1 [
] [ ] [ ] [
] [ ] [
1
1
n x n y n y
n y n x n y
k x n y
k x n x n y
k x n y
n
k
n
k
n
k
=
+ =
=
+ =
=

=
=
LCCDE
Means, we can represent input and output in
terms of difference equation

0 0
1 0 0 0
[ ] [ 1] [ ]
[ ] [ ]

[ ] [ ] [ ]
N M
k m
k b
N M
k k
k b
y n y n x n
a y n k b x n m
More Generalized form is
a b
y n y n k x n k
a a
= =
= =
=
=
| | | |
= +
| |
\ . \ .


Auto-Regressive Part Moving Average Part
First Order Difference Equation


LCCDE Implementation

= =
+ =
M
b
k
N
k
k
k n x b k n y a n y
0 1
] [ ] [ ] [
LTI Systems- Frequency Domain
Analysis

9/19/2012
Frequency Representation
LTI System
h(n)
LTI System
Interpretation of impulse and frequency response
jwn
e
) (
jwn jwn
e H e
( )
[ ] [ ] [ ]
[ ]
[ ] [ ]
[ ] [ ]
n
j n
j n k
n
j n j k
n
y n h k x n k
for x n e
y n h k e
y n e h k e
e
e
e e
+
=
+

=
+

=
=
=
=
| |
=
|
\ .

9/19/2012
Frequency Representation
Example
9/19/2012
u
t
t
t
t t
t t
t
t t
j
n
j
n
j
n
j
j
n
j
n
j
n
j
k
n
j
re e
jb a e
j e
e e
e h e h
k n x k h n y
e n x
n h
4
4
4
4 4
) 1 (
4
1
) 0 (
4
0
1
0
4

) (
))) 4 / sin( ) 4 / (cos( 1 (
) 1 (

] [ ] [ ] [
] [
] 1 1 [ ] [
=
+ =
=
=
+ =
=
=
=

9/19/2012
9/19/2012
Periodicity of Freq Response
9/19/2012
( 2 ) ( 2 )
2
2
( 2 )
( ) [ ]
[ ]
cos(2 ) sin(2 ) 1 for n integer
( ) ( )
j j n
n
j n j n
n
j n
j j
H e h n e
h n e e
e n j n
H e H e
e t e t
e t
t
e t e
t t

+ +
=

+
=
=
= =
=

Convergence of Frequency Response


9/19/2012
Ideal Delay:
9/19/2012 28
( )
[ ] [ ]
[ ]
[ ]
( )
d d
d
d
j n
j n n j n j n
d
j j n
y n x n n
x n e
x n n e e e
H
e e
e
e e e
e e

=
=
In ideal delay system, input remains same,
and only phase changes
Frequency Response: Example
9/19/2012
| | | |
e
e
o o
e
e e
e
e e
cos 2 ) (
cos 2
)
2
( 2
] [
Re ) (
1 1 ] [
] 1 [ ] 1 [ ] [
) 1 ( ) 1 (
=
=
+
=
+ =

+ + =
+ + =

+
jw
j
j j
n j
n j n j
jw
e H
e
e e
e
e e n y
sponse Frequency e H
n n n h
n x n x n y
Freq Response tells us, how the input
frequency is mapped at output
9/19/2012
9/19/2012
9/19/2012
Continuous Time Fourier Transform
Example
Discrete Time Fourier Transform
Existence of DTFT
Comparison between Fourier Series &
DTFT
Example:
1 | |
1
1
] [
1
1

) (

] [
] [ ) (
] [ ] [
0
0
0
<

= =
=
=
=
=
=

a
ae
n u a
ae
e a
e n u a
e n x e X
n u a n x
jw
n
k
k
n
n jw
n
jwn n
n
jwn n
n
jwn jw
n
o
o
Ideal Delay:
d d
jwn jwn n n jw
d
jwn
d
e e e n n x
e n x
n n x n y

=

=
) (
] [
] [
] [ ] [
In ideal delay system, input remains same,
and only phase changes
Example:
jw
jw
n
n
jw
n
n
ae
e a
n u a a
n u a a a
ae
n u a
n u a


1
] 5 [
] 5 [
1
1
] [
? ] 5 [
5 5
5 5
5 5
Example:
Ideal Delay
d I
d R
jwn jw
n
jwn
d
jw
n
jwn jw
wn H
wn H
f dt t f t e e H
e n n e H
e n h e H
Or
d
sin
cos
) ( ) ( ) ( ) (
] [ ) (
] [ ) (
=
=
= =
=
=
}

t t o
o
Magnitude and Phase of Fourier
DTFT Properties
45
DTFT Properties
Symmetric Properties: Rebuild
Symmetric Hermition real
e X e X n x n x
odd odd
e X e X n x n x
even even
e X e X n x n x
e X n x
e X n x then
e X n x if
jw jw
jw jw
jw jw
jw
jw
jw

) ( ) ( ] [ ] [

) ( ) ( ] [ ] [

) ( ) ( ] [ ] [
) ( ] [
) ( ] [
) ( ] [
* *
* *

= =
= =
= =

Consequence of Hermitian symmetry


odd is ) (
even is | ) ( |
odd is )] ( Im[
even is )] ( Re[
) ( ) (
*
jw
jw
jw
jw
jw jw
e X
e X
e X
e X then
e X e X If
Z
=

If x[n] is real and even, X(e
jw
) will be real and even
If x[n] is real and odd, X(e
jw
) will be imaginary and odd

Even Function
Odd Function
Example:
Example:
Example:
3 ) cos( 4 ) 2 cos( 2 ) (
2 3 2 ) (
) 2 ( ) 1 ( 2 ) ( 3
) 1 ( 2 ) 2 ( ] [
2 2
+ + =
+ + + + =
+ +
+ + + + =

w w z H
e e e e z H
n n n
n n n h
w j jw jw w j
o o o
o o
Let we have LTI system with response
Comments: Frequency response is real,
so system has zero phase shift, this is
to be expected since unit sample
response is real and even
Delayed Even Function
) 3 ) cos( 4 ) 2 cos( 2 ( ) (
) 2 3 2 (
2 3 2 1 ) (
) 4 ( ) 3 ( 2 ) 2 ( 3
) 1 ( 2 ) ( ] [
2
2 2 2
4 3 2
+ + =
+ + + + =
+ + + + =
+ +
+ + =



w w e z H
e e e e e
e e e e z H
n n n
n n n h
w j
jw jw jw w j w j
w j w j w j jw
o o o
o o
All even functions have real
Fourier Transform, If we make
it causal, it will be a complex
DTFT and LTI System
DTFT:
Example:
Moving Average
Inverse Fourier Transform
] [ ] [
) 1 )( 1 (
1
n u b
a b
b
n u a
b a
a
be ae
n n
jw jw



Freq Response of LCCDE
] 1 [ )
2
1
(
4
1
] [ )
2
1
(
] 1 [
4
1
] [ ] 1 [
2
1
] [
1

=

n u n u
n x n x n y n y
n n
Use freqz(B,A,X) for frequency response of the equation

You might also like