How to obtain the exact value of wavelength from a 2D FFT amplitude vs wavenumber plot like it is obtainable from 1D FFT amplitude vs wavenumber plot? I have a two dimensional multi modal spatial signal generated from a MATLAB code using sinusoidal functions of different wave numbers, amplitudes and phases. What I want to know is that if I have the amplitude vs wave number plot of that signal, how can I extract the wavelength of the different spatial structures. For 1D signal and 1D FFT I know that it is possible to extract the wavelength from the amplitude vs wavenumber plot by simply taking the reciprocals of the wave numbers with non zero amplitudes. But how can it be done for 2D signal and 2D FFT? I am attaching my code below.
Ws=160; % Sampling wavenumber @ 160 Hz
L=10; % Length of domain = 10cm
N = L*Ws; % Length of signal
x = (0:N-1)*(1/Ws); % Space vector
y = [(0:N-1)*(1/Ws)]'; % Space vector
x = repmat(x,1600,1); % Space matrix
y = repmat(y,1,1600); % Space matrix
V = sin((4pix)/L)+sin((4piy)/L); % Function in the spatial domain
`
fx = linspace((-Ws/2),Ws/2,N); % computing wavenumber vector fx
fy = [linspace((-Ws/2),Ws/2,N)]'; % computing wavenumber vector fy
fx = repmat(fx,1600,1); % computing wavenumber matrix fx
fy = repmat(fy,1,1600); % computing wavenumber matrix fy
T = fft2(V); % 2D FFT
subplot(1,2,1)
pcolor(x,y,V) %%%% Contour plot in spatial domain
ax = gca;
ax.LineWidth = 2;
colormap jet
colorbar
shading interp
pbaspect([1 1 1])
xlabel('X(cm)--&gt;.')
ylabel('Y(cm)--&gt;.')
title('V = sin((4pix)/L)+sin((4piy)/L)')
subplot(1,2,2)
pcolor(fx,fy,abs(fftshift(T))) % Contour plot of FFT amplitude vs wavenumber
lin = zeros(1,N);
hold on
plot(lin,fy(1:1600),'b') % Vertical line passing through (0,0) in fft amplitude plot
hold on
plot(fx(1:1,1:1600),lin,'k') % Horizontal line passing through (0,0) in fft amplitude plot
colormap jet
colorbar
shading interp
pbaspect([1 1 1])
xlabel('Wx(cm^{-1})')
ylabel('Wy(cm^{-1})')
title('FFT amplitude')
I am attaching the plot which I got as well. Any help would be greatly appreciated.
First, you want to find the peaks in this 2D plot. In your case, you know that there will be 2 peaks in your FFT (because you added two sines). Your plot shows 4 peaks because the FFT magnitude is symmetric, since your signal is real. You can discard negative wave numbers and look for peaks among the positive wave numbers.
The wave numbers corresponding to those peaks belong to your signal. There will be two wave numbers corresponding to each peak, $k_x$ and $k_y$. We know that $k = \frac{2\pi f}{c}$, where $k = \sqrt{k_x^2 + k_y^2}$ is the wave-number, $f$ is the frequency in Hz and $c$ is the speed of sound in the medium. Now, using $\lambda = \frac{c}{f}$, we can deduce that $\lambda = \frac{2 \pi}{k}$.