Hi,

I'm having trouble with the Transform2 and Inverse2 methods of the FFT library.

Transform and Inverse work as expected, so that transforming and then inverting produces no change:

However, this does not happen with Transform2 and Inverse2:

As expected, the arrays returned by Transform are redundant (the upper half contains mirrored conjugates of the lower half, except for the first element of each half, which are always real). The arrays returned by Transform2 are not redundant (they contain the elements of the lower half only). However, Transform2 does not include the first element of the upper half, which is a not a conjugate of any element in the lower half. This number is always real, and I'm guessing that it contains important information to reconstitute the original data.

I would really like to use Transform2 and Inverse2, because they do the array copy for me. Are these methods native? Do you think that the results I'm getting are expected, and I may be missunderstanding something?

Thanks!

PS: Did my tests with an input array of 8 elements.

I'm having trouble with the Transform2 and Inverse2 methods of the FFT library.

Transform and Inverse work as expected, so that transforming and then inverting produces no change:

B4X:

```
'AUDIO_REAL is an array of size 2^N, with audio data.
'AUDIO_IMAG is an array of size 2^N, with zeros.
FFT.Transform(AUDIO_REAL, AUDIO_IMAG)
FFT.Inverse(AUDIO_REAL, AUDIO_IMAG)
'Returned AUDIO_REAL is identical to the one that went in.
```

B4X:

```
'AUDIO is an array of size 2^N, with audio data.
'FFT_REAL and FFT_IMAG are arrays of size 2^(N-1)
FFT.Transform2(AUDIO, FFT_REAL, FFT_IMAG)
FFT.Inverse2(FFT_REAL, FFT_IMAG, AUDIO)
'AUDIO is different than the one that went in.
```

I would really like to use Transform2 and Inverse2, because they do the array copy for me. Are these methods native? Do you think that the results I'm getting are expected, and I may be missunderstanding something?

Thanks!

PS: Did my tests with an input array of 8 elements.

Last edited: