How to use STM32 DSP Library

- I didn't use the imaginary part, I left this part of array as 0x0000.

I saw in the example*STMicroelectronics\STM32F10x_DSP_Lib_V1.0.1\DSP DEMO\project\RVMDK*that they don't fill the array with the imaginary part.

So the x[] (input array) is : x[1] = 0x**0FE1**0000 (value 0FE1 the result of ADC conversion and 0000 imaginary part). - The missing information is the sample rate

a 1024 point FFT will have 1024 outputs

the first output will be the DC compenent,

the second will be amplitude of the frequency compenent of fs/1024*1 Hz

the third will be fs/1024*2 hz

...

the last will be fs/1024*1023 hz

where fs is the sample rate in hz

the amplitude will be in Vp/2 units Quote:

danielfpeixoto,

I think you've made a small mistake: for each sample the real part is in the lowest 16-bit and the imaginary part is in the highest 16-bit, so:

x[1]=0x00000FE1.

sword_82

According to the source code of the function MygSin in the FFT demo, I think the real part must be in the highest 16-bit :Code:

for (i=0; i < nfill; i++)

{

fY = sin(PI2 * i * (fFreq1/fFs)) + sin(PI2 * i * (fFreq2/fFs));

fZ = fAmpli * fY;

lBUFIN[i]= ((short)fZ) << 16 ; /* sine_cosine (cos=0x0) */

}

or am I wrong ?

cr4_fft_1024_stm32function that comes with DSP Library, on Keil compiler but something is wrong.I used:

x[1024], is an U32 input array with the data sampled of sinusoidal wave 10Khz,2Vpp (left adjust by 16, example: x[0]<

I'm not sure but y[0]...y[1024] must contain the frequency that this signal has.

But when I read the y[x] all vectors has something like

0xFFEFFF02, what does it mean?:-o I only have to measure the frequency and amplitude of the signal, anyboy know how to use FFT/DFT to do this.