## Fast Fourier Transformation question Topic is solved

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Sasari
New User
Posts: 2
Joined: Wed Jun 01, 2016 4:49 pm

### Fast Fourier Transformation question

Hi,

question is about XMOS DSP library v3.0.0 and FFT function.
I was comparing the old library which uses two complex arrays to store FFT results and the new one (v3.0.0), which uses only one array, since I want to use the new one, because of the less memory usage.

As an example I used two real signals sig1(x) = 0.75*sin(x) and sig2(x) = 0.75 * cos(x).
1. When old library was used, the function lib_dsp_fft_forward_tworeals transformed two real signals in frequency domain and results were :
FFT output spectrum of signal 1:
re, im
0.0000000000, 0.0000000000
0.0000000000, -0.3749999991
0.0000000000, 0.0000000000
0.0000000000, 0.0000000000
0.0000000000, 0.0000000000
0.0000000000, 0.0000000000
0.0000000000, 0.0000000000
0.0000000000, 0.3749999991

FFT output spectrum of signal 2:
re, im
-0.0000000009, 0.0000000000
0.3749999991, 0.0000000000
-0.0000000009, 0.0000000000
0.0000000000, 0.0000000000
-0.0000000009, 0.0000000000
0.0000000000, 0.0000000000
-0.0000000009, 0.0000000000
0.3749999991, 0.0000000000
• When the new version of the library was used, functions dsp_fft_bit_reverse and dsp_fft_forward were used to save FFT results in one complex array:

FFT output spectrum of signals
re, im
0.0000000000, -0.0000000009
0.0000000000, 0.0000000000
0.0000000000, -0.0000000009
0.0000000000, 0.0000000000
0.0000000000, -0.0000000009
0.0000000000, 0.0000000000
0.0000000000, -0.0000000009
0.0000000000, 0.7499999981
When inverse FFT is done, in both cases (in old library by using lib_dsp_fft_inverse_tworeals, in the new library by using functions dsp_fft_bit_reverse and dsp_fft_inverse), real time signals are correct.

What's bugging me is the following (what I would expect): Every signal after FFT holds N samples of information. FFT results of the first signal should be in [0, N/2 -1] and of the second signal in [N/2, N-1] samples and in this case it doesn't look so or am I missing something ?

So the question is how (in what order) are stored FFT results, when doing FFT on two real signals simultaneously ?

Thank you
View Solution
henk
Respected Member
Posts: 346
Joined: Wed Jan 27, 2016 5:21 pm
Shouldn't you, in the new version, split the spectra afterwards?
Sasari
New User
Posts: 2
Joined: Wed Jun 01, 2016 4:49 pm
Yes, you're right.

thanks
Thomas
Active Member
Posts: 60
Joined: Fri Feb 05, 2010 12:34 pm
I wanted to add a few details.
In version 3.0 of the library, when processing two real signals, the spectrum has to be split using the function dsp_fft_split_spectrum after dsp_fft_forward to get two complete real spectra.

This is shown in the example app_fft.xc

### Who is online

Users browsing this forum: No registered users and 0 guests