This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

12 bit from ADC to Q15 for a FFT

I have a project on a STM32F103 using the ADC.

I'm trying to make simple VU meter. I made a litle circuit (a resistor divisor and a decoupling capacitor) to put the audio signal into de uC. Becouse of the resistor I get 2048 counts for no audio input.

So, when I put audio to the systems I get my ADC sampling it around 2048. Now I want to convert 16 bits unsigned (but centered at 2048) to Q15 to use CMSIS FFT_Q15

Is there any CMSIS function to do that? Is there a simple way to do that?

Thank!

Parents
  • Your signal "energy" is split on positive half of spectrum (bins 1 to 31) and negative half (bins -1 to -31 which are in position 63 to 33).
    Therefore in your case, half of expected magnitude is found on bin 10, the other half is on bin 64 - 10 !

    So either you know that your signal was real as input and you can simply multiply first half of spectrum by 2, or you take whole spectrum into account and perform the complex addition X(10) = FFT(10) + FFT*(64-10) (where the star "*" stands for complex conjugate).
Reply
  • Your signal "energy" is split on positive half of spectrum (bins 1 to 31) and negative half (bins -1 to -31 which are in position 63 to 33).
    Therefore in your case, half of expected magnitude is found on bin 10, the other half is on bin 64 - 10 !

    So either you know that your signal was real as input and you can simply multiply first half of spectrum by 2, or you take whole spectrum into account and perform the complex addition X(10) = FFT(10) + FFT*(64-10) (where the star "*" stands for complex conjugate).
Children
No data