I have a Complex[]
(from CsCore) which is the result of my FFT.
Complex
has a float real
and a float imaginary
.
From this I calculated the following
- Frequency:
(double)index * sampleRate / FftSize;
- Amplitude / Magnitude:
Math.Sqrt(Math.Pow(real, 2) + Math.Pow(imaginary, 2));
- Phase:
Math.Atan(imaginary / real);
If these are wrong please correct me.
From what I understand, this is the frequency domain information and it allows me to see which frequencies are most common in my sample. Now I want to see the power density over time. Matlab documentation shows examples, But I don't understand it because I don't know Matlab. Could someone explain the Matlab documentation on this subject or help me with a C# implementation?
EDIT:
This answer suggest to simply square the amplitude. Is that correct?