<div dir="ltr">Hi Thomas,<div><br></div><div>It is actually the imaginary part of the FFT in matlab that has opposite sign. If you compute example 1 on the NCL ezfftf page</div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/ezfftf.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/ezfftf.shtml</a><br></div><div>in Matlab you can see that. I attached a Matlab script that shows this. </div><div><br></div><div>Unlike NCL Matlab returns the same number of coefficients as input data N ( NCL only returns half N/2). The first coefficient in the Matlab FFT is the sum of all elements, divide by N and you get the mean. The next N/2-1 entries are the same as the N/2-1 last entries, except that they are complex conjugates. So depending on which direction you read from you will either get the same sign for the imaginary part as you get in NCL or the opposite.</div><div><br></div><div>Also the magnitudes returned by Matlab are not the same automatically. You need to divide the results by N/2 to match the NCL result.</div><div><br></div><div><br></div><div>Hope this helps,</div><div>Maria</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 14, 2015 at 9:47 AM, Thomas Tobian <span dir="ltr"><<a href="mailto:thomastobian@gmail.com" target="_blank">thomastobian@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear NCL developers,<div><br></div><div>I recently worked a lot with Fourier analysis. Once, I compared the results of forward fft function in ncl and matlab. Please find attached, an example of FFT product for the meridional wind (V). So in general, the amplitudes and imaginary coefs produced by NCL and MATLAB are the same but the real part is of opposite sign. Any idea why? What is the process to use for the complex parts in NCL to convert back to longitude projection ? is there any big differences if the data has longitude -180 to 180 VS. 0-360?</div><div><br></div><div>Cheers,</div><div>Thomas</div><div><br></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>