Fourier Transform by using MATLAB
古いコメントを表示
Hello,
I want to use fft to get the frequency information of the signal in time domain. However, I find the frequency of the signal is determined by the sampling frequency. For example, if the sampling frequency is 1000 Hz, the signal frequency is in 100Hz, but when it changes to 2000Hz, it will be in 200Hz. Does anyone know how to solve this problem? The code is shown as following.

Thank you for your help.
採用された回答
その他の回答 (1 件)
di liu
2019 年 6 月 26 日
3 件のコメント
Jon
2019 年 6 月 26 日
Hi Di,
I couldn't seem to download the .mat file you sent. Could you please try again. Maybe use the paper clip icon in the Answers toolbar if you didn't before. Thanks
Jon
2019 年 6 月 26 日
Hi Di,
I couldn't download your .mat file, but that is OK. I think I now understand your problem. It is a conceptual problem in applying the FFT tool, not a problem with your MATLAB code.
If you have actual data that was obtained from a measurement system at a particular sampling frequency, then when you use MATLAB to do the FFT you must tell it (specify Fs) as the actual sampling frequency that was used when the data was taken. So if the data was actually obtained by sampling at 1000 Hz by the measurement device, then you must specify Fs = 1000 in your code.
The underlying issue here is that the measurements, in your case B3_noise.mat, are just a vector of values. There is no information there about how far apart they are in time. You tell MATLAB how far apart they are in time, T, or equivalently its reciprocal Fs in your code. So if you really took the data at 1000 Hz and then tell MATLAB that Fs is 2000 Hz you are implying that your data points are spaced at 1/2000 seconds intervals when really they are spaced at 1/1000 second intervals. So a signal which is really at 100 hz looks like it is going at 200 hz.
Summary - you must specify the sampling frequency to match what was actually used when the data was taken.
di liu
2019 年 6 月 27 日
カテゴリ
ヘルプ センター および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

