From: Timothy Freeburn on
On May 3, 5:13 pm, "charlyb" <c...(a)eca.co.za> wrote:
> Hi,
>
> Can anyone help with this ? :-
>
> I am using the fft function on the dsPIC from the Microchip library.
>
> When I do a fft I get a non linear result. The dsPIC function claims the
> result will be 1/N where N=fft size.
>
> When I do a 512 fft with a 20Hz sine signal sampled at 640Hz - I can
> extract the frequency = 20Hz
>
> I dont see how the result is scaled relative to the original signal
> amplitude.
>
> ip is 100mV peak(200mV p2p) fft result is 0x0014 (20)  
> ip is 200mV peak(400mV p2p) fft result is 0x0052 (82)
> ip is 250mV peak(500mV p2p) fft result is 0x0080 (128)  
> ip is 300mV peak(600mV p2p) fft result is 0x00b2 (178)
> .
> .
> ip is 500mV peak (1V p2p) fft result is 0x0200 (512)
> .
> .
> .
> .
> ip is 1V peak (2V p2p) fft result is 0x07ff (2047)
>
> I have used the same signals on the ADevices simulator and the results are
> linear and look meaningful.

Charlie,

Just stabbing in the dark, but have you set your twiddle coefficients?
I might be able to help out a little more if I could see some code.

Cheers,

Tim.