How to calculate the energy per bin in a DFT?
I am testing my knowledge about Discrete Fourier Transforms. What I am testing now is how to calculate the central frequency of a wave using DFT. For that purpose I create a sinusoidal data using this code: // create a 100 Hz wave with a sampling rate of 512 samples per second var data : [Double] = [] for i in 0...511 { let t = Double(i) * 100/256 let f = 10 * sin(2 * Double.pi * t) data.append(f) } Then I do a DWT on data and get two vectors, one containing the real part and one containing the imaginary part. I understand that the inside each vector I will have this: data has 512 samples