Other Parts Discussed in Thread: C2000WARE
Hello,
I have succesfully used the RFFT function (FPU) to transform an array (real valued signal) to the frequency domain.
After manipulating the spectrum, I would like to return to the time domain, however no such function (IRFFT?) is available.
On a Texas forum I have read it is possible to use the RFFT function to perform the inverse discrete fourier transform.
I have tried to implement this, but without succes.
Here below I show the procecudure I use for a 4 point FFT.
(I realise the number of points should be at least 32 for the RRFT)
Procedure:
----------
Step 1) Swap the real and imaginary parts of the spectrum array(result of the FFT on a real valued signal)
RFFT result
array index: 0 1 2 3 4 5 6 7
array value: real[0] real[1] real[2] real[3] real[4] imag[3] imag[2] imag[1]
RFFT result after swapping the array
array index: 0 1 2 3 4 5 6 7
array value: real[0] imag[1] imag[2] imag[3] real[4] real[3] real[2] real[1]
The DC component (real[0]) and the Nyquist component (real[4]) remain in the same array position.
Step 2) Perform the FFT on the swapped array.
Step 3) Swap the array again as shown in step 1).
However this does not yield the correct results. Any help would be appreciated.
Also I would like to reconstruct the real/imag spectrum array from the magnitude (RFFT_f32_mag_TMU0) and the phase(RFFT_f32_phase_TMU0) results.
magnitude results
magnitude array index: 0 1 2 3 4
magnitude array value: DC mag[1] mag[2] mag[3] Nyquist
phase results
phase array index: 0 1 2 3
phase array value: 0 phase[1] phase[2] phase[3]
Would it be possible to confirm if the following reconstruction is correct?
real[0] = DC
real[1] = mag[1]*cos(phase[1])
real[2] = mag[2]*cos(phase[2])
real[3] = mag[3]*cos(phase[3])
real[4] = Nyquist
imag[3] = mag[3]*sin(phase[1])
imag[2] = mag[2]*sin(phase[2])
imag[1] = mag[1]*sin(phase[3])
Thank you!
Kind regards,
Maarten