VLFRX Tool Set Notes
This page documents the software component of my VLF receiving
station, along with various hints, tips and experiences I've had with
different tools and hardware. You can learn about the E-field receiver
I use here,
and the (future) H-field receiver I'm building here.
Contents
Logging And Processing
Sound Cards
Logging
And Processing. In the following description, I use the same
notation Paul Nicholson uses in his documentation. Reviewing the
section on streams
and
buffers first will help.
I currently have the vlfrx
tool
set installed on three Linux servers, all running Debian 6.x or
7.x. One server currently houses the sound card and does data
acquisition and GPS time stamping, while the second does signal
processing, streaming and storage. The third does SID recording, and
whistler ('event') detection. Experience has shown that at higher
sample rates, and with larger numbers of VLF stations being monitored
by vtsid, it is difficult to run all of the components on a single
machine (vtsid is one of the biggest consumers of CPU cycles,
especially when measuring absolute phase.)
The following diagram shows the signal and data flows for my current
system. The rectangles represent different vlfrx-tools components,
such as vtcard, etc. The elipses represent circular buffers
read/written by different components. The data rate (192kHz, 32kHz)
and width (2 byte integer) are also shown.
Current vlfrx-tools setup. Click
for larger image.
Here are the startup scripts I use to run the tools on boot. I
make no claim that this is the best way to do any of this - I only
claim that it works very reliably. You may notice the hostnames
"vlf01-priv", "vlf02-priv" and "vlf03-priv". Those are the aliases for
network interfaces on a private network that vlf01, vlf02, and vlf03
share. While not necessary, I did that to maximize performance between
the three machines.
On host vlf01, my data
collection box:
#!/bin/bash
# Read VLF data from sound card. VLF is on channel 2 (right). Timing
is on
# channel 1 (left).
/data/bin/vtcard -Bvv -L/data/log/vtcard_efield.log -A
b=262144,p=2048 -r 192000 -d hw:0,0 -b16 @efield,15,i2
# Wait for @efield to be ready
/data/bin/vtwait -t @efield
# Start vttime
/data/bin/vttime -Bvv -L/data/log/vttime_efield.log -m
ppsbase+,c=1.550e-3,w=auto -c1 @efield @timed
#/data/bin/vttime -Bvv -L/data/log/vttime_efield.log -m
ppsbase+,c=1.457e-3,w=auto -c1 @efield @timed
# Wait for @timed to be ready
/data/bin/vtwait -t @timed
# Start forwarding data to vlf02
/data/bin/vtcat -Bvv -L /data/log/vtcat-vlf02.log @timed:2
++vlf02-priv,9000,i2
After starting a flow of raw samples at 192kHz
from the sound card, the data is timestamped and sample rate corrected
to precisely 192kHz. The e-field data in @timed1 is then sent to host
vlf02. @timed2 will be vlf h-field data... if I ever get it finished.
:)
On to host vlf02:
#!/bin/bash
# Start collecting data from sound cards on other machines
/data/bin/vtcat -Bvv -L/data/log/vtcat_in.log ++9000 @timed,i2
# Wait for @timed to become available
/data/bin/vtwait -t @timed
# Start forwarding data to VLF03
/data/bin/vtcat -Bvv -L /data/log/vtcat-vlf03.log @timed:1
++vlf03-priv,9000,i2
# Create a filtered version of the stream
/data/bin/vtfilter -B -a th=6 -h hp,f=200,poles=3 -h
lp,f=8000,poles=3 -g4 @timed:1 @filter2
/data/bin/vtwait -t @filter2
# Create a resampled version of the filtered stream to 32k
/data/bin/vtresample -B -r32000 @filter2 @resampled
/data/bin/vtwait -t @resampled
# Create a resampled version of the raw stream to 32k
/data/bin/vtresample -B -r32000 @timed @resamp_raw
/data/bin/vtwait -t @resamp_raw
# Start recording resampled data to the long term data store
/data/bin/vtwrite -Bvv -G86400 -L /data/log/vtwrite_32k.log
@resamp_raw /data/raw
# Start recording full bw data to the short term data store
/data/bin/vtwrite -Bvv -G3600 -L /data/log/vtwrite_192k.log @timed:1
/data2/raw-fb
# Start remote stream to abelian.org
/data/bin/vtvorbis -Bvv -L /data/log/vtvorbis.log -eq0.8 -kn
46.4.26.83,7835 @resampled
Here we place the 192kHz timestamped stream from vlf02 into
@timed, which is read by other processes:
- It is resampled to 32kHz and then written to disk for long term
storage by vtwrite. Cron jobs use vtflac to compress data older than 1
month for long term storage.
- It is written to disk at 192kHz for short term storage. Cron jobs
limit the stored data to approximately 24 hours.
- @timed is also passed through a notch filter, a high pass filter
with Fc=200Hz, a low pass filter with Fc=8khz, amplified, and then is
written to @filter2.
- @filter2 is fed to vtvorbis, which sends the stream to abelian.org
where you can hear it as vlf35.
On to host vlf03:
#!/bin/bash
# Start collecting data from sound cards on other machines
/data/bin/vtcat -Bvv -L/data/log/vtcat_in.log ++9000 @timed,i2
# Wait for @timed to become available
/data/bin/vtwait -t @timed
# Create a filtered version of the stream
/data/bin/vtfilter -B -a th=6 -h hp,f=200,poles=3 -h
lp,f=8000,poles=3 -g4 @timed:1 @filter2
/data/bin/vtwait -t @filter2
# Create a resampled version of the stream to 32k
/data/bin/vtresample -B -r32000 @filter2 @resampled
/data/bin/vtwait -t @resampled
# Start SID monitor(s)
/data/bin/vtsid -Bvv -L/data/log/vtsid.log -c /data/sid/sid.conf
@timed:1
# Start event monitor
/data/bin/vtevent -Bvv -L/data/log/vtevent.log -d /data/events
@resampled
Here we place the 192kHz timestamped stream from vlf02 into
@timed, which is read by other processes:
- It is read by vtsid, which produces amplitude and
absolute phase data for vlf stations I monitor, as well as recording
noise levels in different bands and frequencies of interest.
- @timed is also passed through a notch filter, a high pass
filter with Fc=200Hz, a low pass filter with Fc=8khz, amplified, and
then is written to @filter2.
- @filter2 is then fed into the event detector (for
automated whistler/chorus/etc detection)
Sound
Cards. It happens that I had a large quantity (13) of Sound
Blaster Live! cards on hand from a different project. Generally
speaking, I've had acceptable results using these bargain-basement
cards. I've now moved up to the ASUS Xonar D1 (see
below).
Here are a few caveats:
Tip No. 1: I have had
much better success using the OSS drivers for the Sound Blaster!
cards. When running using ALSA drivers, my system was plagued by
vtcard dropping from run mode back into setup mode (which can happen
for a number of reasons.) I tried numerous cards on 6 different hosts
with varying buffer sizes, and was never able to get the problem to go
away. vtcard would reset between 5 and 20 times a day, interrupting my
stream and data collection constantly. By moving to OSS, and selecting
a proper buffer size, I had completely eliminated the problem.
Tip No. 2: Buffer
sizes matter. Notice the "-A b=262144,p=2048" in
the vtcard settings I use. This parameter increases the buffer used
for passing samples from the sound card. To an extent, larger is
better, as it helps vtcard cope with varying system loads. Its
possible, however, to set it too high. vttime expects to 'see' a GPS
timing pulse within a certain window of the sample buffer. If you make
the buffer too large, that pulse can walk its way outside of that
window and vttime will be unable to find it. In the end, you will
probably need to play with the buffering a little to get a setup that
works.
Tip No. 3: Not
all crystal resonators are created equal. Of the 13 Sound Blaster!
cards I had, only 5 had acceptable levels for sample rate drift (where
acceptable means that the drift is small enough that vtcard does not
revert to setup mode, and vttime is able to properly track the
changes.) All sound cards will exhibit some level of sample rate drift
over time. Some are quite stable; others not so much. The only way to
really know is to try them. Note that environmental shifts (breezes
into the PC case) can make the problem worse, so you might want to
consider creating a low air flow pocket or insulation around the sound
card.
UPDATE:
I really wanted to be able to see stations and signals higher than
24kHz, so I began to research sound cards with a 192kHz sample rate.
After a number of experiments, I settled on the ASUS
Xonar D1. Note that "D1" is important. There are a variety of
Xonar D-series cards that claim 192kHz sampling rate support, but have
a number of limitations that make them unsuitable. The D1 It it widely
available, and can be picked up on eBay quite inexpensively. There is
full ALSA support, and the sample rate for all of the D1s I've
purchased so far are quite stable. The D1 comes in a PCI form factor
(as opposed to PCI-e), and it works well in legacy hardware (like the
PCs I put to use for VLF...)
Copyright (C) 2010-2022, Mike Smith
The content presented here is the original work of Mike Smith unless
otherwise shown. Please contact me
for comments or errors.
This site was built using Emacs, GTML and CSS.