ENT 315 Medical Signal Processing CHAPTER 2 DISCRETE FOURIER TRANSFORM Dr. Lim Chee Chin
Outline Introduction Discrete Fourier Series Properties of Discrete Fourier Series Time domain aliasing due to frequency sampling DTFT and DFT Relationship DFT to other transforms Properties of Discrete Fourier Transforms Circular and Linear Convolution Filtering Long Duration Sequences
Introduction A signal can be either continuous or discrete, and it can be either periodic or aperiodic. The combination of these two features generates the four categories of Fourier Transform. Period ic Aperi odic Continuous Continuous Fourier Series (CFS) Time Domain Continuous Time Fourier Transform (CTFT) Frequency Domain Continuous Fourier Transform Discrete Discrete Fourier Series (DFS) Time Domain Discrete Time Fourier Transform (DTFT) Frequency Domain Discrete Fourier Transform (DFT)
Introduction
Discrete Fourier Series (DFS) Exponential Form Trigonometric Form Relationship Exponential Form and Trigonometric Form Properties of DFS
Discrete Fourier Series A periodic discrete time signal x(n) of period N can be expressed as a weighted sum of a complex exponential sequences Since the sinusoidal sequence are unique only for digital frequencies from 0 to 2π, then expansion contain only finite number of complex exponential Exponential Form of Fourier Series for a periodic discrete time signal:, for all n ; 0 2, for all k ; 0 where the coefficients of expansion X(k) and the fundamental digital frequency are given by
DFS The above equation are called the Discrete Fourier Series (DFS) pair. The exponential form of the Fourier series for a periodic discrete signal can be written as where
DFS In term of an alternative (Trigonometric Form) the Discrete Fourier Series for the continuous time periodic signal, it can be expression for odd and even
Relationships between Exponential and Trigonometric Forms of DFS
Example Question: Find both the exponential and trigonometric forms of the Discrete Fourier Series representation of x(n) shown in Figure.
Solution:
Solution (Cont.): Trigonometric Form of DFS is determined by odd and even: 3 2 2 2 1 2
Exercise: Find the exponential form of DFS for the signal x(n) given by x(n) = { 1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1, } Answer:{10,11,7,9,14,8,5,2} for linear convolution
Properties of Discrete Fourier Series 1. Linearity x1(n) and x2(n) both with period N, such that DFS[x1(n)] = X1(k) DFS[x2(n)] = X2(k) DFS[a1x1(n) + a2x2(n)] = X1(k) + X2(k)
Properties of Discrete Fourier Series 2. Time Shifting If x(n) is a periodic sequence with N samples DFS[x(n)] = X(k) DFS[x2(n m)] = X2(k) Where (n m) is a shifted version of x(n).
Properties of Discrete Fourier Series 3. Symmetry Property DFS[x*(n)] = X*( k) and DFS[x*( n)] = X*(k) DFS DFS DFS DFS We know that DFS DFS DFS DFS
Properties of Discrete Fourier Series 4. Periodic Convolution x1(n) and x2(n) both be two periodic sequences with period N DFS[x1(n)] = X1(k) DFS[x2(n)] = X2(k) If X3(k)= X1(k) X2(k), then periodic sequence x3(n) with Fourier series coefficients X3(k) is So,
Discrete Time Fourier Transform (DTFT) DTFT Definition DTFT to IDFT DTFT to DFT
DTFT Definition Transforming n Frequency domain Discrete time Frequency Digital Frequency, = 0 to 2 periodic Analog Frequency, Ω = to either periodic or aperiodic
DTFT to IDTFT. Discrete signal Continuous periodic (0, 2)
DTFT to DFT DTFT of a discrete time sequence x(n) is represented by the complex exponential sequence [ ], where is the real frequency variable. This transform is useful to map the time domain sequence into a continuous function of a frequency variable. The DTFT and the z transform are applicable to any arbitrary sequences, whereas the DFT can be applied only to finite length sequences.
Relationship DTFT and DFT
DTFT vs. DFT DTFT w takes continuous values from 0 t 2 Sampling is performed only frequency domain Continuous function of w. DFT k=1, 2, 3, N 1 takes only discrete values of k. Sampling is performed in both time and in time domain. Discrete frequency spectrum
Example DTFT Find DTFT of the following finite duration Answer:
Example DTFT Question: Determine the Fourier transform for the given discrete time DTFT and compute the corresponding amplitude and phase spectrum.
Solution
Exercise Determine the Fourier transform for the given discrete time signal and compute the corresponding amplitude and phase spectrum.
Discrete Fourier Transform (DFT) Definition DFT & IDFT
Definition DFT & IDFT DFT computes the values of the z-transform for evenly spaced points around the unit circle for a given sequence.
Relationship between DFT & Other Relationship to the Fourier Series Coefficients of a Periodic Sequences Fourier Series of a periodic sequence Fourier Series coefficients / / Comparing both equation, define a sequences x(n) is identical to xp(n) over a single period, Fourier Series coefficients Fundamental period, N
Relationship to the Fourier Series Coefficients of a Periodic Sequences If a periodic sequence is formed by periodically repeating x(n) every N samples n The discrete frequency domain IDFT n 1 /, 1,2,, N 1 k/,
Relationship to the Spectrum of an Infinite Duration (Aperiodic) Signal
Relationship of the DFT to z transform
Example Question Determine the DFT of the sequence
Solution
Example Derive the DFT of the sample data sequence data sequence x(n)={1,1,2,2,3,3} and compute the corresponding amplitude and phase spectrum.
Solution
For k=2
Properties of DFT 1. Periodicity 2. Linearity 3. Shifting Property 4. Convolution Theorem 5. Time Reversal of a Sequence 6. Circular Time Shift 7. Circular Frequency Shift 8. Complex Conjugate Property 9. Circular convolution 10. Circular Correlation 11. Multiplication of Two Sequences 12. Parseval s Theorem
1. Periodicity Property If periodic N = 3 Periodicity Property If Positive part, N = period Negative part 2 3 2 1 2
2. Linearity Property If Suppose
3. Circular Time Shifting Property x(n+1) X( n) 1 2 3 4 x(n 1) n 1 n = 3 4 3 2 n= 0 4 1 x(n) 1 4 2 n = 1 shift 3 2 n = 2 2
4. Time /Frequency Shift Property
5.Time reversal Property N = 4 X( n) 4 1 3 2 then Period of signal n
8.Complex conjugate property If E.g.: If is a complex sequence c
9.Circular Convolution Property then Convolution time domain replicate c Multiplication in frequency domain Transform signal to Fourier domain and multiple both to get the convolution of two signal.
10.Correlation property Where is the (unnormalised) circular cross correlation sequence, given as c
11.Multiplication of two sequences c Multiplication in time domain is equivalent to circular convolution in frequency domain
12.Parsavel s Energy Theorem If y(n)= x(n), above equation reduces to Energy in the finite duration sequence x(n) to the power in frequency component X(k). c
CONVOLUTION
Convolution Linear Time Invariance h(n) Convolution symbol (not into) The above expression gives the response y(n) of the LTI system as a function of the input signal x(n) and impulse response h(n) is called the convolution sum.
Convolution Steps involved in finding out the convolution sum: 1. Folding: Fold the signal h(k) about the origin, ie at k=0; 2. Shifting: Shift h( k) to the right by no, if no is positive or shift h( k) to the left by no, if no is negative to obtain h(no k). 3. Multiplication: Multiply x(k) by h(no k) to obtain the product sequence y(k) = x(k) h(n k) 4. Summation: Sum all the values of the product sequence y(k) to obtain the value of the output at time n = no In general, if the lengths of the two sequences being convolved are M and N, then the resulting sequence after convolution is of length M + N 1.
Type of Convolution Convolution Linear Circular Aperiodic Signals Periodic Signal x(n) 4 4 4 3 3 3 2 2 2 1 1 1 4 3 2 1 0 1 2 3 4 5 6 7 n
Linear Convolution x(n) = {1 2 3 4} h(n) = {4 4 3 2} y(n) =? Given signal are aperiodic We will use linear convolution LTI h(n)
x(n) = { 1 2 3 4 } n = 0, 1, 2, 3 h(n) = { 1 2 3 4 } When n = 0,
h( k) is a mirror image signal h(k) 4 4 3 3 2 1 0 1 2 3 2 k Mirror the signal at h(k) axis h( k) 4 4 3 2 3 2 1 0 1 2 3 4 k
n = 0 x(k) = { 1 2 3 4} n = 0 h( k) = {2 3 4 4}
Graphical Method When n = 0 Step 1: Plot x(n) = { 1 2 3 4 } Step 2: Plot h(n) = { 4 4 3 2 } x(n) 4 2 3 1 3 2 1 0 1 2 3 h(n) 4 4 3 2 3 2 1 0 1 2 3 n n Step 3: Plot h( n) = { 2 3 4 4 } 2 3 h(n) 4 4 3 2 1 0 1 2 3 n
When n = 1 Mirror Signal n = 1 Delaying of Signal Shift right NOTE: +n Delaying of Signal Shift right n Advance of signal Shift left
When n = 1 Step 1: Plot x(n) = { 1 2 3 4 } x(n) 4 2 3 1 3 2 1 0 1 2 3 h( n) n Step 2: Plot h( n) = { 2 34 4} 2 3 4 4 3 2 1 0 1 2 3 n h( n+1) Step 3: Plot h( n+1) = { 2 3 4 4 } 2 3 4 4 3 2 1 0 1 2 3 n 1 00 1 1 1 4 2 4 4 8 12
When n = 2 Mirror Signal n = 2 Delaying of Signal Shift right
When n = 2 Step 1: Plot x(n) = { 1 2 3 4 } x(n) 4 2 3 1 3 2 1 0 1 2 3 n h( n+1) Step 2: Plot h( n+1) = { 2 34 4} 2 1 4 4 4 3 3 2 1 0 1 2 3 h( n+2) n Step 3: Plot h( n+2) = { 2 3 4 4 } 2 3 4 4 3 2 1 0 1 2 3 n 1 2 0 3 1 4 2 4 3 381223
When n = 3 Mirror Signal n = 3 Delaying of Signal Shift right
When n = 3 Step 1: Plot x(n) = { 1 2 3 4 } x(n) 4 2 3 1 3 2 1 0 1 2 3 n h( n+2) Step 2: Plot h( n+2) = { 2 34 4} 2 3 4 4 3 2 1 0 1 2 3 h( n+3) n Step 3: Plot h( n+3) = { 2 3 4 4 } 2 3 4 4 3 2 1 0 1 2 3 n 3 2 1 3 2 4 3 4 4??
Conclude: samples Denoted by N is a number of samples No. of Samples in x(n) No. of Samples in h(n) Just now example N = 4 + 4 1 = 7
,,,,,, Conclude: Linear convolution Aperiodic Signal sample in the output signal Instead drawing the signal again and again, Another method is used
Tabular Method x(n) 1 2 2 4 h(n) 4 4 8 12 16 4 4 8 12 16 3 3 6 9 12 2 2 4 6 8 12, 23, 26, 29, 18, 8} n = 0 1 2 3 4 5 6
Circular Convolution 1. Using for Periodic Signals 2. Both the signals x(n) and h(n) must be same length Conclusion: The period of x(n) and h(n) must be the same then only can performed circular convolution
Example Circular Convolution Question: Given two periodic signal of x(n) and h(n) as represent as following: x(n) = {1 2 3 4} ; N = 4 h(n) = {1 1 1 1} ; N = 4
x(n) = {1 2 3 4} ; N=4 h(n) = {1 1 1 1} ; N=4 Periodic Signals repeat after the fundamental period N=4. Periodic signals are infinite length signals.... x(n) 2 3 4 4 2 3 1 1.. 3 2 1 0 1 2 3 n h(n) 1 1 1 1 1 1.. n 3 2 1 0 1 2 3 h( n+3)
x(1) = 4 x(2) = 3 x(0) = 1 x(3) = 4 Y(n) output sequence N samples
Example Circular Convolution Question Given input sequence and impulse response, both signal sequences are periodic, Find the response output of the system using circular convolution.
Solution N = 4 System h(n) = {1234}; N=4 Step to do circular convolution: 1. Mirroring the signal 2. Multiplication of signal 3. Adding of signals 4. Shifting of signals
Step 0: Draw x(n) and h(n) Both N = 4, so divided the circle into 4 equal parts Placement of component is Anti counter wise direction. x(1) = 1 h(1) = 2 x(2) = 2 x(n) x(0) = 1 h(2) = 3 h(n) h(0) = 1 x(3) = 2 h(3) = 4
Step 2 mirroring the h(n) After mirroring anti clockwise become clockwise in sequence. h(2) = 3 h(1) = 2 h(n) Mirror at this line h(0) = 1 h(2) = 3 h(3) = 4 h( n) h(0) = 1 h(3) = 4 h(1) = 2
Step 2: Multiplication of signal Step 3: Adding of signals 4 x(1) = 1 6 x(n)h( n) x(0)h(0) = 1 x(2) = 2 h(3) = 4 h(2) = 3 h( n) x(0) = 1 h(0) = 1 h(1) = 2 x(3) = 2 X(1)h( 1) = 4 Product sequence, y0 0 0 00 11 0 1 1 2 2 2 3 14 0 146415
Step 4: Shifting Signal h(3) = 4 h(0) = 1 h(2) = 3 h( n) h(0) = 1 h(3) = 4 h( n+1) h(1) = 2 h(1) = 2 h(2) = 3
Step 2: Multiple of signal Step 3: Adding of signals 4 x(1) = 1 h(0) = 1 6 x(n)h( n) x(0)h(0) = 1 x(2) = 2 h(4) = 4 h( n+1) h(1) = 2 x(0) = 1 X(1)h( 1) = 4 Product sequence, y0 h(2) = 3 x(3) = 2 1 2 1 10 01 1 1 1 1 2 2 3 24 1 126817
Step 4: Shifting Signal h(0) = 1 h(1) = 2 h(3) = 4 h( n+1) h(1) = 2 h(0) = 1 h( n+2) h(2) = 3 h(2) = 3 h(3) = 4
Step 2: Multiple of signal Step 3: Adding of signals 2 x(1) = 1 h(1) = 2 2 x(n)h( n) x(2)h(0) = 3 x(2) = 2 h(0) = 1 h( n+2) h(2) = 3 x(0) = 1 8 Product sequence, y0 h(3) = 4 x(3) = 2 2 2 2 11 02 2 1 2 1 3 2 1 24 2 232815
Step 4: Shifting Signal h(1) = 2 h(2) = 3 h(0) = 1 h( n+2) h(2) = 3 h(1) = 2 h( n+3) h(3) = 4 h(3) = 4 h(0) = 1
Step 2: Multiple of signal Step 3: Adding of signals x(1) = 1 3 4 x(n)h( n) x(0)h(3) = 4 h(2) = 3 x(2) = 2 h(1) = 2 h( n+3) h(0) = 1 x(3) = 2 h(3) = 4 x(0) = 1 Answer: y(n)={15,17,15,13} at N=4 2 Product sequence, y0 2 2 2 12 21 2 1 3 2 2 2 1 14 2 342413
Matrix Multiplication Method
Matrix Multiplication Method
Solution Example