# How is the absolute value / magnitude of a DFT calculated?

I'm trying to understand a paper describing an algorithm for doing autocorrelation of audio signals (so I can implement the algorithm in my C program), and this part of the description confuses me:

As I understand it, xlow and xhigh each represent a finite sequence of (e.g. 1024) audio samples; and DFT is the Discrete Fourier Transform function that I pass the samples into, in order to get back equal-sized sequences of (e.g. 1024) Complex values representing the audio's frequencies-distribution. So far, so good.

The next step, then (as indicated by the vertical bars, if I remember my math notation correctly) is to compute the magnitude/absolute-value of the DFT's. But it's not clear to me what magnitude/absolute-value means in the context of a DFT result. Can someone explain this operation to me (keeping in mind that my mathematical skills are quite rudimentary)?

(Googling only brought me to a bunch of MatLab scripts which invoke the abs() function on a DFT result, but don't describe what the operation does :( )

• $|a+ib|^2 = a^2+b^2, |a+ib| = \sqrt{a^2+b^2}$ – reuns Nov 16 '17 at 0:25
• @reuns I'm probably missing something obvious, but your equation appears to compute the (scalar) magnitude of a single Complex value; in this case I need to compute the magnitude of a sequence-of-1024-Complex-values, and AFAICT the result of that computation needs to be a sequence-of-1024-Complex-values as well, since a sequence of Complex values is what the IDFT() (inverse DFT) function expects as its input. – Jeremy Friesner Nov 16 '17 at 0:44
• Apply $|.|$ to each complex number.. In matlab $|.|$ is abs and it works also for arrays. – reuns Nov 16 '17 at 0:46
• @reuns so just to make sure I understand correctly, I'd set the "real" portion of each Complex number to the value specified by your formula, and the "imaginary" portion of each Complex number to zero? – Jeremy Friesner Nov 16 '17 at 0:49
• sure $\sqrt{a^2+b^2}$ is a complex number with zero imaginary part – reuns Nov 16 '17 at 0:50