Studies of the processing delay in SDR systems.
(Nov 1 2011)

Minimum Delay in Linrad.

With Linrad used for SDR processing one can set parameters for a total delay of 7 ms from antenna to loudspeaker. For details look here.

Performance with minimum delay parameters.

The user can set the length for the first FFT and that will of course determine the delay caused by the first FFT.

There are two parameters:

First FFT bandwidth (Hz)
First FFT window (power of sin)

These two parameters determine the size of the first FFT and thereby the delay caused. They also determine the shape of a strong carrier in the main spectrum as well as the stop band attenuation for signals well outside the desired passband.

At 500 kHz input sampling speed with a first FFT bandwidth parameter of 2000 Hz and the window function 9 (the erfc window) the first FFT size becomes 256 for a bin bandwidth of 2.6 kHz. That means that the FFT1 buffer will hold data for 0.512 ms only.

When the second FFT is disabled the output of the first FFT is the input of the third FFT. The size of the third FFT is also controlled by two parameters: Third FFT N
Third FFT window (power of sin)

The third FFT N is controlled by the arrow boxes in the upper right hand corner of the baseband graph. The range is limited by the window size and the x magnification. (The size can not become smaller than the number of yellow points that represent the filter curve.) With a first mixer bandwidth reduction parameter of 3 the baseband sampling speed becomes 62.5 kHz for an input rate of 500 kHz. Setting the third FFT N to 6 gives a size of 64 for the third FFT which means that the baseband buffer spans 1.024 ms. These parameters are extreme and the shape of the baseband filter is not very good. The window parameter is 8 for a Gaussian window. Figure 1 shows a test with the simulation file used for comparing different SDR software. It is obviuos that the erfc window allows a spur-free downsampling to 62.5 kHz while it is also obvious that the baseband filter is not very sharp. It is nearly a gaussian with the -50 dB points at about +/- 6 kHz.

Fig. 1The simulation file sim1 run through Linrad with parameters that allow 8 ms delay from antenna to loudspeaker.

In figure 6 the third FFT N is displayed in the upper right corner of the baseband spectrum under the squelch controls, the three boxes with blue zeroes in them. Small filters like this require filtering and decimation in the time domain so the box to the right of the squelch controls has to be set to 2.

The resolution of the baseband FFT is nearly the same as the resolution of the baseband filter. The baseband waterfall is not particularly useful.

The S-meter shows the filter shape and that there are no spurs due to aliasing in the resampling process.

The loudspeaker output obtained when figure 1 was recorded is shown in figure 2.

Fig. 2The loudspeaker output while recording figure 1.

The AGC is activated when the strong signal is between -7 kHz and +11 kHz which means that the 120 dB points are at about +/- 9kHz in fair agreement with the theoretically computed yellow curve in figure 1.

Performance with parameters for about 30 ms delay.

For a QSK CW SDR transceiver we can allow 30 ms for the receiver and 10 ms for the transmitter. That is fast enough for normal hand keying with 40 ms from keypress to ear.

The minimum time through Linrad is about 8 ms. The obvious place where longer buffers should be used is the baseband filter.

The following parameters give a delay of 25 ms from antenna to loudspeaker under Windows 7 with SDR-IP as input and Delta 44 with ASIO as output. With a fast soundcard as input the delay should be about 20 ms with these parameters:

Process priority = 2
Timer resolution = 1
Input sampling speed = 500000
First FFT bandwidth 1000
First FFT window = 9
First mixer bandwidth reduction = 4
Third FFT window = 8
Third FFT N = 8
Output sampling speed 48000

The processing screen for the sim1 filter test is shown in figure 3 and the associated audio output is shown in figure 4.

Fig. 3 The simulation file sim1 run through Linrad with parameters that allow 30 ms delay from antenna to loudspeaker.

Fig. 4 The loudspeaker output while recording figure 3.

The baseband sampling speed is 500000 / (24) = 31250 Hz. With third FFT N=8 for an FFT size of 256 the time held in the third fft buffer is 8.2 ms. When the outwards arrow in the upper right corner of the baseband graph is clicked once to increase the third FFT N from 8 to 9, the delay goes up from 25 to 32 ms while the skirts become half as wide.

The line shape in the first fft spectrum does not allow signals to be seen near a very strong signal. By selecting a sin7 window with a bandwidth of 2000 Hz one can get a different line shape that is better suited for finding weak signals near strong ones. The FFT1 size would be the same so the delay is unaffected. The better rejection at wide range is traded for a less sharp peak which makes the sin7 window less good for finding weak signals in white noise. Other windows than the erfc window (Flat with Gaussian error function fall-off) give rise to resampling spurs. Those spurs depend on the first mixer bandwidth reduction which does not affect the delay on a computer with several CPU cores. By setting the first mixer bandwidth reduction to 1 only one can suppress the resampling spurs by more than 130 dB.

The delay in PoewrSDR v2.2.3

The measurements were made under Windows 7 with a Softrock at 96 kHz with a Delta 44 soundcard for input as well as for output.

The user can set the buffer size for the ASIO driver as well as for the filtering (DSP). The observed delays are like this:
DSP buffer     Delay with      Delay with       
  size          128 ASIO       2048 ASIO
                  (ms)            (ms)
  256              13              48
  512              25              54
 1024              38              57
 2048             44(65)           62                            
 4096              76              95
The ASIO driver is used in RDWR mode and it works without the glitches that are observed when the input and output are used with independent drivers. It is obvious that PowerSDR is well suited for QSK CW.

The delay in other SDR systems.

To my knowledge other SDR systems use the Windows MME drivers for loudspeaker output. To my knowledge there is not yet any other SDR system that has been optimized for low latency. (Nov 2011.)

To SM 5 BSZ Main Page