2
votes

I have captured both a transmitted signal and when there is no transmission (i.e. noise only). I would like to calculate the SNR of the signal. I would like to make sure the following GNURadio flowgraph is not wrong: flowgraph in GNURadio

In summary, after the PSD of each is calculated, the "Integrate with Decimate over 2048" block sums up the power over the 2048 FFT bins. Then, the noise FFT sum is subtracted from the signal FFT sum. This is divided by the noise FFT sum and converted to dB.

This is the output of my flowgraph: This is the output of my flowgraph

As calculated by my flowgraph, the power values are:

signal only, raw power: ~0.329  
noise only, raw power: 0.000007   
SNR in dB: ~46.6dB  

I'm using a LoRa node to transmit the signal of interest; the modulation details are here: https://www.thethingsnetwork.org/docs/lorawan/#modulation-and-data-rate

The signal occupies the captured bandwidth (125k) and is sampled at 1 million samples per second.

1
Is the signal modulated? If so, what is modulation and bandwidth and what is sample rate?fstop_22
Does the signal occupy the entire bandwidth of the signal? If it doesn't, when you integrate its PSD, you'll get its contribution plus the noise's contribution in the bands that the signal doesn't occupy. If the signal is strong enough and/or wide enough, it's contribution to the sum will swamp out the noise's contribution but then it might give you wrong answers in the low-SNR case?Ahmed Fasih
I'm using a LoRa node to transmit, the details about modulation is here: thethingsnetwork.org/docs/lorawan/#modulation-and-data-rate The signal does occupy the entire bandwidth captured (125k). The sample rate is 1 million samples per second. I'll edit my post to include more details.Faith

1 Answers

0
votes

Your flowgraph should give you the correct SNR value under the following conditions:

  • the signal and noise sources are uncorrelated
  • the "noise only" captured by the lower branch has the same characteristics (especially the same average power) as the noise included in the "signal + noise" captured by the upper branch

As an aside, unless you are also using intermediate signals for other purposes, there are a few simplifications that can be made to your flowgraph:

  1. The multiplications up the upper and lower branches by the same constant factor will eventually cancel out in the divide block. You could save yourself the trouble of the scaling altogether.
  2. From Parseval's theorem, the summation of the squared magnitudes in the frequency-domain is proportional to the summation of the squared samples in the time-domain. The FFT blocks would thus not be necessary.

That said, in your flowgraph you are using some intermediate signals for GUI output purposes. In this case, you could simply put the required constant scaling just before the Number Sink.