# Forum: GNU Radio wrong dB

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
on 2009-03-03 11:50
```Hi All,

i think i have a misunderstanding, but i don't know where it is.

I tried out an example named <usrp_am_mw_rcv.py> with
a Hardware Signal Generator connected to my USRP.
My Signal Generator generates a sin Signal with 7.0711e-3V effective
at f=1.05e6 Hz.

So my power is,
P = U*I = U^2/R, with I = U/R
P = (7.0711e-3_V)^2/50_Ohm
P = 1e-6 W

Now we convert this into dB,
P_dB = 10 * log10 (P/P_0), with P_0 = 1W
p_dB = -60_dB

But my measured Power is -11,933_dB so what is my Problem ?
Any Hints ?

The example can be found in,

Regards Markus```
on 2009-03-03 16:27
```On Tue, Mar 03, 2009 at 09:49:02AM +0000, feldmaus wrote:
> i think i have a misunderstanding, but i don't know where it is.

Here it is:

> Now we convert this into dB,
> P_dB = 10 * log10 (P/P_0), with P_0 = 1W
> p_dB = -60_dB

Here, you're comparing with 1W. You could have randomly chosen something
else, such as 1mW, yielding yet another relation.

> But my measured Power is -11,933_dB so what is my Problem ?
> Any Hints ?

Here, you're comparing with something else. There's a lot of stuff
between the coax connector and your software, so you can't trivially
translate sample values into Volts. Calibrating a USRP/GNU Radio setup
to actually measure physical units is not easy. That's why it uses 'dB'
and not 'dBW' or 'dBm', it's merely a relation.

Cheers,
MB```
on 2009-03-03 17:01
```Martin B. <braun <at> int.uni-karlsruhe.de> writes:
>
> Here, you're comparing with something else. There's a lot of stuff
> between the coax connector and your software, so you can't trivially
> translate sample values into Volts. Calibrating a USRP/GNU Radio setup
> to actually measure physical units is not easy. That's why it uses 'dB'
> and not 'dBW' or 'dBm', it's merely a relation.
>
You are right. There is many stuff between USRP and my Generator, but
the difference between -11.933dB(W or m) to -60dB is very big.
So there should be a misunderstanding or big problem ?

Therefore i tested the output of my hardwaregenerator
with a hardware scope. My cables are ok.

Which dB is shown on the FFT-Plot ?

I also tried it on my own python program with the following
modules:
[USRP Source]-->[Compl_To_Mag]-->[Throttle]-->[FFT-Sink]

Is that ok to analyze the magnitude and freq of my sin signal ?

Or do i have to pay attention to decimation, sample rate and
IF Frequency to not violate the Nyquist criteria ?

Regards Markus```
on 2009-03-03 17:31
```On Tue, Mar 03, 2009 at 02:52:44PM +0000, feldmaus wrote:
> So there should be a misunderstanding or big problem ?
Don't confuse dB and dBW. You want to see -60dBW, but you see -11.9dB.
That's because your justing looking at numbers, not voltages.

> I also tried it on my own python program with the following
> modules:
> [USRP Source]-->[Compl_To_Mag]-->[Throttle]-->[FFT-Sink]
>
> Is that ok to analyze the magnitude and freq of my sin signal ?

Only their relations, i.e. 'there is twice as much energy around f1 than
there is around f2'. Take a look at the FFT sink code and you'll find
averaging etc. GNU Radio does not know the precise antenna voltage.
Besides, there is a FFT sink for complex signals and you won't need a
throttle here, as the sampling rate is limited by the USRP.

Cheers
mb```
on 2009-03-03 19:18
```Martin B. schrieb:
> Don't confuse dB and dBW. You want to see -60dBW, but you see -11.9dB.
> That's because your justing looking at numbers, not voltages.
However there should be a reference point ?
So if you are right, which is the reference number ?
From this to my Number should be a difference of 60dB.
> Only their relations, i.e. 'there is twice as much energy around f1 than
> there is around f2'. Take a look at the FFT sink code and you'll find
> averaging etc. GNU Radio does not know the precise antenna voltage.
> Besides, there is a FFT sink for complex signals and you won't need a
> throttle here, as the sampling rate is limited by the USRP.
As i know at this moment and as my results says that is not correct.
You need a Throttle, otherwise your application
is busy. Maybe you can substitute the throttle, but thats it.
The USRP transmits as much data as it can to your computer.

Regards Markus```
on 2009-03-03 19:53
```On Tue, Mar 3, 2009 at 12:16 PM, Markus F.
> Martin B. schrieb:
>>
>> Don't confuse dB and dBW. You want to see -60dBW, but you see -11.9dB.
>> That's because your justing looking at numbers, not voltages.
>
> However there should be a reference point ?
> So if you are right, which is the reference number ?
> From this to my Number should be a difference of 60dB.

Usually when dealing with ADCs, the reference is a full scale conversion
(dBFS).

The amount of gain applied to the signal externally may very well be
unknown to the system, but you can still maintain some level of
confidence of signal levels using dBFS.

http://en.wikipedia.org/wiki/DBFS

Brian```
on 2009-03-03 20:13
```On Tuesday 03 March 2009 18:16:36 Markus F. wrote:
> Martin B. schrieb:
> > Don't confuse dB and dBW. You want to see -60dBW, but you see -11.9dB.
> > That's because your justing looking at numbers, not voltages.
>
> However there should be a reference point ?
> So if you are right, which is the reference number ?
>  From this to my Number should be a difference of 60dB.

The reference point is 0dbFS - FS meaning Full Scale, -32768...32767.
The
signal power you need to get this readings from the ADC, or more exactly
from
the FPGA depends on the daughterboard, PGA setting on the daughterboard,
decimation ...

You have to calibrate your USRP to get from the sampling values to input
power
in Watts.

> > Only their relations, i.e. 'there is twice as much energy around f1 than
> > there is around f2'. Take a look at the FFT sink code and you'll find
> > averaging etc. GNU Radio does not know the precise antenna voltage.
> > Besides, there is a FFT sink for complex signals and you won't need a
> > throttle here, as the sampling rate is limited by the USRP.
>
> As i know at this moment and as my results says that is not correct.
> You need a Throttle, otherwise your application
> is busy. Maybe you can substitute the throttle, but thats it.
> The USRP transmits as much data as it can to your computer.

The USRP outputs 64MS per second, divided by the decimation value, so it
is
rate limited. Maybe your computer is not able to keep up with that, so
you
have the _feeling_ the USRP is not rate limited, but thats just wrong.

Stefan

--
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
mailto:lurch at gmx.li  http://www.kawo1.rwth-aachen.de/~lurchi/
phone: +49 241 53809034     mobile: +49 151 50412019```
on 2009-03-03 21:22
```Stefan Brüns wrote:
>
> You have to calibrate your USRP to get from the sampling values to input power
> in Watts.
>
>
Absolutely!!

You can't get even close to "real" numbers without knowing
reasonably-precise figures for gains (losses) in the entire
chain from the antenna up to the application.  Digital filters have
gains/losses, there are gains/losses in all the bits of
analog gear in front of the A/D as well.

For my radio astronomy work, I generally don't pay too much attention to
calibration within the application, but rather
use calibrations when post-processing the logged data.  We also use