I want to find the median frequency from the FFT result. All I have is binned data I got from FFT (An array).
I'm doing this calculation in C, so I don't have access to the statistic tools from MATLAB or Python. I can't figure out the calculation to the median algorithm. How can I find the bin containing the (estimate) median frequency? Could you please guide me to the right direction? Thanks in advance.
The median frequency $\text{MF}$ is the frequency that divides the power spectrum $P$ equally on both sides: $\sum_{j=1}^{\text{MF}}P_j = \sum_{j = \text{MF}}^{M}P_j = \frac{1}{2}\sum_{j=1}^{M}P_j$. It's not a completely trivial algorithm. When I have some time I'll try and explain here ;)
– Jdip Dec 08 '22 at 17:00