DFT Workshop Math Methods - Solutions 1. ET Phone Home: a. Guessing maybe 3 or seems reasonable. There s a clear dominant oscillation. But we also see little hitches and also some secondary dominant structure with a longer period (lower omega). Velocity (km/s) 1-1 -.5 1 1.5.5 3 Figure 1. Planet velocity vs. time data series Time (earthyears) b, c. Ah, now we see there are clearly in orbit. There is a dominant peak ~ cycles/earthyar, and another clear peak at ~ 7 cycles/earthyear. FFT of Planet Velocity Figure. Fast Fourier Transform (FFT) spectrum of the time series data shown in Fig 1. d. The key line of code is: 1 3 5 Frequency (cycles/earthyear) >>Y = fft(v, n); %this is the key line that actually computes the FFT! The variable Y contains all of the DFT coefficients. So we can just ask matlab to spit out the n_th like so:
>> Y(1), Y(), Y(3) 1.11 +13.5i -7.989-38.893i.99 + 7.898i e. The plot shown is for a noise factor of 7. The lower peak around 7 cycles/earthyear is lost in the noise. Our DFT is only as good as the underlying data quality! FFT of Planet Velocity 1 3 5 Frequency (cycles/earthyear) Figure 3. FFT spectrum with noise level increased to 7. The peak at ~ 7 cycles/earthyear is now lost in the noise floor -it was once obvious to the naked eye with lower noise levels (higher signal to noise ratio).. Mechanical Vibrations a. Running the script generates, at the end, a FFT plot, with 3 representative traces as follows. Seven peaks areobvious, the 8 th peak seems to be a sort of side-lobe of the 7 th (highest frequencies)
FFT(f) FFT(f) FFT(f) Figure. Sample FFT of 8-story building. The peaks correspond to the modal frequencies omega_n We can extract the modal frequencies using data above. Each peak corresponds to one mode of oscillation. Use the datatip tool to click on each peak and find coordinates. Or if you want to be a little fancier: >> [x,y] = ginput(8); Then click on 8 peaks. The x coordinate is the frequency (Hz)! x =... FFT FFT of of x1(t) x(t).5 1 1.5.5.5. Frequency 1 (Hz) 1.5.3..1..5 1 1.5 FFT of x3(t). Frequency FFT of x(t) (Hz)..5 1 1.5.5 FFT of x(t) Frequency 1 (Hz) 1.5.5 1 1.5 FFT of x5(t) FFT(f) FFT(f) FFT(f) (f).9.1.1997..3335.3795.151.3 Note that the eigenvector/value problem is solved using the script. The eigenvalues, angular frequencies, are called Omega, in units of rad/s. So we can just do the following to find the corresponding frequencies (Hz). >> f = Omega/(*pi) f =.15.13.7.713.337.387.198.5
c. Then we can find the % difference for each modal frequency as follows, as well the mean +/- std % diff. We find a ~ 1% diff on average, so the empirical technique of looking at the matlab generated DFT is really quite accurate, hooray! >> percdiff = abs(x-f)./f *1 percdiff = 3.11.3937.711 1.71.1.8317 1.11.73 >> mean(percdiff), std(percdiff) 1.555 3. Blood Pressure Based on the blood pressure vs time plot, there appears to be ~ beats per second. This is the fundamental frequency. Clearly, this curve is not a pure sinusoid we must have some harmonics adding up, via Fourier Series! Raw and filtered blood pressure measurements 15 Blood Pressure (mmhg) 1 5 Raw Filtered -5 1 3 5 Time (s) Figure 5. Blood pressure vs time comparing raw vs. filtered signal. The filtering helps smooth out the longer-period oscillations, and also helps get rid of the offset away from BP = mmhg
c. The FFT shows a dominant peak frequency of. Hz. This is in accord our initial estimate of ~ beats/second! d. There are clearly harmonics that contribute to the signal these are the obvious peaks, all integer multiples of the fundamental frequency. Note the peaks are not entirely smooth at the time, by they are well separated in frequency space. There is possibly a 7 th contributing mode, but it is difficult to discern. FFT of Blood Pressure Signal X:.55 Y: 5.538 1 3 5 Figure. FFT of blood pressure vs. time data. There are obvious harmonics contributing, possibly a 7th. e. Below is an example of the FFT before and after thresholding. X:.55 Y: 5.538 FFT of Blood Pressure Signal All coeffs Threshold Coeffs 1 3 5 Figure 7. FFT spectrum of all coefficients (blue); and suprathreshold coefficients (the "important ones) in red. Below is a plot of the PSD vs. Compression Ratio. The higher the PSD, the worse the reconstructed signal quality. There is a knee in the curve around 95%. Past this compression level, things really take a turn for the worse we being losing a lot of information and signal quality is relatively poor, as indicated by higher levels of PSD. So ~ 95% compression is possible! This corresponds to a threshold level of ~ 15%, meaning we should keep Fourier coefficients if their amplitude is >=15% of the global max peak value. Two data compression examples are shown below. One is with the threshold set to a
threshold value =.8, in which case we throw away nearly 99% of the coefficients (relatively poor quality); and the other is for threshold value =.15, in which we throw away 97% of the coefficients (keeping a mere 3% of them). This leads to a very nice, useful reconstructed signal. PSD 1 x 1-3 1 1 1 8 8 85 9 95 1 Compression Level (%) Figure 8. Reconstructed BP signal quality vs. data compression levels. ~ 95% compression is achievable without signifcaint reduction in data quality Blood Pressure (mmhg) 1-1 8 percent threshold value Raw Reconstructed - 1 3 5 Time (s)
Blood Pressure (mmhg) 1-1 15 percent threshold value Raw Reconstructed - 1 3 5 Time (s)