On Friday, June 29, 2012 3:57:17 PM UTC+12, Woehrle wrote:
> Greetings all,
>
> I'm having some difficulty producing a frequency vs wavenumber plot from some E field data. (I'm trying to produce something comparable to this: http://i.imgur.com/0pGO2.png)
>
> Anyways, I know what dt (time step) and dz (distance increment) for each E value.
> So, an fft2 of Ey(z,t) should produce w,k? I might have this wrong...
>
> Here is what I've been working on....
>
>
> %load data file
> load woctrlpts.dat
>
> %Time & sample stuff
> Nz = 44; %Number of samples collected along first dimension
> Nt = 4097; %Number samples collected along second dimension
> dz = .0017; %Distance increment
> dt = 5.770885e13; %time increment
>
> %Nyqusit
> Nyq_k = 1/(2*dz);
> Nyq_f = 1/(2*dt);
>
> dk = 1/(Nz*dz);
> df = 1/(Nt*dt);
>
> k = 0 : dk : Nyq_k  dk;
> f = 0 : df : Nyq_f  df;
> %Data array
>
> E = woctrlpts(:,5);
>
> %create E(z,t) matrix
> space_time = reshape(E,44,[]);
>
> %fft2 of space_time, might be right...
> fft2result = fftshift(fft2(space_time))*dz*dt;
>
> plot(k,f,abs(fft2result))
>
> What are the necessary modifications I need to make to my code to produce a plot similar to the one mentioned above?
>
> Thanks!
That's a contour plot.
Try:
contour(k,f,abs(fft2result))
