IFFT Matlab symmetric vs Java math commons

2019-06-14 03:08发布

问题:

iam translating matlab code to java and i have a problem where i dont understand the difference betweent a normal X = ifft(___)function in matlab compared to a X = ifft(___,symmetric) . Matlab Docs they write:

For nearly conjugate symmetric vectors, you can compute the inverse Fourier transform faster by specifying the 'symmetric' option, which also ensures that the output is real.

That means the FFT is only faster? and the result ist real without imaginary part.

To use the Inverse FFT in Java i use the Apache Commons Library.

 FastFourierTransformer  fft = new FastFourierTransformer(DftNormalization.STANDARD);

        X= fft.transform(X, TransformType.INVERSE); //X is a Complex Array

This gives me different results if i use the symmetric in Matlab. Without symmetric in matlab i have the same result.

what is wrong with my Ifft? How to calculate the ifft symmetric with Java?

回答1:

If your X is real and thus your Y is conjugate symmetric you can use the "symmetric" option to run fft or ifft more efficiently. You are not supposed to use "symmetric" option if this precondition doesn't apply. Probably your X is not real, is it?