Skip to content
Harry Munday edited this page Mar 21, 2024 · 1 revision

RSP1

The RSP1 is a very generic 20msps 8-bit able ADC using USB 2.0.

Its a viable HiFi-Decode device, and viable with a modified graph for GNURadio decoding of hifi like RTLSDR is.

GNURadio

Capture/Conversion is done via an GNU Radio flow graph

Flow Graph 1

Implementation

  • Interpolate I/Q data to double the initial sample rate

  • Frequency shift everything up so that the real-world 0Hz frequency corresponds to 0Hz in the I/Q stream

  • Take the real component of the I/Q stream and discard the imaginary component, this leaves the positive frequencies.

  • Convert the real values to 16 bit integers and save to disk.

SDR based RF capture

I've been experimenting with using an SDR for RF capture over the last week and put together some tools and documentation for previewing and converting raw I/Q data from SDRs.

First some background on signal representation, bandwidth and sample rates:

PCM

This is how digital audio is normally represented, and is also used by direct-sampling baseband capture devices like CX cards and the DdD.

The signal is represented as one real number per sample representing the amplitude of the signal at that specific point in time. This is a direct representation of the actual waveform of the signal.

In theory the maximum bandwidth of a PCM stream is half the sample rate.

I/Q

This format is typically used to represent RF signals and is the standard representation used by SDRs.

The signal is represented as one complex number per sample which effectively represents two data points at a specific point in time. The maths behind it gets quite complicated and isn't really relevant to digitizing video tapes, but the two important points are that It represents positive and negative frequencies around a central zero point, and the maximum theoretical bandwidth of an I/Q stream is equal to the sample rate.

Bandwidth:

In practice the actual usable bandwidth of a capture device will be slightly less than the maximum theoretical bandwidth for a given sample rate. In order to prevent aliasing the signal needs to be filtered to suppress any signals outside the maximum theoretical bandwidth before it is digitized. This low pass or anti-aliasing filter has a gradual roll-off and will attenuate some higher frequencies within the maximum theoretical bandwidth.

The Wikipedia article on the Nyquist-Shannon sampling theorem goes into more detail on the theory behind this.

Capture and Conversion

I used an SDRplay RSP1 and GQRX to capture the raw data but any SDR software capable of saving raw floating point I/Q data should work. Everything else uses GNU Radio 3.10.

Tune the SDR so that 0Hz is just on the bottom edge of the usable bandwidth. This ensures that none of the colour signal is lost. Usually this means the hardware centre frequency of the SDR is a little under half the sample rate. A standard PAL VHS signal seems to be about 6-7 MHz wide.

This is the basic process for converting floating point I/Q data from an SDR to a 16 bit integer PCM file vhs-decode can use:

Interpolate I/Q data to double the initial sample rate

Frequency shift everything up so that the real-world 0Hz frequency corresponds to 0Hz in the I/Q stream

Take the real component of the I/Q stream and discard the imaginary component, this leaves the positive frequencies.

Convert the real values to 16 bit integers and save to disk.

Here's the GNU Radio flowgraph

image

flowgraph

You'll need to set the sample rate and centre frequency so the flowgraph knows what frequency "0Hz" in the I/Q data corresponds to.

It's not quite fast enough to convert in realtime on my Ryzen 7 so I wouldn't suggest using it for direct capture, the main bottleneck seems to be GNU Radio's rational resampler block but if there's a more efficient way to do the interpolation it might be possible to do it in real time.

I also ended up making a PAL VHS demodulator to check my SDR captures. It does luminance but I haven't been able to get PAL colour to work properly, that really needs procedural logic and closed loop feedback which doesn't appear to be possible in GNU Radio without writing new blocks. With a few small tweaks it'll probably work for NTSC colour since that's a lot simpler but I don't have any NTSC test data to try it with.

It can also demodulate any hi-fi audio leakage picked up by the video heads.

image

flowgraph

Clone this wiki locally