fft second argument function matlab
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
To do the fft I noticed in my homework the second argument is the sampling frequency but I don't understand why. Anyone with a simple explanation? Thank you.
댓글 수: 0
답변 (2개)
Jan
2017년 12월 16일
편집: Jan
2017년 12월 16일
Are you talking about the built-in function fft? Then the 2nd argument is not the sampling frequency. See https://www.mathworks.com/help/matlab/ref/fft.html:
Y = fft(X,n) returns the n-point DFT.
The meaning of n is explained by the formula: https://www.mathworks.com/help/matlab/ref/fft.html#buuutyt-6: It is the sum over n elements.
If you do not mean the built-in fft function, please explain this, because then the readers cannot know, what you are talking about.
댓글 수: 2
Jan
2017년 12월 17일
Well, this might make sense, or in other words, this need not be nonsense. Of course you can use the sampling frequency to define the number of elements for the Fourier transformation. The question is, if you really want this. So please explain, what this code line should achieve. Without knowing this detail, it is impossible to decide, if the code is correct or not. If e.g. winLength is 1, calling fft is nonsense.
Star Strider
2017년 12월 16일
Your function returns a segment of length ‘winLength’ of the data, and (apparently) calculates the Fourier transform of length ‘Fs’. Here, 'Fs' is most likely a 1-second window of the signal.
댓글 수: 8
Star Strider
2017년 12월 17일
I am aware of that.
If you use the sampling frequency ‘fs’ as the length of the Fourier transform, you may not get all the frequency resolution you otherwise would if your signal is more than one second long. I always use either the length of the signal, or nextpow2 of the length to specify the Fourier transform length.
참고 항목
카테고리
Help Center 및 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!