On Sep 3, 2008, at 1:19 PM, matt wrote:
> I'm pretty certain that the matlab script is correct.  Is there
> something in meep which could be causing the frequency shift?

No, I can't think of anything in Meep that could cause a frequency  
shift of that sort, assuming all your units are consistent and correct.

However, your Matlab script is slightly off.  The number of data  
points from the DC frequency to the Nyquist frequency, inclusive, is  
NFFT/2+1, not NFFT/2.   So, you should have:

       f = (1/dt)/2*linspace(0,1,NFFT/2+1);
       y=plot(f,2*abs(A(1:NFFT/2+1)));

if I'm reading your code correctly.  (The DC frequency is "bin" 0 of  
the DFT, and Nyquist is the N/2-th bin, but because Matlab's indices  
are 1-based these become 1 and N/2+1, respectively.)

Regards,
Steven G. Johnson


_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to