A Fourier Transorm Model in Ecel # -This is a tutorial about the implementation o a Fourier transorm in Ecel. This irst part goes over adjustments in the general Fourier transorm ormula to be applicable on real time sampled signals with a inite number o known samples. - This is not an introduction to comple unctions or Fourier transorm. In order to ollow this it s ideal to have minimal knowledge o basic comple number theory. I you learned Fourier analysis in school a couple o years or a couple o decades back and you are vaguely aware o the Fourier transorm theory, it is enough. You could stop and go back and read some theory at any time. <www.ecelunusual.com> <ecelunusual.com> by George Lungu
<www.ecelunusual.com> Introduction: - The deinition o the Fourier transorm o a temporal signal G( is: - The deinition o the inverse Fourier transorm o a requency unction G() is: G( ) t t e G( ) e j t j t dt d - t and are time and requency respectively, they are real numbers. - j is the imaginary symbol, i is some times used to denote it. - The Euler Formula is: e jz cos( z) j sin( z) - Using Euler s ormula and assuming in our particular case that is a real unction we can rewrite the Fourier transorm as: G( ) cos( dt j sin( dt
Let s see how we can apply the previous ormula in practice to get a reasonable approimation o the Fourier transorm: g We used the notation nh) = g n g g g g - g - In practice we usually have a limited number o equally spaced time samples (+) o a continuous unction contained in a table. - In practice the samples usually start at an arbitrary time zero. Minus ininity or plus ininity are uneasible so we will do the integration on the available period o time [, T]. - We can approimate the integral o a unction in numerical ashion by using a sum o its samples multiplied by the length o the time interval between the sample h. h h h (-)h h = T tt dt h n t n nh) n G( ) h nh) cos( nh) j h nh) sin( nh) n -- Though very similar, the ormula above is not the standard DFT (Discrete Fourier Transorm) ormula but something improvised ad hoc based on the ull ormula o the transorm and numerical approimations. Since we sum rom to not rom / to / the ormula above is an approimation o the Fourier transorm o t+/) rather then The irst term is the real part o the transorm and the second term (ater j ) the imaginary part <www.ecelunusual.com> n n
G( ) h nh) cos( nh) j h nh) sin( nh) A visualization: Real part - Re(G()) Imaginary part - Im(G()) - I we have a saw-tooth unction and a cosine unction o requency. Calculating the sampled Fourier transorm or requency would mean multiplying all red and blue point values situated on the same vertical grid line and adding all the products together..5.5.5.5 -.5 - -.5 cos(pi** Detailed visualization or calculating the real part o the Fourier transorm at requency :.5.5.5.5 -.5 - -.5 h + cos(pi** h RFT - Redneck Fourier Transorm <www.ecelunusual.com> 4 h nh) cos( nh)
<www.ecelunusual.com> 5 - In order to calculate the real part o G() we need to do the operation demonstrated in the previous page or every requency that we want to calculate G() or. This implies multiplication o with a cosine o that requency or time samples. - In order to calculate the imaginary part o G() we need to do the operation demonstrated in the previous page (with a sine instead o a cosine) or every requency that we want to calculate G() or. This implies multiplication o with a sine o that requency or time samples. - The charts the right show the saw-tooth unction and a cosine o our dierent requencies used to calculate the real part o the Fourier transorm or our dierent requencies..5 cos(pi**.5.5.5 -.5 - -.5.5 cos(pi**.5.5.5 -.5 - -.5.5 cos(pi**.5.5.5 -.5 - -.5.5 cos(pi**.5.5.5 -.5 - -.5
<www.ecelunusual.com> 6 Overview o the Fourier transorm components: - I we write the Fourier transorm o a real value time signal we can see that it has a real part and an imaginary part: G( ) h nh) cos( nh) j h nh) sin( nh) Real part - Re(G()) Imaginary part - Im(G()) - Which can be written in short like this: G( ) j ImG ( ) G( ) Re - Instead o writing as real and imaginary, the Fourier transorm is most o the times epressed as Amplitude and Phase: G( ) ImG ( ) G( ) Re Phase G( ) Im G( a tan Re G( ) )