I assume m.data is a list of FFT magnitude-squared data; it can’t be
complex
otherwise math.log10() won’t work. It must be magnitude-squared since
it is
using 10math.log10(), otherwise it needs to be 20math.log10().
It finds the minimum out of all the bins and calls that the noise floor.
For each bin it subtracts the noise floor and calls that the power.
Although this is calculation is really the SNR, not the power.
It needs to be calibrated against a known reference to give the power.
Problem is you would have to do that for each hardware. It’s also
assuming
the lowest valued bin is noise (which isn’t necessarily true).
It’s scaling the values by the usrp_rate, probably since it’s using a
fixed-length FFT, therefore if the usrp_rate increases, then the
bandwidth
for each bin increases. They want the noise level to stay constant with
bandwidth, so it is really calculating power-spectral-density.