FFT, dominant frequency doesnt match time domain?
Show older comments
Hi
I have mutiple (relativly) noisy sine waves that i need to analyse (signal at 256Hz). A major assumption in my project is that i am aware of the frequency. So i ran an FFT in order to detremine the amplitudes. However, i seem to run into an issue with some sinewaves, were the expected frequencies are not correct. This following code seems to have an impact before i run the fft on the signal.
tendIn=size(y,2)/256;
tendFFT=tendIn-mod(tendIn,Tw);
tendFFTindex=(tendFFT*256)-mod(tendFFT*256,2);
y=y(1:tendFFTindex);
For example: I expect a dominant sine wave frequency of 0.2Hz and when i leave the code above it shows just that. But when i plot it in time domain it seems that frequncy is off (and so is the ampltiude). Now if i comment the above code and run the FFT on the data directly i seem to acheive the right frequency (which would make my assumption that the frequency is 0.2Hz incorrect).
This occurs on some of the sinewaves. I want to go with my gut instinct and trust that the time domian is correct (and my assumption is wrong) but the above code seems to make sense so i dont know were i went wrong.
Note: This wave may or maynot be impacted by reflected wave (same sinewave reflected).However, all sinewaves would be effected yet not all have this promblem.
Thanks
4 Comments
dpb
on 10 Jun 2021
OK, ya got me---what is the above supposed to be doing/representing?
W/o the actual signal, not sure what we're able to tell...
Mohammed Elmezoghi
on 10 Jun 2021
dpb
on 10 Jun 2021
So attach a .mat file or the code to generate/illustrate the specific cases with what you think is a problem...we still can't diagnose what we can't see.
Mohammed Elmezoghi
on 10 Jun 2021
Accepted Answer
More Answers (0)
Categories
Find more on Scopes and Data Logging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
