Using Spectrum Lab for the reception of natural radio

By Wolfgang Buescher, DL4YHF.
Last modified: 2008-04-02 (YYYY-MM-DD)

Since I became interested in the reception of natural radio, some new functions were implemented in Spectrum Lab. This document describes how to use Spectrum Lab to improve the quality of your natural radio reception *by software*. Most important is the removal of AC hum (including harmonics) and other types of power-line noise.
If required, you can add up a multitude of other (independent) notches, high- or lowpass filters to remove other unwanted signals, like 70 Hz from PC monitors.

Note: Some links in this document only work if it was loaded from SpecLab's manual (in the "html" folder).


Getting started

Before trying all sorts of software-based audio processors, you should try to remove the noise before it enters the soundcard. Find the best location for your VLF reception antenna, and select an antenna which is best suited for your local environment . Excellent articles about this subject have been written by members of the VLF OpenLab community and members of the VLF group (at Yahoo). Be sure to visit:

Basically, natural radio is a broadband application (from 500 Hz to 10000 Hz or so, without frequency conversion),  in contrast to narrow-band listening to man-made VLF transmitters (as explained in the "VLF receiver" article).

Because SpecLab has grown over the years into a really complicated program, the best way to use it as "backend" for a natural radio receiver is this:

To get started,

The settings for the hum filter may require some "tweaking", depending on the type of noise from your VLF antenna. If the dominant hum frequency is 50 Hz,  it may be better to use the FFT to track its frequency. For other hum flavours the tracking algorithm which is implemented in Paul's HumFilt Version 1.1 or Version 1.2 is better. Playing with the parameters may help. If you are already satisfied with the performance of the preconfigured settings "as they are", you are lucky and don't have to read further in this document. Enjoy the sound of natural radio instead !

Depending on the speed of your computer, and on the bandwidth of your receiver, you may adjust the soundcard's sampling rate. For 11 kHz bandwidth (which is usually sufficient), use 22050 samples per second. If this sounds too mushy for you, increase the sampling rate to 44100 or even 48000 Hz. From the main menu, select "Options".."Audio Settings" for this.

To compare two different VLF antennas (possibly a H-field loop and an E-field whip), you can switch SpecLab into stereo mode. In the circuit window, the lower signal processing path will be enabled then. Both (left+right) channels have independent parameters, so be sure to use the same settings for all stages in the signal processing chain, and turn the hum filter on for both channels.

Implementation of the hum filter in SpecLab's DSP blackbox

The hum filter is embedded in each of Spectrum Lab's four "DSP blackboxes". In this document, only the advanced hum filter settings shall be explained.

This filter is based on an algorithm by Paul Nicholson, for more explanations see .

To use it here, you must specify your AC mains frequency (50 or 60 Hz) in the hum filter control panel. The filter tracks this frequency within a certain range to place the sharp notches of the comb filter exactly on the mains frequency and its harmonics. This only works if the mains frequency is quite stable (so its not suitable for "wandering carriers" in a shortwave receiver, caused by free running switching-mode power supplys). Alternatively you can provide an external source for the AC mains frequency, for example: Let the spectrum analyzer detect the precise mains frequency from the second channel of the soundcard (see below how to achieve this).

There is a control panel for the hum filter which can be connected to one of the four DSP blackboxes. To open the control panel, right-click on the DSP blackbox in the circuit window, point on the "hum filter" menu (so the submenu opens), then click on "Show Control Panel". On the control screen for the hum filter, you may modify...

In the lower part of the window, some actual values from the tracking algorithm are displayed. They were mainly used for testing purposes, but the "Current hum frequency" may be interesting for you (dear user) as well.

If your VLF antenna produces equally distributed harmonics of the 50 (60) Hz mains hum, the tracking algorithm "V1.2" should work fine, just like in Paul's original "Humfilt-1.2" implementation. But if there are other "ugly noises" stronger than to the hum-harmonics, it may be better for the tracking algorithm *NOT* to look at the entire spectrum. If - for example- there is a strong interfering signal which is close to but not related to hum harmonics, the filter's locking algorithm will jump around the true hum frequency.

Also, if one of the hum-harmonics (or the 50 Hz signal itself) is much stronger than all other harmonics, it may be better to lock the hum filter to that particular frequency. For this purpose, there are several methods to track the current mains frequency. Very accurate tracking of the hum frequency (50 or 60 Hz) is essential for a proper function of the hum filter. The next chapter shows some alternatives.

Detecting the hum frequency with Spectrum Lab's frequency analyzer

Just let the spectrum analyzer detect the precise hum frequency. This is basically an FFT (fast fourier transform), which transforms a signal from the time domain into the frequency domain. The results of the FFT are visible in the spectrogram window (the "waterfall") and in the spectrum graph, but the results can also be accessed through SpecLab's macro functions (there is a kind of interpreter in the program which was originally used for something totally different, but that doesn't matter now).

Use the peak_f() function, like peak_f(#1, 48, 52) or peak_f(#1, 58, 62) to get a precise reading of the mains frequency (or one of the harmonics, see below). This method is used in the preconfigured settings "HumFi50.usr" or "HumFi60.usr". Open the hum filter control panel. The peak-frequency-detection routine is entered in the edit field under the checkmark "Calculate current hum frequency from expression". Note that the 1st channel (#1) of the frequency analyzer (which feeds the waterfall) is connected to the INPUT of the DSP blackbox (labelled "L1"). Be careful not to connect this channel to "L2", because the 50 Hz / 60 Hz signal is notched in the output of the DSP blackbox !
For accurate tracking we need a good SNR of the 50 Hz / 60 Hz line, otherwise the interpolation in the peak_f function is severely degraded. If your VLF antenna does not pick up enough hum, switch the program to "stereo" mode and use the second input of your soundcard as an auxiliary hum input. Use an insulated piece of wire as "hum antenna", tied around a power cable or similar. Connect the second input of the spectrum analyzer to this auxiliary hum input. To let the "peak_f" function operate on the results of the second spectrum analyzer channel, use "#2" instead of "#1" in the first argument.

Locking the hum filter to a single "higher" harmonic of the hum frequency

This works almost the same way as locking to 50 (60) Hz, as explained in the previous chapter. All we do here is modify the numeric expression which calculates the hum frequency.

Example: Locking the filter to the 5th harmonic of the 50 Hz mains frequency.

Instead of entering
peak_f(#1, 48, 52)
in the edit field "Calculate current hum frequency from expression" (on the hum filter control panel), use an expression like this:
peak_f(#1, 245, 255) / 5
or (to lock on the 11-th harmonic):
peak_f(#1, 545, 555) / 11

(the spaces in the expression are added for clarity, the interpreter does not need them)

How does this work ? The peak_f function detects the peak frequency in the range 245 Hz ... 255 Hz, which is most likely where the 5-th harmonic of the (european) mains frequency will be. The result is divided by 5, which gives a very accurate measurement for the mains frequency itself (which is required for the filter).


Eliminating other unwanted signals

Even with the hum filter, there may be some other unwanted frequencies remaining. Most of them can be eliminated with individual notches in SpecLab's digital filter (which is by principle an FIR filter with FFT convolution). For most applications, use that filter as a lowpass- or bandpass filter. If you are plagued with hum (and similar noises from CRT monitors, which cannot be removed with the hum filter mentioned earlier), turn on the "automatic multi-notch" option in the FFT filter.

Alternatively, set the type of the FFT-based filter to "Custom Filter". Then, you can modify the filter response on-the-fly: You can then edit the filter's frequency response in graphical form in the FFT filter control panel. If the filter type is set to "custom", you can se the mouse in the filter's graph window to modify the frequency response.

Another alternative is to activate a second hum filter in the second DSP blackbox in a signal processing branch (the one close to the output, near "L4" in the circuit window). The hum filter also works with "strange" hum frequencies like 70 Hz, just turn on another hum filter (in the popup menu of the 2nd DSP blackbox) and provide an expression to detect the base frequency of the unwanted signal - something like peak_f(#1, 68, 72) .

Volume control (inside SpecLab)

After removing hum and other kinds of unwanted signals, the "remaining" effective voltage is usually much less than the total signal at the input. You may compensate this with the output amplifiers in the circuit window. On my VLF reception site (which is exceptionally bad!), the hum signal is often a hundred times stronger than anything else, this means that *after* the removal of hum the signal must be amplified by about 40 dB to have an acceptable output volume.

On this occasion, a word of warning:

If you connect the output from the soundcard to the stereo system in the living room, and don't hear much after turning the hum filter on, don't crank up the volume on the 100-watt stereo amplifier !

Instead, increase value of the "software"- output amplifier, until SpecLab's output monitor indicates about 25 % peak-to-peak output. Then, adjust the volume on your stereo amplifier to a pleasant level. The soundcard's output now has about 12 dB headroom (20*log(25/100)) before the output is clipped. This reduces the risk of blowing your speakers or damaging your ears, if suddenly a strong signal comes in from the antenna (caused by a sheep scratching its backside on someone's VLF antenna ;-).

Alternatively use one of the DSP blackboxes (preferrably the one near the output) as an automatic gain control with fast attack and slow decay.

Taking it further ?

Since November 2003, the FFT-based audio filter can also be used as an automatic multi-notch filter. It uses the FFT to transform the signal into the frequency domain, perform some kind of filtering there, and transform the filtered signal back into the time domain with an inverse FFT. Now you can have as many notches in your audio filter as you like, with less CPU power than required for a classic 128-pole digital filter implementation.

However, as mentioned above, to preserve the original sound of natural radio it is desirable to remove as much unwanted signals as possible before they enter the receiver.

Since April 2008, the filtered output (from Spectrum Lab) can be sent to Winamp, which -together with the Oddcast plugin- can be used to send a compressed continuous audio stream to an Icecast server. More details could be found here (if the link doesn't work anymore, search the net for
"Sending an audio stream to an Icecast server with Spectrum Lab, Audio-I/O, Winamp, and Oddcast" .

To get started with a suitably filtered VLF audio stream, try the following configuration:

From SL's main menu, select "Quick Settings"..."Natural Radio"..."Sferics, Tweeks, Whistlers with filtered audio output". In this configuration, both the hum filter and the FFT-based audio filter are enabled. The FFT-based filter limits the output frequency range from 300 to 13000 Hz, with an additional automatic notch filter which removes all "constant" frequencies (usually, those are man-made signals which you don't want to hear). You can check the effect by turning on the "test signal generator" : In this configuration, it adds sawtooth signals at 50, 60, and 70 Hz to simulate unwanted noise from the AC mains, TV screens, CRT computer monitors etc. With the aid of Paul's hum filter, and the additional FFT-based filter, this noise can be almost completely eliminated.

Note: This brute-force filtering does affect the wanted signals to some degree, too. So if you don't need these filters (because you don't have a lot of unwanted signals), turn them off. You can see which filter is currently active in the circuit window. Click on their symbols to configure them.

See also: main index, filter control panel, hum filter .