ac2cz / FoxTelem

AMSAT Fox-1 Telemetry Decoder
GNU General Public License v3.0
52 stars 17 forks source link

dB values on the FFT will not be correct for sources which are not 16 bit #223

Closed ac2cz closed 6 years ago

ac2cz commented 8 years ago

e.g. the airspy is 12 bit. See the excellent notes in sdrtrunk's Spectrum db converter class

chrisethompson commented 7 years ago

Furthermore, when I calculate the PSD I take the square root, which is not correct. The magnitude is equal to I^2 + Q^2. For a complex input the magnitude needs to be divided by N (not N/2). Need to remember if that factor is already applied when the FFT run. I know its an option in the method.

It is then divided by the bin bandwidth to get PSD.

ac2cz commented 7 years ago

Also stretching the FFT vertically currently changes the position of the trace wrt the scale. Which can't be right!

ac2cz commented 7 years ago

Issue with stretching was a bug and is fixed in v1.05p The calculation has to be tested with a calibrated source and a couple of different dongles. This needs to be tried in the rtlsdr branch where the new USB code is implemented.

ac2cz commented 7 years ago

float minValue = (float) (20 * Math.log10( 1.0 / ( Math.pow(2.0,( bitDepth - 1)))));

ac2cz commented 6 years ago

Actually, this may be OK. We calculate the Power Spectral Density as follows: 20Math.log10(Math.sqrt((ii) + (q*q))/binBandwidth)

So this uses the raw value of i and q, which come directly from the Complex Forward FFT.

The values from the RTL-SDR start at about -50dBm, reflecting the lower sensitivity of this device. As a test I compared to SDR#. The noise floor with no antenna and gain at min is at -60dBm. With FoxTelem the noise floor is about -65dBm. It is hard to compare directly because the gain controls work differently and changing any of them moves the noise floor.

I consider this not an issue.