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!

