FFT Problem (Returns random results)

后端 未结 4 1190
盖世英雄少女心
盖世英雄少女心 2021-01-24 02:37

I\'ve got this code, but it keeps returning random frequencies from 0 to about 1050. Please can you help me understand why this is happening.

My data length is 1024, sam

4条回答
  •  孤独总比滥情好
    2021-01-24 03:14

    Two things:

    • Are you sure you're using your fft function correctly? You treat the output as if it is a complex array organized [R_1 I_1 R_2 I_2 ...], but you treat the input array as if it is Organized [R_1 R_2 R_3 ... R_1024 I_1 I_2 ...] and as Henrik says then leave the complex parts uninitialized.
    • Your peak detection is extremely primitive, though it should do for simple input (like a single guitar sting). For use with a human voice, you almost certainly want a more sophisticated approach.

    Have you tried putting a known simple (i.e. pure sine) signal as input?

提交回复
热议问题