Fourier Series and Fourier Transform CEE575
Recap • Fourier’s theorem loosely states that that every function can be completely expressed as a sum of sines and cosines of various amplitudes and frequencies. • The Fourier series tells you the amplitude and frequency of the sines and cosines that you should add up to recreate your original function Source: http://mathtools.stanford.edu/reader/Ch5_Fourier_Analysis.pdf
Signals: When time domain analysis is not enough Once we’ve collected data using an ADC, we often need to process and analyze it. This could entail: • Cleaning up the data/signal (Filtering) • Extracting “interesting” parts of the data stream Example: extracting damage info from accelerometer readings Frequency Time (noisy) Noise Noise Interesting
Example 2: filtering out noise on agoutis signals • Say you are recording whale noise in the ocean using a piezo sensor. • There is a lot of background noise, and all you want to do is extract the the actual whale call: Interesting Frequency Time (noisy)
Joseph Fourier (21 March 1768 – 16 May 1830)
Remember
Example http://maxim.ece.illinois.edu/teaching/fall08/lec8.pdf
Animation: http://en.wikipedia.org/wiki File:Fourier_series_and_transform.gif
Power spectrum representation • For the square wave example, you could see that not every component sine wave contributed equally to the final summed signal. Some have higher amplitudes (are more important) than others • Once we know the Fourier series for a square wave, the square wave can easily be expressed in the frequency domain. This involves plotting the amplitude or the power spectrum. These spectrums will tells us about the relative importance of each sine component odd frequency amplitude Power=Ampltide 2
Step by step • A nice example of Fourier’s Theorem is the creation of a square wave by summing the appropriate component sine waves. Since this function is odd, the only contribution waves will be sines (see course notes) • In the figure below, the top panels represents a waveform and the bottom panel represents the sine waves that are added together to form the waveform. Each column contains one more component sine wave than the previous panel. As you can see, as you add up more sine waves, the resulting waveform starts to look more and more like a square wave
The frequency-, or power-spectrum, tells us how prevalent any given frequency component is Notice how some etc… frequencies are not even present in our reconstruction
Another look The figure below is another simple example of plotting the same signal in both the time domain and frequency domain. The sine waves represented by the top two rows are summed to create the waveform in the bottom row. The right column shows how much power is in each frequency (“power spectrum”). Notice that the power is zero at most frequencies. This is because the waveforms in this example are composed of either 1 or 2 sine waves, so most frequencies are not contributing any power to the signal.
A closer look at amplitude and phase https://engineering.purdue.edu/ME365/Textbook/chapter8.pdf
The power of the transform Sensor Difficult to interpret Easier to interpret
See notes… The Fourier transform
Visualizing various x(t) X( ω ) transforms Continuous Continuous FT t ω x[n] X( ω ) Continuous DTFT Discrete ω n x[n] X[ Ω ] Discrete Discrete DFT/FFT n Ω
Visualizing various x(t) X( ω ) transforms Continuous Continuous FT t ω Most Useful x[n] X( ω ) Continuous In real world DTFT Discrete ω n x[n] X[ Ω ] Discrete Discrete DFT/FFT n Ω
Real-world use: a note on sampling
Sampling
Aliasing examples
Nyquist sampling rate Reminder – to avoid aliasing, sample at twice (or more) of the expected frequencies. E.g. If you know your sensor gives you signals up to 200 KHz, measure at 500-600KHz to avoid aliasing. Gist : Sample twice as fast as you would need to capture the highest frequency you are interested in. A good rule of thumb is to actually sample 4-6 times as fast, just to be safe (more on this later). Example : If we are measuring building motion (up to 1KHz), Nyquist would tell us to measure at 2KHz, but to be safe we will measure at Harry Nyqist (1889–1976) 5KHz.
FFT: See notes…
FFT visualized http://www.dspguide.com/ch12/2.htm
Working with signals in MATLAB In most real-world scenarios, for collected sensor information, your will know the following: • Fs – The sampling frequency (Hz, or some other inverse time unit) • delta_t (Ts) – Sampling interval (s, or some time unit) • Note that Delta_t=1/Fs. If you know one, you know the other • N – The number of data points • X – the vector of signal data points (length N), in most cases the voltage read by the ADC MATLAB • To plot the data in reasonable units, we need to create a time vector • t = 0:t_delta:(N-1)*t_delta; • Then just plot the data • plot(t,x);
Taking the FFT We can now take the fft of our signal using the FFT function Y= fft(x); To plot this in a physically meaningful way, we need to calculate the DFT frequency vectored. Remember that for k data points, the DFT will sample the frequency spectrum at locations 2*pi*k/N. Then we can define f_delta = (Fs/N); f=0:f_delta:f_delta*(N-1); And then plot (plot only half the outputs due to symmetry): plot(f(1:N/2),abs(Y_noisy(1:N/2))); xlabel('Freqeuncy (Hz)'); ylabel('Amplitude');
Recommend
More recommend