Testing the SDRplay RSP1A

175 views
Skip to first unread message

Joe Taylor

unread,
Mar 17, 2023, 3:14:19 PM3/17/23
to lin...@googlegroups.com
Hi all,

This message isn't strictly a Linrad inquiry, but smart people here
might be able to help me identify some characteristics of an SDRplay
RSP1A I've been playing with.

First, a little background. I've been using an SDRplay RSPduo for 1296
EME at club station W2ZQ. In this application Linrad controls the
RSPduo, only one channel being used, and timf2 data are send to my
program QMAP (a derivative of the better-known program MAP65).

This very successful work has encouraged me to think about using a
similar setup for some fairly simple radio astronomy -- among other
things, for detecting pulsars with our 3 m dish. With 8 MHz bandwidth
this should be possible on either the 70 cm or 23 cm ham bands, or
nearby frequencies. At present our only feed for the dish is for 1296,
so I plan to try that first.

Initial tests have been made in my lab with an RSP1A, but I expect
results to be similar with the RSPduo. I use SDRplay's documented API
to make a simple command-line program that controls the RSP device and
acquires and analyzes data from it. The results are very encouraging,
but there are some peculiarities I don't understand. These
peculiarities are the motivation for this inquiry.

Here's a summary of early test results with the RSP1A. I installed
SDRuno on Windows 10, which makes the SDRplay driver and its API
available. To run my simple test software rsp.exe from the command line
you specify a desired RF frequency in MHz, gain reduction in dB, and
"LNAstate", a parameter described in the API documentation that
determines some LNA and mixer gain settings. After startup the program
displays some details of the connected RSP device and echoes the setup
parameters. It then waits about 2 seconds for things to settle down,
and starts acquiring and analyzing data. It can save up to five types
of data:

1. Computed spectrum: 10 MHz wide (2016 bins each 4.96 kHz wide),
averaged over the full length of data acquisition.

2. Raw sample values for one buffer (2016 samples) of I and Q data.

3. Histograms of raw sample values for the I and Q data, accumulated
over the full data span.

4. Total power (sum of squares of I and Q samples) integrated over six
buffer lengths, about 1.2 ms.

5. Optionally, raw I/Q samples for the full data span. Sample rate is
10 MHz, so the data rate is huge: 40 MB/s, or 144 GB per hour. Currently
this option is turned off.

Th attached plot shows data from the first four saved categories, for a
run lasting just 8 seconds. From top to bottom:

1. The average spectrum looks good: with 10 MHz sample rate we get about
8 MHz of usable bandwidth. Here the RSP1A was lying on my desk, with no
antenna. I specified center frequency = 371 MHz. (That's in the IF
frequency range we extract from our IC-9700 at W2ZQ when doing EME at
1296 MHz). A few narrow birdies are present, but the spectrum is
otherwise clean

2 and 3. Raw I/Q sample values fall in the range ± 2048, consistent with
a 12-bit A/D converter. Indeed, with an open antenna jack nearly all
samples are less than 1/4 of full scale, as should be expected. But
unexpectedly, the samples are not evenly distributed over the range.
The second plot shows actual values of I (purple) and Q (green) for one
data buffer, 2016 samples. The third plot shows histograms of the
number of occurrences of each I and Q value, over 8 seconds. What's
going on here? Should (presumably cheap?) A/D converters behave this
way? At present I have no idea.

4. Finally, the bottom plot shows (relative) total-power values at 1.2
ms intervals over the full 8 seconds. I don't understand the
low-frequency wiggles (timescales of order 0.1 to 1 second) that are
present in this plot. Possibly related to the strongest birdies
present? These are the data that would be integrated synchronously with
the predictable pulsar period to detect a pulsar.

Can anyone help me understand the seemingly peculiar distributions of
raw I and Q sample values?

-- 73, Joe, K1JT
p2.pdf

Franco Venturi

unread,
Mar 17, 2023, 3:50:11 PM3/17/23
to Linrad
Joe,
regarding the values if the I/Q samples, please be aware that when sampling at a sample rate > 9.216Msps (see page 2 of the RSP1A data sheet - https://www.sdrplay.com/docs/RSP1Adatasheetv1.9.pdf) the RSP1A is able to send to the host only 8 bits per sample because of bandwidth limitations due to the USB2 connection in High Speed mode (480 Mb/s).

A few months ago I too wrote a little program that can record I/Q samples to file (https://github.com/fventuri/single-tuner-expriments); after I am done with work, I'll run it with the RSPdx and a sample rate of 10Msps to see if I have the same value distribution that you observed.

73, Franco K4VZ

Joe Taylor

unread,
Mar 17, 2023, 5:40:53 PM3/17/23
to lin...@googlegroups.com
Hi Franco,

Many thanks for your quick response! I'm sure I had seen those notes
about reduced numbers of bits available in the higher sample-rate
ranges, but I had forgotten about them.

The API documentation says that data are returned as arrays of short
ints for I and Q, and I'm treating them as such. Of course I can keep
only the high-order byte of each sample, which will probably fix the
problem I'm seeing in the value histograms. Alternatively, I may look
at reducing the sample rate to more like 9 MHz (for 10-bit data) or 8
MHz (12-bit). The resulting total bandwidths will be a bit less, but
perhaps not by enough to matter very much for the radio astronomy
application.

-- Joe, K1JT
> --
> There is an excellent Linrad User Guide by Gaetan, ON4KHG, at:
> http://w3sz.com/Linrad%20Installation%20&%20Configuration%20User%20Guide%20-%20V1-0.pdf
> <http://w3sz.com/Linrad%20Installation%20&%20Configuration%20User%20Guide%20-%20V1-0.pdf>
> ---
> You received this message because you are subscribed to the Google
> Groups "Linrad" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to linrad+un...@googlegroups.com
> <mailto:linrad+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/linrad/16b483bc-5007-4633-9d73-1db31036428dn%40googlegroups.com
> <https://groups.google.com/d/msgid/linrad/16b483bc-5007-4633-9d73-1db31036428dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Franco Venturi

unread,
Mar 17, 2023, 6:18:20 PM3/17/23
to Linrad
Joe,
yes, those values are indeed signed 16bit shorts in the range [-32768,32767].

I just added the ability to output the histogram of the I/Q samples to the my toy program 'single_tuner_recorder' (see link above), and I can clearly see the effects of the raw 8bit samples when sampling at 10Msps (and disabling AGC, DC offset correction, and I/Q imbalance correction):

$ ./single_tuner_recorder -H -r 10000000 -i 0 -b 8000 -l 0 -f 371000000 -D -I -g 40

SR=10000000 LO=371000000 BW=8000 If=0 Dec=1 IFagc=0 IFgain=40 LNAgain=0
DCenable=0 IQenable=0 dcCal=3 speedUp=0 trackTime=1 refreshRateTime=2048
streaming for 10 seconds
total_samples=99866592
# Sample values histogram:
#
-256 0 22
0 0 57363798
256 0 21612964
512 0 12237106
768 0 8586264
1024 0 66438
1280 3087021 0
1536 67146285 0
1792 17508610 0
2048 11439143 0
2304 685533 0
total_i_samples_in_histogram=99866592 total_q_samples_in_histogram=99866592


Franco K4VZ

Leif Asbrink

unread,
Mar 17, 2023, 10:52:37 PM3/17/23
to lin...@googlegroups.com
Hello Joe,

I think the driver from SDRplay has a routine for mirror
image suppression and also DC suppression. Maybe that
is the reason for the noise on the straight (should be)
lines in the second graph.

In Linrad you can set 12 bit (10+2) up to 9.2 MHz and a
filter bandwidth of 8 MHz. Linrad is written according
to the chip specifications.

Have a look at the attached images. With low gain, 43 dB you can
see that there is no noise on the bits, there is a DC offset
so I can not magnify very much. The noise originates in the
baseband and it is not flat at all.

With the 80 dB gain setting the noise is from the HF part. It is
nicely flat with an amplitude margin of 20 dB. The S-meter shows
75,2 dB average, and 85 dB for the strongest sample.

With the 43 dB setting the S-meter shows 52,8 dB with some low
frequency noise on it. The bandwidth is about 1 MHz in the baseband.

You should decrease the gain of the RSP1 and add gain on the RF
side. Preferrably at the antenna frequency where the digital
noise from the RSP and other stuff is less likely to add to
the signal. With about 40 dB of gain on 23 cm all spurs should
be well below the noise, only the DC component would contribute.

You can set Linrad to send the raw data samples to the network
and easily remove the DC component while computing power.

73

Leif
> --
> There is an excellent Linrad User Guide by Gaetan, ON4KHG, at:
> http://w3sz.com/Linrad%20Installation%20&%20Configuration%20User%20Guide%20-%20V1-0.pdf
> ---
> You received this message because you are subscribed to the Google Groups "Linrad" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linrad+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linrad/8c1f5447-cf2a-5ff6-0896-882315acd8ec%40princeton.edu.
spectrum80db.gif
samples43db.gif
spectrum43db.gif
samples80db.gif

Joe Taylor

unread,
Mar 20, 2023, 3:04:15 PM3/20/23
to lin...@googlegroups.com
Hi Leif,

Thanks for your help and suggestions. Yes, we certainly plan to have
significant RF gain ahead of the RSPplay unit.

-- Joe, K1JT
Reply all
Reply to author
Forward
0 new messages