# PSD in dBm/Hz

**URL:** <https://www.ruby-forum.com/t/psd-in-dbm-hz/234449>\
**Category:** GNU Radio\
**Created:** [March 5, 2015, 8:45am UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449 "2015-03-05T08:45:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 5, 2015, 8:45am UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/1 "2015-03-05T08:45:37Z")

</div>

Dear Sir,

I am using USRP to receive signal, and then plot the signal using “WX  
GUI  
FFT Sink”.  
I hope to get the vertical axis as “Power Spectral Density in dBm/Hz”.  
Is there any way to do that?

Regards.

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 5, 2015, 4:20pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/2 "2015-03-05T16:20:02Z")

</div>

Do you mean adding a text label on the vertical axis, or scaling the  
spectrum? For the latter, you would have to feed the USRP a known  
(calibrated) noise source that is well above the USRP noise floor such  
as an  
HP 346 noise source. Then read the value from the spectrum and just  
re-scale the samples to your known PSD. If you change the FFT bin size,  
decimation, tuning, etc, you may need to re-scale.

I suppose you could also feed the USRP with a CW tone of known power to  
figure out it’s gain, then terminate the input with 50 ohms (i.e. -174  
dBm/Hz) and measure the power (which would be -174 dB/Hz + NF + gain).

In either case, you need a known power source to convert the dB to dBm,  
and  
noise to fill your bandwidth to get the 1/Hz.

Lou  
KD4HSO

activecat wrote

> I am using USRP to receive signal, and then plot the signal using “WX GUI  
> FFT Sink”.  
> I hope to get the vertical axis as “Power Spectral Density in dBm/Hz”.  
> Is there any way to do that?

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/PSD-in-dBm-Hz-tp52572p52578.html](http://gnuradio.4.n7.nabble.com/PSD-in-dBm-Hz-tp52572p52578.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 5, 2015, 4:23pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/3 "2015-03-05T16:23:18Z")

</div>

Activecat,

this is actually on our FAQ:  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/FAQ#How-do-I-know-the-exact-voltagepower-of-my-received-input-signal](http://gnuradio.org/redmine/projects/gnuradio/wiki/FAQ#How-do-I-know-the-exact-voltagepower-of-my-received-input-signal)

This is a very difficult problem to solve and it requires expensive lab  
equipment.

Regards,  
Martin

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 6, 2015, 2:56pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/4 "2015-03-06T14:56:46Z")

</div>

Dear Sirs,

Thanks for the answers. Let me further elaborate.

I could get what I want using Matlab, via below steps:  
1). Using GRC flowgraph, connect the USRP Source to a File Sink.  
2). Copy the file (says, test02.dat) to a PC running Matlab.  
3). Using Matlab, run these commands:  
a). c = read\_complex\_binary(‘test02.dat’)  
b). figure; periodogram( c(1:100000), [], [], 10e6 ) #  
samp\_rate is 10e6

In this case I am able to get a PSD plot.  
The question is, how to produce the PSD plot using only gnuradio  
(without  
Matlab) ?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 6, 2015, 4:18pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/5 "2015-03-06T16:18:09Z")

</div>

Equivalent function here, which could be encapsulated into a GR block if  
you  
don’t need speed:

[http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.signal.periodogram.html](http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.signal.periodogram.html)

I suppose it boils down to the difference between an FFT just normalized  
to  
bandwidth, and the FFT of the autocorrelation; the latter is the true  
definition of PSD. I learned this once 20 years ago (power signals vs.  
energy signals) but I don’t remember anymore. Maybe someone can chime  
in.

Lou

activecat wrote

> samp\_rate is 10e6
> 
> In this case I am able to get a PSD plot.  
> The question is, how to produce the PSD plot using only gnuradio (without  
> Matlab) ?
> 
> Thank you very much.

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/PSD-in-dBm-Hz-tp52572p52596.html](http://gnuradio.4.n7.nabble.com/PSD-in-dBm-Hz-tp52572p52596.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 6, 2015, 4:14pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/6 "2015-03-06T16:14:02Z")

</div>

Hi Activecat,  
I still don’t understand; do you really just want a offline data  
periodogram?  
In that case, have a look at the python “matplotlib” library examples.

Also, Martin’s and Lou’s statements still stand: just by labeling an  
axis dBm doesn’t make the data actually represent that physical entity.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 6, 2015, 4:34pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/7 "2015-03-06T16:34:35Z")

</div>

The gr-specest toolbox has all sorts of spectrum estimation algorithms,  
but they also don’t calibrate your device. A periodogram would be in  
there, called ‘welch’.

M

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [March 6, 2015, 4:34pm UTC](https://www.ruby-forum.com/t/psd-in-dbm-hz/234449/8 "2015-03-06T16:34:35Z")

</div>

On 03/06/2015 10:12 AM, Marcus M. wrote:

> On 03/06/2015 02:54 PM, Activecat wrote:
> 
> > Thanks for the answers. Let me further elaborate.
> > 
> > I could get what I want using Matlab, via below steps:
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)  
> So, I think what is wanted is some version of:

signal—\>window–\>FFT—\>scaling-of-some-sort(both linear and  
non-linear)—\>average—\>display

GR can do all of those things, and the FFT “instrumentation” widgets are  
a version of the above.

But as several have pointed out, and I’m about to repeat, without  
_calibration_ you only know what the results mean in a _relative_  
sense. The  
instantaneous voltages as seen by the ADC have been manipulated by  
all the analog “goo” in front of the ADC, including amounts of gain that  
aren’t precisely known. Further, the ADC _output_ is filtered (via  
decimation) before you see it, which should be a largely-linear  
operation, but you  
don’t know the exact gain of that transform. So, the only way to get  
precise numbers in dBm/Hz is to use laboratory calibration measurements  
so  
that you can refer this to “at the plane of the antenna connector”.  
That’s the only reasonable way, and it’s the way that laboratory grade  
things  
like spectrum analyzers deliver fairly-precise numbers–not because  
of mathematical “tricks”, but because they are _calibrated, regularly_  
against  
calibration standards.
