Converting Scales after FFT
이전 댓글 표시
I was hoping someone could help me understand exactly how Matlab's FFT function deals with scaling axes. I am developing some Diffraction code that will simulate Fourier optics but I am hoping to understand how to interpret my results better with a simple example first.
Analytically the Fourier Transform of a f(x) = cos(bx) wave goes to F(k) = dirac(k-b)+dirac(k+b). My code to test this in Matlab is:
steps = 2^8; lim = 4*pi;
x=linspace(-lim, lim,steps);
b = 1;
func = cos(b*x);
Func = fftshift(fft(func));
which when plotted looks like this:

What I am trying to understand is how to rescale my k (spatial frequency) axis so the locations of the delta functions match the analytic result, which in this case should b at k = +/- 1.
This is my first time posting to these forums. Please inform and forgive me if I break any conventions. Any advice you could offer would be greatly appreciated!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!