I am desperate to carry out IFFT, but I cannot find any source code examples and am pulling my hair out trying to do it!
I have the following:-
fft(6,@TwiddleCoeff_64,fftbuffer3)
bitreversecomplex(6,fftbuffer3)
'At this point we have FFT ready to work on...
'Now do the inverse FFT
for lowTmpByte=1 to 127 step 2
FFTbuffer3[lowtmpbyte]=FFTbuffer3[lowtmpbyte] xor 65535
next lowtmpbyte
fft(6,@TwiddleCoeff_64,fftbuffer3)
bitreversecomplex(6,fftbuffer3)
But this just returns nonsense garbage.
Have checked all my buffers are loading/unloading properly by passing through - only using the real numbers (0,2,4,6...124,126). That's all good.
Just the FFT/IFFT doesn't work as promised.
Inverse FFT (IFFT)
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: Inverse FFT (IFFT)
Hi,
Unfortunately, we don't have function for IFFT.
Did you try FFT example, did it work?
You can find that example in installation folder in the compiler, for example in:
c:\Users\Public\Documents\Mikroelektronika\mikroBasic PRO for dsPIC\Examples\Digital Signal Processing\FFT\
If that example works, you can try to write IFFT on this way:
viewtopic.php?f=101&t=59619#p236670
If that example doesn't work, which MCU are you using?
Kind regards,
Lana
Unfortunately, we don't have function for IFFT.
Did you try FFT example, did it work?
You can find that example in installation folder in the compiler, for example in:
c:\Users\Public\Documents\Mikroelektronika\mikroBasic PRO for dsPIC\Examples\Digital Signal Processing\FFT\
If that example works, you can try to write IFFT on this way:
viewtopic.php?f=101&t=59619#p236670
If that example doesn't work, which MCU are you using?
Kind regards,
Lana
Re: Inverse FFT (IFFT)
The problem is my circuit doesn't have an easy way for me to verify the FFT, but I have managed to now set up a system whereby I can dump the FFT out.
The FFT doesn't appear to be working unfortunately.
The CPU is dsPIC33FJ128GP802.
The arrays are all in Y mem as specified, it's the first one in the program so lines up with the boundaries as specified for the bit reversals, etc.
Arrays 128 words long, the input is even as simple as a sine wave, between 16000 and 48000 (Approx), centred on 32767, and it doesn't work properly.
At least I think I'm as far along as possibly diagnosing the FFT command isn't working, or perhaps I'm not using it properly.
Can send you the ASM if you want?
The FFT doesn't appear to be working unfortunately.
The CPU is dsPIC33FJ128GP802.
The arrays are all in Y mem as specified, it's the first one in the program so lines up with the boundaries as specified for the bit reversals, etc.
Arrays 128 words long, the input is even as simple as a sine wave, between 16000 and 48000 (Approx), centred on 32767, and it doesn't work properly.
At least I think I'm as far along as possibly diagnosing the FFT command isn't working, or perhaps I'm not using it properly.
Can send you the ASM if you want?
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: Inverse FFT (IFFT)
Hi,
Did you check if you set up Project Settings properly?
Unfortunately, at this moment I don't have dsPIC33FJ128GP802,
so I cannot try FFT example on it, but which signal did you get when you run example?
Except frequency, does your input signal satisfies another requirements
written in example?
Kind regards,
Lana
Did you check if you set up Project Settings properly?
Unfortunately, at this moment I don't have dsPIC33FJ128GP802,
so I cannot try FFT example on it, but which signal did you get when you run example?
Except frequency, does your input signal satisfies another requirements
written in example?
Kind regards,
Lana