FFT on WP7 shows two mirrors

Hi. I am studying the audio capabilities of the WP7 platform, and the first stumbling I had was trying to implement FFT using the Cooley-Tukey method. The result of this is that the spectrogram shows 4 identical images in this order: one normal, one inverse, one normal, one inverse. The code was taken from another C # project (for the desktop), the implementation and all variables appear in place using an algorithm. Thus, I immediately see two problems: reduced resolution and the processor wasted to create four identical spectrograms. Given a sample size of 1600 (maybe 2048), I know that it only has 512 frequency data that leave me with a resolution of 15 Hz for the frequency range of 8 kHz. Not bad, but not very good.

Should I just drop the code and use NAudio? I can’t explain why the spectrum is four times, the input is fine, the algorithm looks fine.

+3
source share
2 answers

I switched to NAudio and now FFT works. However, I could find a reason (I probably won't try to repeat the test): when I created an array of double numbers to feed into the FFT function, I did something like:

            for (int i = 0; i < buffer.Length; i+= sizeof(short))
            {
                samples[i] = ReadSample(buffer, i);
            }

For reference, "samples" is the double entry [] for fft, ReadSample is what takes care of the small / large endian. I can’t remember right now how the code was, but it missed every odd pattern.

, , , , .

, , , .

0

. 2 , , - , - . FFT.

, , .

.

+1

Source: https://habr.com/ru/post/1794393/


All Articles