Fairly recently, we updated the SNR estimator blocks for M-PSK signals to allow the user to select from four different algorithms. We wanted to test to see how well these performed in over-the-air scenarios. One algorithm, the one based on the skewness estimation, showed not to work at all and needs more study. We will ignore this and focus on the 'Simple,' 'M2M4,' and 'SVR' methods. (you can find more about the different algorithms by looking at the documentation of the SNR estimator blocks, which provide some discussion and references.)
You can find code for this is on my github repo under the 'grcon12_hackfest_qam' branch: git://github.com/trondeau/gnuradio.git
Note: this branch will probably be changing some. Many of the bug fixes issued here will make it back into our normal GNU Radio source soon and only the hackfest-specific code (the GRC files, mostly) will be different here.
Also note: this is named '_qam' because we were also able to fix and demonstrate using 16QAM over the air and and 64QAM under simulation.
The GRC files can be found in gr-digital/examples/hackfest.
Visualizing the SNR
We instrumented a couple of blocks and created flowgraphs so that we could visually see the SNR estimates. The transmitter (uhd_psk_transmitter.grc) used a USRP N210:
This shows that we are transmitted a QPSK signal (4 samples/symbol, RRC filter with 0.35 rolloff). We can adjust the frequency, gain, and digital amplitude of the signal.
At the receiver, we can use both an RTL-SDR (rtlsdr_snr_receiver.grc) or a UHD device (uhd_snr_receiver.grc). A snapshot of the RTL-SDR with high SNR looks like:
So the SNR here is just the estimate out of the M2M4 estimator. The bottom graph shows the frequency domain after the signal has been raised to the fourth power. The center spike shows the carrier and the side spikes are at the plus and negative of the symbol rate. This was used so that I could adjust the fine frequency knob to adjust for frequency offsets (the constellation_receiver corrects for fine frequency and phase offsets and tracks changes as well; this was to get us in the ballpark). Also, the red in constellation plot is post equalizer and blue is pre-equalizer.
I just updated these GRC files so that we can view all three SNRs at the same time. The next graph shows all three (blue: simple, red: M2M4, green: SVR) together. Something not obvious here is that the pre-equalizer signal has a huge hole in the center of where the constellation points should be. The two USRPs were not in a line-of-sight path and so apparently had pretty bad multipath effects going on here. The equalizer cleans it up nicely, though.
Results
The question being asked here is whether or not the SNR estimators make sense, which is cataloged in the following tables.
Using the RTL-SDR receiver.
Tx Amp |
Tx Gain |
Rx Gain |
Simple |
M2M4 |
SVR |
0.15 |
5 |
15 |
20 |
20 |
20 |
0.15 |
0 |
15 |
16 |
16 |
16.5 |
0.075 |
0 |
15 |
10.5 |
10.5 |
11.5 |
0.0375 |
0 |
15 |
10 |
7 |
6 |
Using the USRP N210 as the receiver.
Tx Amp |
Tx Gain |
Rx Gain |
Simple |
M2M4 |
SVR |
0.05 |
0 |
5 |
22.5 |
22 |
23 |
0.025 |
0 |
5 |
17 |
17 |
17 |
0.0125 |
0 |
5 |
11.5 |
11.5 |
11.5 |
0.00625 |
0 |
5 |
7.5 |
6.5 |
7 |
We can see that the three estimators track each other pretty well and they almost match what we should expect. A drop of the amplitude of the signal by half should produce a decrease by 6 dB in SNR. We see almost that in most of the cases. In my mind, this is a success for the estimators.
What we experience here is that of other issues entering into the system. First, we have multipath, at least in the case of the N210 results. Also, we were too close and so the signal power was difficult to adjust appropriately. With the RTL-SDR, we were actually hitting below the receiver's sensitivity by the end, so the signal became too weak for it to pick up. Similarly, the N210 was acting too well as a receiver, and so we ended up reducing the transmit amplitude below the DAC's quantization levels. In both cases, we were greatly distorting the signal and so the SNR estimation becomes completely wrong.
The next question to answer (later), is how well the estimators work at low SNR. We expect the simple SNR to start performing poorly after somewhere between 7 and 10 dB. The others should track farther towards 0 dB. For this, we need a better experimental setup to keep the transmitter and receiver's both with the quantizer range as well as within the linearity ranges of both transmitter and receiver analog components.