0% found this document useful (0 votes)
16 views43 pages

Bme3361 L03

Uploaded by

fundacvlk7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views43 pages

Bme3361 L03

Uploaded by

fundacvlk7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

ELEN E4810: Digital Signal Processing

Topic 3: Fourier domain


1. The Fourier domain
2. Discrete-Time Fourier Transform (DTFT)
3. Discrete Fourier Transform (DFT)
4. Convolution with the DFT

Dan Ellis 2013-09-23 1


1. The Fourier Transform
! Basic observation (continuous time):
A periodic signal can be decomposed
into sinusoids at integer multiples of the
fundamental frequency
! i.e. if x÷ (t) = x÷ (t +T )
we can approach x÷ with
Harmonics
M " #
! 2πk of the
x̃(t) ≈ ak cos t + φk fundamental
T
k=0
Dan Ellis 2013-09-23 2
M " #
2πk
Fourier Series
!
ak cos t + φk
T
k=0
! For a square wave,
! k−1
(−1) 2 k1 k = 1, 3, 5, . . .
φk = 0; ak =
0 otherwise
! " ! " ! "
2π 1 2π 1 2π
i.e. x(t) = cos
T
t − cos
3 T
3t + cos
5 T
5t − . . .
"

%#$

! %#$

! "
! "#$ ! " ! %#$ % %#$ " "#$

Dan Ellis 2013-09-23 3


M
Fourier Domain
! x is equivalently described
by its Fourier Series ak 1.0
parameters:
k−1 1 1 2 3 4 5 6 7 k
ak = (−1) 2 k = 1, 3, 5, . . .
k φk
!

Negative ak is
equivalent to phase of π 1 2 3 4 5 6 7 k
!
M
j 2πk
T t
! Complex form: x̃(t) ≈ ck e
k=−M

Dan Ellis 2013-09-23 4


!
M

Fourier Analysis x̃(t) ≈


k=−M
j 2πk
ck e T t

! How to find {|ck |}, {arg{ck }} ?


Inner product with
(conjugate) complex sinusoids:
! T /2
1 −j 2πk
ck = x(t)e T t dt
T −T /2

Dan Ellis 2013-09-23 5


Fourier Series Analysis
! T /2
1 −j 2πk
T t
! Thus, ck = T x(t)e dt
−T /2
−j 2πk
T t
because complex sinusoids e
pick out the corresponding sinusoidal
components linearly combined in
!
M
j 2πk
T t
x(t) = ck e
k=−M

Dan Ellis 2013-09-23 7


Fourier Transform
Fourier series for periodic signals
!

extends naturally to Fourier Transform


for any (CT) signal (not just periodic):
! ∞
Fourier
X(jΩ) = x(t)e−jΩt dt Transform (FT)

!
1 ∞
jΩt Inverse Fourier
x(t) = X(jΩ)e dΩ Transform (IFT)
2π ∞
! Discrete index k " continuous freq. #
Dan Ellis 2013-09-23 8
Fourier Transform
! Mapping between two continuous
functions: ##!1"# !
/*0*/++
,+12 3#!

3$!

!"!#
!!""
3%!

3&!
!"!4 ! #!!! $!!! %!!! &!!!
56*7+,+89

!
$%&'#!1"(
/
3!"!4
! !"!!# !"!!$ !"!!% !"!!& /!"
'()*+,+-*.
!

</!"

</
! #!!! $!!! %!!! &!!!
2# ambiguity 56*7+,+89

Dan Ellis 2013-09-23 9


Fourier Transform of a sine
j! 0 t
! Assume x(t) = e ∞
1
Z
jΩt
Now, since x(t) = X(Ω)e dΩ
2π −∞
...we know X(Ω) = 2πδ(Ω − Ω0)
...where δ(x) is the Dirac delta function
$(x-x0)
(continuous time) i.e.
# ! ( x " x0 ) f ( x) dx = f ( x0 ) x0
f(x)
x
j! 0 t
! " x(t) = Ae X(!) = A" (! # ! 0 )
Dan Ellis 2013-09-23 10
Fourier Transforms
Time Frequency
Fourier Series Continuous Discrete
(FS) periodic ~x(t) infinite ck
Fourier Continuous Continuous
Transform (FT) infinite x(t) infinite X(Ω)
Discrete-Time Discrete Continuous
FT (DTFT) infinite x[n] periodic X(ejω)
Discrete FT Discrete Discrete
(DFT) finite/pdc ~x[n] finite/pdc X[k]
Dan Ellis 2013-09-23 11
2. Discrete Time FT (DTFT)
! FT defined for discrete sequences:
#
j!
X(e ) = $ x[n]e " j!n
DTFT
n="#
! Summation (not integral)
! Discrete (normalized)
frequency variable ω
! Argument is ejω, not jω

Dan Ellis 2013-09-23 12


DTFT example
! e.g. x[n] = αnáμ[n], |α| < 1 -1 1 2 3 4 5 6 7 n
$
" X(e ) = %n=#$ " µ[n]e
j! n # j!n

$ # j! n
= %n=0 ("e ) ! !
S = " c # cS = " c
n n
!" !"#"_$#&t 1
#$ = # j!
n =0 n =1

%
1 # "e # S $ cS = c = 1 0
!!""#t#! $%&'!""#t#(
# /
1 ( |c | < 1 )
"
/ "/ #/ $/ %/
t
#S =
&

! / "/ #/ $/ %/
t
</
1$c
Dan Ellis 2013-09-23 13
Periodicity of X(ejω)
! X(ejω) has periodicity 2π in ω :
X(e j (! +2 " )
) = # x[n]e $ j (! +2 " )n

= # x[n]e $ j!n
e $ j 2 "n
= X(e ) j!

!!""#t#! $%&'!""#t#(
# /

" t
/ "/ #/ $/ %/
&
t
</
! / "/ #/ $/ %/

! Phase ambiguity of ejω makes it implicit


Dan Ellis 2013-09-23 14
Inverse DTFT (IDTFT)
! Same basic ÒFourier SynthesisÓ form:
1 !
x[n] =
2!
$# ! X(e j"
)e j"n
d" IDTFT

! Note: continuous, periodic X(ejω)


" discrete, infinite x[n] ...
! IDTFT is actually Fourier Series analysis
(except for sign of ω)

Dan Ellis 2013-09-23 15


DTFTs of simple sequences
#
! x[n] = δ[n] j!
X(e ) = $ x[n]e " j!n

n="#
" j! 0
=e =1 (for all ω)

! i.e. x[n]" " X(ejω)


" " " δ[n]" " 1
x[n] X(ej&)

-3 -2 -1 1 2 3 n -π π ω

Dan Ellis 2013-09-23 19


DTFTs of simple sequences
1 ! IDTFT
j! n
! x[n] = e 0 : x[n] =
2!
$ #!
X(e j"
)e j"n
d"
j!
" ""X(e ") = 2"" # $ (!" % ! 0 ) over -π < ω < π
but X(ejω) must be periodic in ω
e j! 0 n
&k 2" # $ (! % ! 0 % 2"k)
! If ω0 = 0 then x[n] = 1 # n
X(ejω)
so 1 &k 2! " # ($ % 2!k)
0 2π 4π

Dan Ellis 2013-09-23 20


DTFTs of simple sequences
! From before:
n 1
! µ[n] " j# ( |α | < 1)
1 " !e
! μ[n] tricky - not finite
1
µ[n] ! j"
+ %k #$ (" + 2#k)
1! e
DTFT of 1/2
Dan Ellis 2013-09-23 21
DTFT properties
! Linear:
j$ j$
!g[n] + "h[n] # !G(e ) + "H (e )
! Time shift:
! j#n 0 j#
g[n ! n0 ] " e G(e )
! Frequency shift: ÔdelayÕ
j (! #! 0 )
e j! 0 n
g[n] " G (e ) in
frequency

Dan Ellis 2013-09-23 22


DTFT example
! x[n] = δ[n] + αn μ[n-1] ?
" = δ[n] + α(αn-1 μ[n-1])
j! % # j! $1 1 (
" X(e ) = 1+ " ' e $ *
& 1 # "e )
# j!

# j! # j! # j!
"e 1 # "e + "e
= 1+ # j!
= # j!
1 # "e 1 # "e
1
= # j! x[n] = αn μ[n]
1 # "e
Dan Ellis 2013-09-23 23
#

DTFT symmetry X(e j! ) = $ x[n]e" j!n


n="#

!If x[n] " X(ejω) then...


" x[-n]" X(e-jω) from summation
" x*[n] " X*(e-jω) (e-jω)* = ejω
1
Re{x[n]} " XCS(e ) = [ X (e j! ) + X * (e" j! )]

2
conjugate symmetry cancels Im parts on IDTFT
1
jIm{x[n]} " XCA (ejω)= [ X (e ) " X (e )]
j! * " j!

2
" xcs[n] " Re{X(ejω)}
" xca[n] " jIm{X(ejω)}"
Dan Ellis 2013-09-23 24
DTFT of real x[n]
! When x[n] is pure real, X(ejω) = X*(e-jω)
XCS
xcs[n] $ xev[n] = xev[-n] XR(ejω) = XR(e-jω)
xca[n] $ xod[n] = -xod[-n] XI(ejω) = -XI(e-jω)

&'#(
!%&!$"

x[n] real, even !"#$

X(ejω) even, real !"#!$"

Dan Ellis 2013-09-23 25


DTFT and convolution
! Convolution: x[n] = g[n]! h[n]
j! $ # j!n
X(e ) = %n =#$ ( g[n] " h[n]) e
= %n ( %k g[k]h[n # k])e # j!n

= %k ( g[k]e # j!k
%n h[n # k]e # j! (n #k )
)
j! j!
= G(e ) & H (e )
Convolution
j# j#
g[n]! h[n] " G(e )H (e ) becomes
multiplication
Dan Ellis 2013-09-23 26
Convolution with DTFT
j# j#
! Since g[n]! h[n] " G(e )H (e )
we can calculate a convolution by:
! finding DTFTs of g, h " G, H
! multiply them: G!H
! IDTFT of product is result, g[n]! h[n]
G(e j! )
g[n] DTFT
Y (e j! ) y[n]
IDTFT
h[n] DTFT
H (e j! )

Dan Ellis 2013-09-23 27


M
DTFT convolution example
1
j!
! x[n] = αnáμ[n] X(e ) = " j!
1 " #e
! h[n] = δ[n] - αδ[n-1]
" " " " H (e ) = 1 " # (e
j! " j! $1
) $1
! y[n] = x[n] % h[n]
j! j! j!
" " Y (e ) = H (e )X(e )
1
! j# (
= $ 1 ! "e ) = 1
! j#

1 ! "e
" y[n] = δ[n] i.e. ...
Dan Ellis 2013-09-23 28
ParsevalÕs relation
! ÒEnergyÓ in time and frequency domains
are equal:
1 #
" g[n]h [n] = 2# &% # G(e )H (e )d$
* j$ * j$

!n

! If g = h, then gág* = |g|2 = energy...

Dan Ellis 2013-09-23 30


Energy density spectrum
2
! Energy of sequence ! g = # g[n]
"n

1 "
%$ " G(e j# 2
! By Parseval !g = ) d#
2"
! Define Energy Density Spectrum (EDS)
j! j! 2
Sgg (e ) = G(e )

Dan Ellis 2013-09-23 31


EDS and autocorrelation
! Autocorrelation of g[n]:
"
rgg [!] = # g[n]g[n ! !] = g[n]$ g[!n]
n=!"
j! " j!
DTFT {rgg [!]} = G(e )G(e )
! If g[n] is real, G(e-jω) = G*(ejω), so
j! 2 j! no phase
DTFT {rgg [!]} = G(e ) = Sgg (e ) info.
! Mag-sq of spectrum is DTFT of autoco
Dan Ellis 2013-09-23 32
3. Discrete FT (DFT)
Discrete FT Discrete Discrete
(DFT) finite/pdc x[n] finite/pdc X[k]
! A finite or periodic sequence has only
N unique values, x[n] for 0 $ n < N
! Spectrum is completely defined by N
distinct frequency samples
! Divide 0..2π into N equal steps,
2πk
{ωk } =
N
Dan Ellis 2013-09-23 33
DFT and IDFT
! Uniform sampling of DTFT spectrum:
N #1 2 "k
#j n
X[k] = X(e ) ! = 2 "k = $ x[n]e
j! N

N n=0

N !1 2π/N
! DFT: X[k] = " x[n]W N
kn
1
n=0 WN

2"
!j
where WN = e N
i.e. -1/Nth of a revolution

Dan Ellis 2013-09-23 34


DFT examples !
1 n=0
! Finite impulse x[n] =
0 n = 1 . . . N − 1
N!−1
" ⇒ X[k] = kn 0
x[n]WN = WN = 1 ∀k
n=0
! Periodic
! sinusoid:
"
2πrn (r ∈ Z) = 1 !W −rn + W rn "
x[n] = cos N N
N 2
1
!N −1 rn kn
⇒ X[k] = 2 n=0 (W −rn
N + W N )W N
"
N
(0 ! k < N) k = r, k = N − r
2
=
0 otherwise
Dan Ellis 2013-09-23 36
DFT: Matrix form
N "1
! X[k] = #n=0 x[n] ! W N
kn
as a matrix multiply:
 

X[0]
 1 1 1 ··· 1 x[0]

(N −1) 
 X[1]  1 WN1 WN2 ··· WN  x[1]

   2(N −1)   
 X[2]  
=1 WN2 WN4 ··· WN  x[2]

.. ..
  
   .. .. .. .. .. 
 
 . .
  . . . .  .
X[N − 1] (N −1) 2(N −1) (N −1)2 x[N − 1]
1 WN WN ··· WN

! i.e. X = DN ! x
Dan Ellis 2013-09-23 37
Matrix IDFT
! If X = DN ! x
!1
then x = DN " X
! i.e. inverse DFT is also just a matrix,
 
1 1 1 ··· 1
−(N −1) 
1
 WN−1 WN−2 ··· WN 
1 
1 WN−2 WN−4
−2(N −1) 
WN
D−1
N = ··· 
N .. .. .. .. .. 
. . . . .


−(N −1) −2(N −1) −(N −1)2
1 WN WN ··· WN
=1/NDN*
Dan Ellis 2013-09-23 38
DFT and MATLAB
! MATLAB is concerned with sequences
not continuous functions like X(ejω)
! Instead, we use the DFT to sample
X(ejω) on an (arbitrarily-fine) grid:
! X = freqz(x,1,w); samples the DTFT
of sequence x at angular frequencies in w
! X = fft(x); calculates the N-point DFT
of an N-point sequence x

Dan Ellis 2013-09-23 39


M
DFT and DTFT
#
¥ continuous freq ω
DTFT
j!
X(e ) = $ x[n]e " j!n
¥ infinite x[n], -'<n<'
n="#
N !1
¥ discrete freq k=Nω/2π
DFT X[k] = " x[n]W N
kn
¥ finite x[n], 0$n<N
n=0

! DFT ÔsamplesÕ DTFT at discrete freqs:


j! X[k]
X[k] = X(e ) ! = 2 "k X(ejω)
N ω
k=1...
Dan Ellis 2013-09-23 40
!

" ! # ! ! $ %& ' ('


Properties: Circular time shift
! DFT properties mirror DTFT, with twists:
! Time shift must stay within N-pt ÔwindowÕ
kn0
g[!n − n0 #N ] ↔ WN G[k]
! Modulo-N indexing keeps index between
0 and N-1: !
g[n − n0 ] n ≥ n0
g[!n − n0 #N ] =
g[N + n − n0 ] n < n0
0 $ n0 < N

Dan Ellis 2013-09-23 48


Circular time shift
! Points shifted out to the right donÕt
disappear Ð they come in from the left
g[n] g[<n-2>5]
ÔdelayÕ by 2

1 2 3 4
n 1 2 3 4
n
5-pt sequence

! Like a Ôbarrel shifterÕ:

!"#$#%&'!#%()"

Dan Ellis 2013-09-23 49


Circular time reversal
! Time reversal is tricky in Ômodulo-NÕ
indexing - not reversing the sequence:
x÷ [n]
5-pt sequence
made periodic
-7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 10 11
n
x÷ [ !n N ]
Time-reversed
periodic sequence
-7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 10 11
n
! Zero point stays fixed; remainder flips
Dan Ellis 2013-09-23 50
Circular convolution
! Can also do entire convolution with
modulo-N indexing
! Hence, Circular Convolution:
N !1

" g[m ]h[ n ! m N ] # G[k]H[k]


m=0

! Written as g[n] !
N h[n]

Dan Ellis 2013-09-23 53


Circular convolution example
! 4 pt sequences: g[n]={1 2 0 1} h[n]={2 2 1 0}
N !1

" g[m ]h[ n ! m N ] 1 2 3 n 1 2 3 n


m=0

g[n] 4 h[n]={4 7 5 4}
h[<n - 0>4] n !1
1 2 3

h[<n - 1>4] n !2
1 2 3

h[<n - 2>4]
1 2 3 n
n !0
1 2 3

h[<n - 3>4] check: g[n] * h[n]


n !1
1 2 3 ={2 6 5 4 2 1 0}
Dan Ellis 2013-09-23 54
DFT properties summary
! Circular convolution
N !1
"m=0 g[m ]h[ n ! m N ] # G[k]H[k]
! Modulation
N #1
g[n] ! h[n] " 1
N $m=0 G[m]H[ k # m N ]
! Duality
G [n] ! N " g[ #k N ]
! Parseval N !1 2 N !1 2
"n=0 x[n] = 1
N "k=0 X [k ]
Dan Ellis 2013-09-23 55
Overlap-Add convolution
! Very long g[n] " break up into
segments, convolve piecewise, overlap
" bound size!of DFT, processing delay
g[n] i · N ≤ n < (i + 1) · N
! Make gi [n] =
0 otherwise
!
⇒ g[n] = i gi [n]
!
⇒ h[n] ⊛ g[n] = i h[n] ⊛ gi [n]
! Called Overlap-Add (OLA) convolution...
Dan Ellis 2013-09-23 58
Overlap-Add convolution
g[n] h[n]
M
n n
g0[n] g0[n] * h[n]
N=
L+M-1
n n
g1[n] g1[n] * h[n]
n n
g2[n] g2[n] * h[n]
n n
L 2L 3L valid OLA sum
h[n] * g[n]
n
ML 2L 3L
Dan Ellis 2013-09-23 59

You might also like