Tuesday, November 12, 2013

Baudmeteors: Capturing meteors with Baudline

I already knew Baudline. I used it some years ago as a simple FFT spectrum display but I didn't use it until last summer, when Iban, EB3FRN sent me a little script to automate meteor capture using Baudline. It turned out Baudline was much more than a simple spectrum analyzer display. Baudline turns out to be a powerful signal analyzer and quickly it becomes one of the most used programs in my computer.

Digging into Baudline capabilities, I soon realized it could be very useful capturing meteors and data in showers, so inspired in Iban's code, I wrote a new script to automatize the tedious task of meteor capture / counting / analysis: Baudmeteors

Baudmeteors uses Baudline and your sound card attached to a SSB receiver, or a RTL2832 based DVB-T dongle to capture spectrograms and frequency / amplitude data from the detected meteors. It was wrote with the idea of measure doppler head echoes.

Baudmeteors (Baudline) in action with a SSB receiver

rtl_baudmeteors (baudline) in action with a RTL-2832 based DVB-T dongle


Installation is very simple.

If you want to use a SSB receiver and your computer's sound card, download Baudline and put its executable somewhere in your path (~/bin is a good idea). Second, download Baudmeteors, put it somewhere in your path (~/bin is still a good place) and check it has the executable bit set. (A simple chown +x ~/bin/baudmeteors will do).

If you want to use your RTL2832 based DVB-T dongle, download RTL_Baudmeteors, and put it somewhere in your path (~/bin is still a good place) and check it has the executable bit set. (A simple chown +x ~/bin/rtl_baudmeteors will do). Now use your favorite text editor and open rtl_baudmeteors. Edit these two first lines to suit your working conditions:

RXFREQ: The carrier frequency of the signal you use to detect meteors. In my case it is 143050000 Hz ( Graves, the french radar)

RTLPPM: Dongle's fine clock adjustment. It's a must for you to know this value, because RTL_Baudmeteors uses a 8 kHz receiving window. If your dongle is severely off frequency, you will miss the meteor reflections.


Usage is also quite simple. Baudmeteors uses only one simple argument: The signal to noise ratio threshold.
Baudmeteors constantly monitors Baudline's data output, and when a meteor with larger signal to noise ratio than the specified level appears, Baudmeteors takes a screenshot of Baudline's display and saves to disk the data for that meteor. Therefore, the usage is:

    baudmeteors [SNR_threshold]


    rtl_baudmeteors [SNR_threshold]

Signal to noise thresholds around -3 to 3 dB are ok most of times for SSB receivers and -6 to 0 dB to RTL based dongles. If no SNR_threshold is supplied, Baudmeteor uses 3dB as default value. Baudmeteors saves the files into the current directory, so it will be better to cd into a new directory before launch Baudmeteors.

Now, connect the output of your SSB receiver to your computer's line input, and adjust the input level (using the sound mixer or the receiver's output level) until you get a comfortable spectrogram as shown it the previous image.

If you are using a RTL2832 based dongle, and your spectrogram is too dark or too bright, you can adjust it using Baudline's own function. Right click on Baudline's main window, select input, and then, color aperture. If you want to make that changes permanent, look in rtl_baudmeteors the lines coloraperture.upper and coloraperture.lower and edit them accordingly.

RTL_Meteors uses rtl_fm utility to read samples from the DVB-T dongle in automatic gain mode. This will sufice in most cases. If not, you can experiment adding the -g parameter to the rtl_fm command. Maybe you can think rtl_sdr is better suited to this kind of job, and you are right but as November 13, 2013 rtl_sdr lacks ppm adjustment, which is a must for this kind of job.

Baudmeteors output samples

When baudmeteors detects an event, a message will be displayed at the standard output, for example:

    2013-11-07_08-32-12 Meteor at -3 dB!

The first part is the event timestamp, and the second part is the amplitude that triggered the event. This event will create two data files in the current directory: An image and a txt file with the same timestamp as part of the name, in this case:

1383805932.674264 1637.60727126 -3.58677483
1383805932.686449 1622.43674254 -2.89845419
1383805932.698900 1543.52277171 -1.82627988
1383805932.710974 1427.45222776 -1.14339256
1383805932.722756 1362.31533378 -0.93485200
1383805932.734754 1295.77733612 2.49752498
1383805932.746694 1139.13689538 11.60939026
1383805932.758721 1092.80911187 14.59683132
1383805932.770810 1027.48528177 18.65910530
1383805932.782818 1001.50959058 19.67243195
1383805932.795916 978.75765909 20.48275566
1383805932.807097 976.56138937 20.63666725
1383805932.819173 974.65338411 20.68659782
1383805932.831388 971.77810365 20.59744263
1383805932.844000 970.37238642 19.45832253
1383805932.855997 970.09227638 18.34478951
1383805932.868133 969.40249879 16.28896523
1383805932.880093 969.08365290 15.68780136
1383805932.892133 969.54813885 14.73942852
1383805932.904060 969.95508482 14.29227924
1383805932.916397 970.91701716 12.56768894
1383805932.928277 971.09946594 11.97242928
1383805932.940082 971.39862416 11.57165813
1383805932.952182 972.15906038 11.64154339
1383805932.964387 972.00547585 12.19365215
1383805932.976442 971.82712694 12.47990417
1383805932.988588 971.62505622 13.10677624
1383805933.000974 971.55480389 13.52358818
1383805933.012522 971.53683184 13.60359192
1383805933.024774 971.57776668 13.91839027
1383805933.036718 971.59556280 14.18863583
1383805933.048568 971.59223227 14.42425919
1383805933.061118 971.49663687 14.64769077
1383805933.072478 971.41045998 14.67297745
1383805933.084594 971.28993558 14.63690853
1383805933.096833 971.16656672 14.57769585
1383805933.108719 971.06222084 14.37547779
1383805933.120814 970.93369607 13.55242157
1383805933.132859 971.03871216 12.51197529
1383805933.144814 971.09390126 11.86266327
1383805933.156617 970.97978995 10.26626205
1383805933.168587 970.87294423 9.15143967
1383805933.180588 970.90184551 6.17759800
1383805933.192798 970.90856326 4.64570189
1383805933.205284 971.00673756 2.23596811
1383805933.217583 970.87452351 2.19429803
1383805933.229330 970.82206241 2.97071028
1383805933.241476 970.79237946 4.72402143
1383805933.253495 970.70158439 6.24093437
1383805933.265447 970.69230490 6.91200972
1383805933.277712 970.54804387 7.43248129
1383805933.289867 970.35419788 8.08792496
1383805933.301621 970.29794446 8.31594467
1383805933.313789 970.33325169 8.49901581
1383805933.325714 970.42558751 8.45524502
1383805933.337647 970.62839709 8.26589298
1383805933.349905 970.88819269 7.84100246
1383805933.362277 971.08419802 6.98377371
1383805933.374534 971.37937758 6.33895826
1383805933.386527 972.19805361 4.82326746
1383805933.398261 972.40770766 4.12154436
1383805933.410163 972.49243279 3.38095355
1383805933.422747 972.09864569 0.35971847
1383805933.434480 971.83486346 -0.26229766
1383805933.446526 971.51618054 -0.50163126
1383805933.458666 970.48113690 -0.53126729
1383805933.470476 970.06885635 -0.60686028
1383805933.482711 969.25190741 -1.22364402
1383805933.494911 968.09008684 -2.31001425
1383805933.506884 967.95442346 -2.98296571
1383805933.519111 968.08919133 -4.18813562
1383805933.532096 967.83395981 -3.75865412
1383805933.543221 967.65441675 -2.71917057
1383805933.555914 967.88191914 0.02909805
1383805933.567642 968.65914954 2.23767090
1383805933.580279 968.64900634 2.91732025
1383805933.591355 968.49807789 3.44229054
1383805933.603415 968.42776804 4.05750322
1383805933.615376 968.47674379 4.09631538
1383805933.628393 968.59691260 3.66787767
1383805933.640084 967.98987632 2.52367306
1383805933.653022 966.71828605 0.73854613
The PNG file is a screenshot of Baudline' screen. You can see the meteor, and in this case, a clearly visible head echo that precedes the stationary meteor reflection. If you need more information about the meteor, you can check the txt file. The txt data file is pure ascii text in three columns. The first column is the time, in Unix time. For example, 1383805932.674264 can be translated to 2013-11-07 07:32:12 and 674264 nanoseconds, using for example the command:
    date -d @1383805932.674264 '+%Y-%m-%d %H:%M:%S.%6N'

The second column display the frequency of the peak at that time, and the third column, the signal to noise ratio of that peak. This simple data file format permits to do quick graphs, for example, the amplitude-time graph:

It is easy to see the fading from the meteor, with a periodicity of about 0.3 seconds. Using the third column you can plot the frequency-time graph, to display doppler both in the head and in the tail echoes:

Now it is easy to see how the head echo appeared at around 1600 Hz and went down to the rest frequency (about 970Hz) in just 0.17 seconds, producing an slope of nearly -3.9 kHz/sec.

Drawbacks and some notes

There are some drawbacks using baudmeteors. For example:

Baudline's main windows can't be minimized, otherwise it will not be possible to capture.

Depends on your window manager, but with some of them, there can't be another window over Baudline's main window. Otherwise, only the visible area will be captured. For example, using KDE and OpenGL composting, there is no problem with other windows over Baudline's main window. In fact, I left Baudmeteors running in a virtual desktop alone while I work in the other ones without any problems.

Primary Hz and SNR windows can be minimized, but can't be closed. If you close any of them, Baudlilne will not output the corresponding data, and Baudmeteors will fail.

Sometimes, when starting Baudmeteors, you can find some "Low audio. Increase audio input level" messages. They are ok.

Baudmeteors is a bash script, but it uses some external commands, like parec, basename, echo, date, grep, sleep and import (from ImageMagick). They should be available in any Unix-like OS.

The last but not least important, Baudmeteors is my first "big script" in bash. Don't blame on me if it is poorly coded ;-)


  1. Miguel Angel. Me quito el sombrero una vez mas. ¡¡¡ Que aplicacion mas util para MS !!!. Me gustaria poderla funcionando para las Geminidas, que estan a la vuelta de la esquina.

    Gracias por documentar y compartir tu trabajo.

    David EA4SG