Presentation on theme: "LECTURE 4 4-1 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Use of Frequency Domain Telecommunication Channel |A| f fcfc Frequency."— Presentation transcript:

LECTURE 4 4-1 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Use of Frequency Domain Telecommunication Channel |A| f fcfc Frequency Response Signal frequencies > f c are attenuated and distorted |A| f JOHN’S “A” IAN’S “A” SPEECH ANALYSIS RECOGNITION IDENTIFICATION Spectrum analyzers convert a time-domain signal into frequency domain

LECTURE 4 4-2 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Fourier Series TpTp Original Signal x p (t)First 4 Terms of Fourier Series Sum of First 4 Terms of Fourier Series and x p (t) Original x p (t) First 4 Terms of Fourier Series Periodic signal expressed as infinite sum of sinusoids. C k ’s are frequency domain amplitude and phase representation For the given value x p (t) (a square value), the sum of the first four terms of trigonometric Fourier series are: x p (t)  1.0 + sin(t) +  sin(3t) +  sin(5t)

LECTURE 4 4-3 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Fourier Transform  C k = 1 TpTp T p /2 -T p /2 x(t) e - j(k   t) dt WHERE C(  ) = dd 22  x(t) e - j  t dt   Increase T P = Period Increases    No Repetition 1 TpTp =  22 dd 22 k  0  Discrete coefficients C k become continuous C(  ) Discrete frequency variable becomes continuous  x(t) e - j  t dt   C(  ) d  2  = X(  ) =  X(  ) e j  t d    x(t) = 1 22 normalize INVERSE FT PAIR x(t) =  C k e j(k  0 t)  k=-  TPTP 

LECTURE 4 4-4 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Discrete Time Fourier Transform Replace t with T s n Continuous x(t) becomes discrete x(n) Sum rather than integrate all discrete samples Fourier Transform Limits of integration need not go beyond ±  because the spectrum repeats itself outside ±  (every 2  ) Keep integration because X(  ) is continuous Discrete Time Fourier Transform Inverse Fourier Transform Inverse Discrete Time Fourier Transform

LECTURE 4 4-5 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Discrete Fourier Transformation Recall DTFT Pair: To Make DTFT Practical: There are an infinite number of time domain samples  is continuous Take only N time domain samples Sample the frequency domain, i.e. only evaluate x(  ) at N discrete points. The equal spacing between points is  = 2  /N The result is the Discrete Fourier Transform (DFT) pair:

LECTURE 4 4-6 Copyright  1998, Texas Instruments Incorporated All Rights Reserved DFT Relationships Time DomainFrequency Domain N Samples 0 0 TsTs 1 2T s 2 3T s 3N-1 (N-1)T s |x(k)| 0 0 12N/2 N-2N-1    N Samples k f X(n) t n

LECTURE 4 4-7 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Practical Considerations 8-point DFT requires 8 2 = 64 multiplications 1000-point DFT requres 1000 2 = 1 million multiplications And all of these need to be summed Standard DFT An example of an 8 point DFT Writing this out for each value of n Each term such asrequires 8 multiplications Total number of multiplications required: 8 * 8 = 64 Do not forget that each multiplication is complex

LECTURE 4 4-8 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Fast Fourier Transformation Symmetry Property Periodicity Property THE FAST FOURIER TRANSFORM Splitting the DFT in two or Manipulating the twiddle factor

LECTURE 4 4-9 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Time Savings N/2 Multiplications (N/2) 2 Multiplications (N/2) 2 Multiplications For an 8-point FFT, 4 2 + 4 2 + 4 = 36 multiplications, saving 64 - 36 = 28 multiplications For 1000 point FFT, 500 2 + 500 2 + 500 = 50,500 multiplications, saving 1,000,000 - 50,500 = 945,000 multiplications Time savings assume 50ns cycle time 8-point FFT saves 1.2  s 1000-point FFT saves 47.25ms

LECTURE 4 4-10 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Decimation in Time Decimate once Called Radix-2 since we divided by 2 Splitting the original series into two is called decimation in time n = {0, 1, 2, 3, 4, 5, 6, 7}n = { 0, 2, 4, 6 } and { 1, 3, 5, 7 } Let us take a short series where N = 8 Decimate again n = { 0, 4 } { 2, 6 } { 1, 5 } and { 3, 7 } The result is a savings of N 2 – (N/2)log 2 N multiplications 1024 point DFT = 1,048,576 multiplications 1024 point FFT = 5120 multiplication Decimation simplifies mathematics but there are more twiddle factors to calculate A practical FFT incorporates these extra factors into the algorithm

LECTURE 4 4-11 Copyright  1998, Texas Instruments Incorporated All Rights Reserved 4-Point FFT x(n) 0 X 4 (k) =  W4W4 kn 3 Let us consider an example where N=4: Decimate in time into 2 series: n = {0, 2} and {1, 3} + x(2r) r=0 X 4 (k) =  1 rk W2W2 W4W4 k x(2r+1) r=0  1 rk W2W2 = [ x(0) + x(2) ] + [ x(1) + x(3) ] W2W2 k W4W4 k W2W2 k We have two twiddle factors. Can we relate them? W N = e 22 N -j k k REMEMBER: 2k W2W2 k = e 22 2 -j k * = W 4 = e 22 4 -j 2k * = [ x(0) + x(2) ] + [ x(1) + x(3) ] W4W4 2k W4W4 k W4W4 Now our FFT becomes:

LECTURE 4 4-12 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Flow Diagram Represent with a flow diagram: Write out values for k=0 only: Two DFTs: x(0) x(1) x(2) x(3) X 4 (0) 0 0 0 0 W4W4 0 = = [ x(0) + x(2) ] + [ x(1) + x(3) ], k=0,1,2,3 W4W4 2k W4W4 k W4W4 = [ x(0) + x(2) ] + [ x(1) + x(3) ] W4W4 0 W4W4 0 W4W4 0 This is only one quarter of the flow diagram X 4 (0) X 4 (k) x 02 x 13

LECTURE 4 4-13 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Full Flow Diagram = [ x(0) + x(2) ] + [ x(1) + x(3) ] W4W4 2 W4W4 1 W4W4 2 W4W4 0 W4W4 2 W4W4 0 W4W4 2 W4W4 3 W4W4 2 W4W4 0 W4W4 0 W4W4 0 Write out all values for k: SPOT THE BUTTERFLY ? x(0) x(1) x(2) x(3) X 4 (0) X 4 (1) X 4 (2) X 4 (3) 0 2 0 2 3 2 1 0 W4W4 6 W4W4 2 22 4 -j = e * 6 = -1 = NOTICE W4W4 4 W4W4 0 22 4 -j = e * 4 = 1 =

LECTURE 4 4-14 Copyright  1998, Texas Instruments Incorporated All Rights Reserved The Butterfly W4W4 3 = j W4W4 2 = -1 W4W4 1 = -j W4W4 0 = 1 X0X0 X1X1 X3X3 X2X2 x3x3 x2x2 x1x1 x0x0 W4W4 0 W4W4 1 4 Point FFT Butterfly X1X1 X2X2 x2x2 WNWN k x1x1 x1x1 X1X1 = + WNWN k x2x2 x1x1 X2X2 = – WNWN k x2x2 Typical Butterfly Twiddle Conversions X 0 = (x 0 + x 2 ) + W4W4 0 (x 1 +x 3 ) X 1 = (x 0 – x 2 ) + W4W4 1 (x 1 –x 3 ) X 2 = (x 0 + x 2 ) – W4W4 0 (x 1 +x 3 ) X 3 = (x 0 – x 2 ) – W4W4 1 (x 1 –x 3 ) 4 Point FFT Equations a b

LECTURE 4 4-15 Copyright  1998, Texas Instruments Incorporated All Rights Reserved A Practical Example AMPLITUDE OF X 1 =  1 2 +j 2 =  2 X 0 =x 0 + x 2 + x 1 +x 3 X 1 =x 0 –x 2 + -j(x 1 –x 3 ) = 1–0 + -j(0–1) = 1 + j X 2 =(x 0 + x 2 ) – (x 1 + x 3 ) = (1 + 0) - (0 + 1) = 0 X 3 =(x 0 –x 2 )– -j (x 1 –x 3 ) = (1–0)– -j(0–1) = 1– j = 1 + 0 + 0 + 1 = 2 FFT Conversion SAMPLED AT 10kHz T s = 100 uS 1 NT s =F = x k = {1,0,0,1} Amplitude Time 0 1 2 (nT s ) 0 12 3 Time Domain Amplitude Frequency 1 2 kHz  Frequency Domain 03122 0-2.52.55.0-5.0 Frequency Spacing

LECTURE 4 4-16 Copyright  1998, Texas Instruments Incorporated All Rights Reserved DSP and FFT Fast Fourier Transform is a generic name for reducing DFT computations. We considered Radix-2 here, but many other algorithms exist. The simplified butterflies can be implemented with a DSP very efficiently Special FFT chips implement it even faster But DSPs are programmable And they can perform other operations on the signal FFT requires address shuffling for faster data table access Most DSPs can perform shuffling in the background Modern DSPs can perform an FFT of 1024 samples in well under 5 ms

LECTURE 4 4-17 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Summary Frequency domain information for a signal is important for processing Sinusoids can be represented by phasors Fourier series can be used to represent any periodic signal Fourier transforms are used to transform signals From time to frequency domain From frequency to time domain DFT allows transform operations on sampled signals DFT computations can be sped up by splitting the original series into two or more series FFT offers considerable savings in computation time DSPs can implement FFT efficiently

LECTURE 4 4-19 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Example Frequency Bin N Delay New Sample K2 = K1 N - + Further Frequency Bins x[N-1] x K2 K1 x (X[k] * e j2  n/N ) X[k] K1 x e j2  n/N Old Sample Note: K1=0.999 x[0]

LECTURE 4 4-20 Copyright  1998, Texas Instruments Incorporated All Rights Reserved The Phasor Model Im = Imaginary Re = Real COMPLEX PLANE PHASOR = VECTOR ROTATING Amplitude = A Speed =   rad per second Re Im   A a b x(t) = a + jb j = where A = a 2 + b 2  =  t = tan -1 b a and 1. Rectangular Form2. Polar Form e j(  t) = cos(  t) + j sin(  t) x(t) = Ae j(  t) where  = 2  f  = 180 degrees

LECTURE 4 4-21 Copyright  1998, Texas Instruments Incorporated All Rights Reserved Modeling Sinusoids Im   A a R/2    (  t +  ) OR  (n  T s +  ) LET sin  = e j(  ) - e - j(  ) 2j THEN x(t) = R cos(  t +  ) x(t) = j(  t +  ) (e - j(  t +  ) + e R 2 ) Or as a sum of two phasors: cos  = e j(  ) + e - j(  ) 2 AND Drawing the phasors for cos  In general: e j(  ) = cos(  ) + jsin(  )e - j(  ) = cos(  ) - jsin(  ) REWRITE: e j  t ANDAS b -b x(t) = R cos(  t +  )