Converting Real and Imaginary FFT output to Frequency and Amplitude

前端 未结 2 1423
轻奢々
轻奢々 2021-02-11 07:18

I\'m designing a real time Audio Analyser to be embedded on a FPGA chip. The finished system will read in a live audio stream and output frequency and amplitude pairs for the X

2条回答
  •  滥情空心
    2021-02-11 08:07

    Well, the bad news is, there's no way around needing to understand complex numbers. The good news is, just because they're called complex numbers doesn't mean they're, y'know, complicated. So first, check out the wikipedia page, and for an audio application I'd say, read down to about section 3.2, maybe skipping the section on square roots: http://en.wikipedia.org/wiki/Complex_number

    What that's telling you is that if you have a complex number, a + bi, you can picture it as living in the x,y plane at location (a,b). To get the magnitude and phase, all you have to do is find two quantities:

    • The distance from the origin of the plane, which is the magnitude, and
    • The angle from the x-axis, which is the phase.

    The magnitude is simple enough: sqrt(a^2 + b^2).

    The phase is equally simple: atan2(b,a).

提交回复
热议问题