Sampling and the Dicrete Fourier Tranform
Sampling Method Sampling i mot commonly done with two device, the ample-and-hold (S/H) and the analog-to-digital-converter (ADC) The S/H acquire a CT ignal at a point in time and hold it for later ue The ADC convert CT ignal value at dicrete point in time into numerical code which can be tored in a digital ytem 5/10/04 M. J. Robert - All Right Reerved 2
Sampling Method Sample-and-Hold During the clock, c(t), aperture time, the repone of the S/H i the ame a it excitation. At the end of that time, the repone hold that value until the next aperture time. 5/10/04 M. J. Robert - All Right Reerved 3
Sampling Method An ADC convert it input ignal into a code. The code can be output erially or in parallel. 5/10/04 M. J. Robert - All Right Reerved 4
Sampling Method Excitation-Repone Relationhip for an ADC 5/10/04 M. J. Robert - All Right Reerved 5
Sampling Method 5/10/04 M. J. Robert - All Right Reerved 6
Sampling Method Encoded ignal ample can be converted back into a CT ignal by a digital-to-analog converter (DAC). 5/10/04 M. J. Robert - All Right Reerved 7
Pule Amplitude Modulation Pule amplitude modulation wa introduced in Chapter 6. Modulator t t p()= t rect comb w 1 T T 5/10/04 M. J. Robert - All Right Reerved 8
Pule Amplitude Modulation The repone of the pule modulator i t t y()= t x() t p()= t x() t rect comb w 1 T T and it CTFT i where f k = ( )= ( ) ( ) Y f wf inc wkf X f kf = 1 T 5/10/04 M. J. Robert - All Right Reerved 9
Pule Amplitude Modulation The CTFT of the repone i baically multiple replica of the CTFT of the excitation with different amplitude, paced apart by the pule repetition rate. 5/10/04 M. J. Robert - All Right Reerved 10
Pule Amplitude Modulation If the pule train i modified to make the pule have a contant area intead of a contant height, the pule train become 1 t t p()= t rect comb w w 1 T T and the CTFT of the modulated pule train become k = ( )= ( ) ( ) Y f f inc wkf X f kf 5/10/04 M. J. Robert - All Right Reerved 11
Pule Amplitude Modulation A the aperture time, w, of the pule approache zero the pule train approache an impule train (a comb function) and the replica of the original ignal pectrum all approach the ame ize. Thi limit i called impule ampling. Modulator 5/10/04 M. J. Robert - All Right Reerved 12
Sampling CT Signal The fundamental conideration in ampling theory i how fat to ample a ignal to be able to recontruct the ignal from the ample. High Sampling Rate Medium Sampling Rate Low Sampling Rate 5/10/04 M. J. Robert - All Right Reerved 13
Claude Elwood Shannon 5/10/04 M. J. Robert - All Right Reerved 14
Shannon Sampling Theorem A an example, let the CT ignal to be ampled be t x()= t Ainc w It CTFT i X CTFT ( f )= Awrect ( wf ) 5/10/04 M. J. Robert - All Right Reerved 15
Shannon Sampling Theorem Sample the ignal to form a DT ignal, nt x[ n]= x( nt )= Ainc w and impule ample the ame ignal to form the CT impule ignal, t xδ t Ainc comb inc w f f t A nt ()= ( )= w n= The DTFT of the ampled ignal i ( )= ( ) ( ) X F Awf rect Fwf comb F DTFT δ( t nt ) 5/10/04 M. J. Robert - All Right Reerved 16
Shannon Sampling Theorem 5/10/04 M. J. Robert - All Right Reerved 17
Shannon Sampling Theorem The CTFT of the original ignal i a rectangle. ( )= ( ) XCTFT f Awrect wf The DTFT of the ampled ignal i or ( )= ( ) ( ) X F Awf rect Fwf comb F X DTFT DTFT( F)= Awf rect ( F k) wf k = a periodic equence of rectangle. ( ) 5/10/04 M. J. Robert - All Right Reerved 18
Shannon Sampling Theorem If the k = 0 rectangle from the DTFT i iolated and then the tranformation, i made, the tranformation i If thi i now multiplied by the reult i which i the CTFT of the original CT ignal. F Awf rect Fwf Awf rect wf f f ( ) ( ) ( ) [ ]= ( )= ( ) T Awf rect Fwf Awrect wf X f CTFT T 5/10/04 M. J. Robert - All Right Reerved 19
Shannon Sampling Theorem In thi example (but not for all ignal and ampling rate) the original ignal can be recovered from the ample by thi proce: 1. Find the DTFT of the DT ignal. 2. Iolate the k = 0 function from tep 1. f 3. Make the change of variable, F, in the reult of tep 2. f 4. Multiply the reult of tep 3 by T 5. Find the invere CTFT of the reult of tep 4. The recovery proce work in thi example becaue the multiple replica of the original ignal CTFT do not overlap in the DTFT. They do not overlap becaue the original ignal i bandlimited and the ampling rate i high enough to eparate them. 5/10/04 M. J. Robert - All Right Reerved 20
Shannon Sampling Theorem If the ignal were ampled at a lower rate, the ignal recovery proce would not work becaue the replica would overlap and the original CTFT function hape would not be clear. 5/10/04 M. J. Robert - All Right Reerved 21
Shannon Sampling Theorem If a ignal i impule ampled, the CTFT of the impuleampled ignal i ( )= ( ) ( )= Xδ f X f comb T f f X f kf For the example ignal (the inc function), which i the ame a X CTFT CTFT k = k = ( ( ) ) Xδ( f )= f Awrect w f kf DTFT ( ) = F f Awf rect f kf w F f k = (( ) ) ( ) 5/10/04 M. J. Robert - All Right Reerved 22
Shannon Sampling Theorem 5/10/04 M. J. Robert - All Right Reerved 23
Shannon Sampling Theorem If the ampling rate i high enough, in the frequency range, f f < f < 2 2 the CTFT of the original ignal and the CTFT of the impuleampled ignal are identical except for a caling factor of f. Therefore, if the impule-ampled ignal were filtered by an ideal lowpa filter with the correct corner frequency, the original ignal could be recovered from the impule-ampled ignal. 5/10/04 M. J. Robert - All Right Reerved 24
Shannon Sampling Theorem Suppoe a ignal i bandlimited with thi CTFT magnitude. If we impule ample it at a rate, f = 4 f the CTFT of the impuleampled ignal will have thi magnitude. m 5/10/04 M. J. Robert - All Right Reerved 25
Shannon Sampling Theorem Suppoe the ame ignal i now impule ampled at a rate, f = 2 f m The CTFT of the impuleampled ignal will have thi magnitude. Thi i the minimum ampling rate at which the original ignal could be recovered. 5/10/04 M. J. Robert - All Right Reerved 26
Shannon Sampling Theorem Now the mot common form of Shannon ampling theorem can be tated. If a ignal i ampled for all time at a rate more than twice the highet frequency at which it CTFT i non-zero it can be exactly recontructed from the ample. The highet frequency preent in a ignal i called it Nyquit frequency. The minimum ampling rate i called the Nyquit rate which i twice the Nyquit frequency. A ignal ampled above the Nyquit rate i overampled and a ignal ampled below the Nyquit rate i underampled. 5/10/04 M. J. Robert - All Right Reerved 27
Harry Nyquit 2/7/1889-4/4/1976 5/10/04 M. J. Robert - All Right Reerved 28
Timelimited and Bandlimited Signal The ampling theorem ay that it i poible to ample a bandlimited ignal at a rate ufficient to exactly recontruct the ignal from the ample. But it alo ay that the ignal mut be ampled for all time. Thi requirement hold even for ignal which are timelimited (non-zero only for a finite time). 5/10/04 M. J. Robert - All Right Reerved 29
Timelimited and Bandlimited Signal A ignal that i timelimited cannot be bandlimited. Let x(t) be a timelimited ignal. Then t x()= t x() t rect The CTFT of x(t) i t t 0 t t rect t 0 ( )= ( ) ( ) X f X f tinc tf e j π ft 2 0 Since thi inc function of f i not limited in f, anything convolved with it will alo not be limited in f and cannot be the CTFT of a bandlimited ignal. 5/10/04 M. J. Robert - All Right Reerved 30
Sampling Bandpa Signal There are cae in which a ampling rate below the Nyquit rate can alo be ufficient to recontruct a ignal. Thi applie to ocalled bandpa ignal for which the width of the non-zero part of the CTFT i mall compared with it highet frequency. In ome cae, ampling below the Nyquit rate will not caue the aliae to overlap and the original ignal could be recovered by uing a bandpa filter intead of a lowpa filter. f < 2 f 2 5/10/04 M. J. Robert - All Right Reerved 31
Interpolation A CT ignal can be recovered (theoretically) from an impuleampled verion by an ideal lowpa filter. If the cutoff frequency of the filter i f c then f X( f)= T rect X δ( f), f < f < f f 2 f c ( ) m c m 5/10/04 M. J. Robert - All Right Reerved 32
Interpolation The time-domain operation correponding to the ideal lowpa filter i convolution with a inc function, the invere CTFT of the filter rectangular frequency repone. fc x()= t 2 inc( 2ft c ) xδ() t f Since the impule-ampled ignal i of the form, x δ the recontructed original ignal i n= ()= t x( nt ) δ( t nt ) fc x()= t 2 x( nt ) inc 2f t nt f n= c ( ( )) 5/10/04 M. J. Robert - All Right Reerved 33
Interpolation If the ampling i at exactly the Nyquit rate, then t x()= t x( nt ) inc n= nt T 5/10/04 M. J. Robert - All Right Reerved 34
Practical Interpolation Sinc-function interpolation i theoretically perfect but it can never be done in practice becaue it require ample from the ignal for all time. Therefore real interpolation mut make ome compromie. Probably the implet realizable interpolation technique i what a DAC doe. 5/10/04 M. J. Robert - All Right Reerved 35
Practical Interpolation The operation of a DAC can be mathematically modeled by a zero-order hold (ZOH), a device whoe impule repone i a rectangular pule whoe width i the ame a the time between ample. T 1, 0< t < T t h()= t rect, = 2 0 otherwie T 5/10/04 M. J. Robert - All Right Reerved 36
Practical Interpolation If the ignal i impule ampled and that ignal excite a ZOH, the repone i the ame a that produced by a DAC when it i excited by a tream of encoded ample value. The tranfer function of the ZOH i a inc function with linear phae hift. 5/10/04 M. J. Robert - All Right Reerved 37
Practical Interpolation The ZOH uppree aliae but doe not entirely eliminate them. 5/10/04 M. J. Robert - All Right Reerved 38
Practical Interpolation A natural idea would be to imply draw traight line between ample value. Thi cannot be done in real time becaue doing o require knowledge of the next ample value before it occur and that would require a non-caual ytem. If the recontruction i delayed by one ample time, then it can be done with a caual ytem. Non-Caual Firt- Order Hold Caual Firt- Order Hold 5/10/04 M. J. Robert - All Right Reerved 39
Sampling a Sinuoid Coine ampled at twice it Nyquit rate. Sample uniquely determine the ignal. Coine ampled at exactly it Nyquit rate. Sample do not uniquely determine the ignal. A different inuoid of the ame frequency with exactly the ame ample a above. 5/10/04 M. J. Robert - All Right Reerved 40
Sampling a Sinuoid Sine ampled at it Nyquit rate. All the ample are zero. Adding a ine at the Nyquit frequency (half the Nyquit rate) to any ignal doe not change the ample. 5/10/04 M. J. Robert - All Right Reerved 41
Sampling a Sinuoid Sine ampled lightly above it Nyquit rate Two different inuoid ampled at the ame rate with the ame ample It can be hown (p. 516) that the ample from two inuoid, x ()= t Aco 2πf t+ θ x t Aco 2π f kf t 1 0 ( ) 2()= ( ( 0 + ) + θ) taken at the rate,, are the ame for any integer value of k. f 5/10/04 M. J. Robert - All Right Reerved 42
Sampling DT Signal One way of repreenting the ampling of CT ignal i by impule ampling, multiplying the ignal by an impule train (a comb). DT ignal are ampled in an analogou way. If x[n] i the ignal to be ampled, the ampled ignal i x n x n comb n [ ]= [ ] [ ] N where i the dicrete time between ample and the DT ampling rate i F = 1. N N 5/10/04 M. J. Robert - All Right Reerved 43
Sampling DT Signal The DTFT of the ampled DT ignal i X F X F comb N F ( )= ( ) ( ) = X( F) comb In thi example the aliae do not overlap and it would be poible to recover the original DT ignal from the ample. The general rule i that F > 2Fmwhere F m i the maximum DT frequency in the ignal. F F 5/10/04 M. J. Robert - All Right Reerved 44
Sampling DT Signal Interpolation i accomplihed by paing the impule-ampled DT ignal through a DT lowpa filter. 1 F X( F)= X( F) rect comb( F) F 2Fc The equivalent operation in the dicrete-time domain i 2Fc x[ n]= x[ n] inc( 2Fn c ) F 5/10/04 M. J. Robert - All Right Reerved 45
Sampling DT Signal Decimation It i common practice, after ampling a DT ignal, to remove all the zero value created by the ampling proce, leaving only the non-zero value. Thi proce i decimation, firt introduced in Chapter 2. The decimated DT ignal i and it DTFT i (p. 518) [ ]= [ ]= [ ] x n x N n x N n d X Decimation i ometime called downampling. d ( F)= X F N 5/10/04 M. J. Robert - All Right Reerved 46
Sampling DT Signal Decimation 5/10/04 M. J. Robert - All Right Reerved 47
Sampling DT Signal The oppoite of downampling i upampling. It i imply the revere of downampling. If the original ignal i x[n], then the upampled ignal i n n x, x[ n]= N an integer N 0, otherwie where N 1 zero have been inerted between adjacent value of x[n]. If X(F) i the DTFT of x[n], then X ( F)= X( N F) [ ] i the DTFT of x n. 5/10/04 M. J. Robert - All Right Reerved 48
Sampling DT Signal [ ] The ignal, x n, can be lowpa filtered to interpolate between the non-zero value and form x i n. [ ] 5/10/04 M. J. Robert - All Right Reerved 49
Bandlimited Periodic Signal If a ignal i bandlimited it can be properly ampled according to the ampling theorem. If that ignal i alo periodic it CTFT conit only of impule. Since it i bandlimited, there i a finite number of (non-zero) impule. Therefore the ignal can be exactly repreented by a finite et of number, the impule trength. 5/10/04 M. J. Robert - All Right Reerved 50
Bandlimited Periodic Signal If a bandlimited periodic ignal i ampled above the Nyquit rate over exactly one fundamental period, that et of number i ufficient to completely decribe it If the ampling continued, thee ame ample would be repeated in every fundamental period So the number of number needed to completely decribe the ignal i finite in both the time and frequency domain 5/10/04 M. J. Robert - All Right Reerved 51
Bandlimited Periodic Signal 5/10/04 M. J. Robert - All Right Reerved 52
The Dicrete Fourier Tranform The mot widely ued Fourier method in the world i the Dicrete Fourier Tranform (DFT). It i defined by N nk F 1 1 j2π [ ]= [ ] N F DFT x n X ke X k x ne N F k = 0 [ ]= [ ] N F 1 n= 0 nk j2π N Thi hould look familiar. It i almot identical to the DTFS. N 1 nk F j2π F N F x[ n]= FS 1 X[ k] e X k x N k = 0 [ ]= [ ] F N 1 n= 0 ne nk j2π N The difference i only a caling factor. There really hould not be two o imilar Fourier method with different name but, for hitorical reaon, there are. F F 5/10/04 M. J. Robert - All Right Reerved 53
The Dicrete Fourier Tranform Original CT Signal The relation between the CTFT of a CT ignal and the DFT of ample taken from it will be illutrated in the next few lide. Let an original CT ignal, x(t), be ampled time at a rate,. f N F 5/10/04 M. J. Robert - All Right Reerved 54
The Dicrete Fourier Tranform Sample from Original Signal X The ampled ignal i x [ n]= x( nt ) and it DTFT i n= ( F)= f X f F n ( ( )) 5/10/04 M. J. Robert - All Right Reerved 55
The Dicrete Fourier Tranform N F Only ample are taken. If the firt ample i taken at time, t = 0 (the uual aumption) that i equivalent to multiplying the ampled ignal by the window function, Sampled and Windowed Signal w[ n]= 1, 0 n< 0, otherwie N F 5/10/04 M. J. Robert - All Right Reerved 56
The Dicrete Fourier Tranform The lat tep in the proce i to ample the frequency-domain ignal which periodically repeat the time-domain ignal. Then there are two periodic impule ignal which are related to each other through the DTFS. Multiplication of the DTFS harmonic function by the number of ample in one period yield the DFT. Sampled, Windowed and Periodically-Repeated Signal 5/10/04 M. J. Robert - All Right Reerved 57
The Dicrete Fourier Tranform The original ignal and the final ignal are related by f j F N Xw k Fdrcl, F X N e π ( F 1 ) N F N f F [ ]= ( ) ( ) F [ ] W(F) k F N In word, the CTFT of the original ignal i tranformed by replacing f with ff. That reult i convolved with the DTFT of the window function. Then that reult i tranformed k f by replacing F by. Then that reult i multiplied by. N N F F F 5/10/04 M. J. Robert - All Right Reerved 58
The Dicrete Fourier Tranform It can be hown (pp. 530-532) that the DFT can be ued to approximate ample from the CTFT. If the ignal, x(t), i an energy ignal and i caual and if N F ample are taken from it over a finite time beginning at time, t = 0, at a rate, f, then the relationhip between the CTFT of x(t) and the DFT of the ample taken from it i π k j N k F X( kff) Te inc XDFT[ k] NF where f f. For thoe harmonic number, k, for which F = NF k << N F X kf T X k ( ) [ ] F DFT A the ampling rate and number of ample are increaed, thi approximation i improved. 5/10/04 M. J. Robert - All Right Reerved 59
The Dicrete Fourier Tranform If a ignal, x(t), i bandlimited and periodic and i ampled above the Nyquit rate over exactly one fundamental period the relationhip between the CTFS of the original ignal and the DFT of the ample i (pp. 532-535) [ ]= [ ] [ ] X k N X k comb k DFT F CTFS N That i, the DFT i a periodically-repeated verion of the CTFS, caled by the number of ample. So the et of impule trength in the bae period of the DFT, divided by the number of ample, i the ame et of number a the trength of the CTFS impule. F 5/10/04 M. J. Robert - All Right Reerved 60
The Fat Fourier Tranform Probably the mot ued computer algorithm in ignal proceing i the fat Fourier tranform (fft). It i an efficient algorithm for computing the DFT. Conider a very imple cae, a et of four ample from which to compute a DFT. The DFT formula i N 1 n= 0 F X[ k]= x[ n] e j kn 2π N It i convenient to ue the notation, W e j N F, becaue then the DFT formula can be written a [ ] [] [ ] [ ] X 0 X 1 X 2 X 3 = W W W W = W W W W W W W W W W W W 2π 0 0 0 0 0 1 2 3 0 2 4 6 0 3 6 9 F x x x x 0 0 0 0 [ 0] [] 1 [ 2] [ 3] 5/10/04 M. J. Robert - All Right Reerved 61
The Fat Fourier Tranform The matrix multiplication require complex multiplication and N(N - 1) complex addition. The matrix product can be re-written in the form, [ ] [] [ ] [ ] X 0 X 1 X 2 X 3 N 2 1 2 3 2 0 2 3 2 1 n n+ mn becaue W = W F, m an integer. 1 1 1 1 1 W W W = 1 W W W 1 W W W x x x x 0 0 0 0 [ 0] [] 1 [ 2] [ 3] 5/10/04 M. J. Robert - All Right Reerved 62
The Fat Fourier Tranform It i poible to factor the matrix into the product of two matrice. [ ] [ ] [] [ ] X 0 X 2 X 1 X 3 0 1 W 0 0 2 1 0 0 = W 0 0 1 W 0 0 1 W 1 3 0 1 0 W 0 0 1 0 W 2 1 0 W 0 0 1 0 W 0 2 x x x x 0 0 0 0 [ 0] [] 1 [ 2] [ 3] It can be hown (pp. 552-553) that 4 multiplication and 12 addition are required, compared with 16 multiplication and 12 addition uing the original matrix multiplication. 5/10/04 M. J. Robert - All Right Reerved 63
The Fat Fourier Tranform It i helpful to view the fft algorithm in ignal-flow graph form. 5/10/04 M. J. Robert - All Right Reerved 64
The Fat Fourier Tranform 16-Point Signal-Flow Graph 5/10/04 M. J. Robert - All Right Reerved 65
The Fat Fourier Tranform The number of multiplication required for an fft algorithm of p length, N = 2, where p i an integer i 2N. The peed p Np ratio in comparion with the direct DFT algorithm i. 2 p N Speed Ratio FFT/DFT 2 4 4 4 16 8 8 256 64 16 65536 8192 5/10/04 M. J. Robert - All Right Reerved 66