A
A
Alexander Semykin2016-07-29 10:54:11
Microcontrollers
Alexander Semykin, 2016-07-29 10:54:11

How to properly set up FFT conversion on STM32F4?

Even somehow it is inconvenient to ask such questions, but I would not hurt the help of people who have encountered digital signal processing.
So, I am faced with a trivial task - to process the audio signal from the ADC. There is a digitized ADC signal - in fact, an array of 800 points (a signal with a duration of 100 ms, taken at a sampling rate of 8 kHz). There is an FFT function from the arm_math library, which provides high processing speed for this array. The problem is that I don't like the output of this transformation. The code:

/* Непосредственно комплексное БПФ-преобразование на 1024 точки */
  arm_cfft_f32(&arm_cfft_sR_f32_len1024, FFT_data, inversal_transform_flag, bit_reversr_flag);

  /* Рассчитываем амплитуду каждого спектра */
  arm_cmplx_mag_f32(FFT_data, freqs_magnitudes, FFT_SAMPLES_COUNT);

The resulting spectrum of amplitudes:
be7762c2378149efb64f453242418e81.png
So far I do not understand:
- in what frequency range is the result obtained and how is this determined?
- Is it possible to set a narrower corridor and frequency step for conversion?
I would be grateful for help, advice and an indication of the direction of the search for information.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2016-07-29
@vagrantnotes

Some bullshit. If you did FFT 800 real values, you should end up with 800 complex values ​​from which to take the modulus (if you are interested in frequency amplitudes).
After taking the module, you should get a picture that is symmetrical about the middle.
In summary, FFT gives you frequencies from 0 to half the sample rate. (Yes, this is a variation on the audiophile Kotelnikov-Nyquist theorem).
To narrow the frequency bands, you need to increase the sampling rate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question