0

I have a series of 192 data in a 3.14(m) domain. I use the "fft" command to plot the energy spectrum. How can I calculate wavenumber(k) of each grid?

Code:

data= load('data.txt');
PHI = fft(data);
% K=?? ;
%loglog(K,abs(PHI));
Moreza7
  • 23
  • 6
  • I think you have to provide some more details to your question as it is unclear what you actually want to achieve. Also, please have a look at how to create a [mre]. – HansHirse Jun 24 '19 at 04:28

1 Answers1

0

The wavenumbers are uniformly spaced spatial frequencies, obtained in a similar fashion as the FFT bin frequencies for temporal signals. You can thus compute them using the following:

K = [0:(len(data)-1)]/len(data) * (192/3.14);

Note that this give meaningful wavenumbers up to the Nyquist limit of len(data)/2 - 1. Above that you may prefer to use negative wavenumbers :

N = len(data);
K = [[0:(floor(N/2)-1)] ; [floor(N/2):(N-1)]-N]/N * (192/3.14);
SleuthEye
  • 14,379
  • 2
  • 32
  • 61