# Calculating Energy Spectral Density from Magnitude and Phase data

I'm trying to do a program that can judge whether 2 audio files have the same pronunciation or not by comparing the frequency of them with each other.

The first step, finding the magnitude and phase data from the audio file by using Discrete Fourier Transform, is done. I now have a list of the DFT data from both files in 2 arrays with 10k data points in each.

My question is from that, how do I calculate the energy spectral density? What I plan to do next is to compute the Mean Squared Error of the energy spectral density between the 2 voice's data, and the result will be put under a threshold to see whether those 2 files are similar or not.

• Well, Energy Spectral Density is simply a squared magnitude vector, isn't it? Meaning: $\mathcal{E}(f)=|X(f)|^2$ – jojek Jul 6 '14 at 8:42
• So for example now the data I have for magnitude is an array [1,2,3....n], so the energy spectral density should be an array [1^2, 2^2, 3^2 .... n^2] isnt it? – Megazero Jul 6 '14 at 9:25
• Indeed it should be calculated in following way. – jojek Jul 6 '14 at 10:40
• I c, thanks :D Because I saw the minus sign after the ^2 so I though you may not copy it fully or something :P – Megazero Jul 6 '14 at 12:04
• As you can see, at the end of each comment there is a dash before user name. – jojek Jul 6 '14 at 12:09