A simple Soapy-based project help

Hello,

I’m learning SDR and DSP, so please accept my apologies if my questions reflect my beginner status.

Linked below is a small C++ project I made that uses SoapySDR and two Lime USB boards to send and then receive a small WAV audio file. Looking at the waterfall display in GQRX, I see that something is being sent. I also know that something is being received because the amplitude increases when I transmit. Antennas are attached to the boards and are within 2 inches of each other. However, the audio recording on the receiving side is apparently noise, which leads me to think I might be misunderstanding how SDR modulation works. The purpose of this project is not to make an audio FM radio station but to send and receive some intelligible data in order to test my understanding of SDR IQ modulation. I’ve tried sending some binary bits before also, and again, I saw some signal coming in and was unable to decode.

I’m reading the audio samples as floating point numbers in range from -1 to 1, and passing them as the real part to the write stream, leaving the complex part as 0: buff[i] = complex<float>(audioSample[i], 0);. On the receiving side I do the opposite, taking the real side of the read stream and saving it to a WAV audio file.

Please take a look at the attached picture from Lathi’s “Modern Digital and Analog Communication Systems”. Does it reflect the Lime USB approach? I saw a similar diagram in the Wireless Masterclass by Dr Webster. Am I correct in assuming that the Cos oscillators on RX and TX are provided by the Lime board and that in Soapy the complex write stream consists of m1 and m2 signals that are intended to be the unmodulated baseband (e.g. the raw audio file)? I read and write 1 MTU packet at a time. Is my understanding of MTU here correct? Can someone shed some light on why I might be receiving noise?

The project is here https://github.com/bijoutrouvaille/LimeSDRExample . It is runnable on a Linux system with the Soapy library installed and one or two LimeUSB boards plugged in. A small dependency for writing WAV files (https://github.com/adamstark/AudioFile) is included with the repository.

Thank you for the help! If can get this project to work, I can write up a small beginner tutorial to get started with Soapy and Lime.

This is just the nature of transmitting radio signals over the air - at first, the received signal does not really look exactly like the transmitted one, and you have to apply a lot of correction routines on the received signal before it will start to look similar to the one which you have originally transmitted.

I always say that before you start with RF transmission on real hardware, you have to make sure (e.g. via MATLAB/OCTAVE simulations) that your RX DSP routines will be able to fix at least these effects, occurring simultaneously:

  • time shift of beginning of RX signal in relation to the beggining of TX signal (time synchronization),
  • shift of received signal’s center frequency in relation to the carrier freqency of transmitted signal (frequency synchronization),
  • random phase of received signal in relation to the transmitted one (phase correction),
  • presence of white noise in received signal,
  • reception of several copies of transmitted signal with different amplitudes, phases, and time shifts, which may lead to significant power drops in received signal (multipath/fading effect).

Of course, you should determine the possible range of these effects (e.g. required range of frequency synchronization algorithm will depend on Doppler shift, frequency stability of TX and RX devices etc) and be ready to compensate them.

Only when you know exactly how to cope with such degraded RX signal in terms of DSP (i.e. when you know how to make it look as similar to the transmitted signal as it’s possible), you may feel ready to test your approach on real hardware. And as you said, before doing any of this, you have to really understand well how modulation works.

To sum up - what you want to do is not really a ‘hello world’ project, and it sound like you should look for that first.

1 Like