An RF Survey Program
Above is one of the possible outputs from this RF survey program, the primary uses are non-graphical. I've got my Icom IC-7000 sweeping through its HF range of 35 KHz to 60 MHz in 5 KHz intervals, listening for 1 second at each frequency before moving on. I wrote this mainly to find quiet frequencies to listen on for radio astronomy, since most of what I hope to hear is relatively broadband but the local man-made interference is on narrow channels.
In the image above there's one row for each 1 MHz range, divided into 100 KHz chunks by the vertical lines. Within each are 20 tiny histogram bars 5 pixels wide and a maximum of 9 pixels high. Each bar represents 5 KHz. The colors are from standard resistor color codes, so the color of a bar is related to its height. There's a crude log method used in assigning heights and colors because I wanted to emphasize differences toward the lower ends of the ranges. The plot above is an average of 27 passes done over most of 4 weekdays. The antenna was my short T2FD about 18 feet long, with a homebrew 8:1 balun wound on an unknown used toroid. It seems like things are awfully quiet above 28 MHz.
I haven't worked out the best weighting scheme between being on the frequency I want and moving a little to find a quiter frequency. It should be possible to have output from this go into my spectrograph program as the frequencies it scans instead of arbitrary ones, so that it scans around the noise. Another use I thought of more recently is for evaluating receiving antennas. There's one example here
The dependancies have grown to Hamlib, JPEG and now PostgreSQL. This scans into a PostgreSQL database which is used as a glorified histogram. It stores a list of frequencies plus a sum of audio readings, number of audio readings, and average of the readings for each frequency. There is also a last frequency scanned and the number of passes. It was carefully written so that it can resume scanning right where it left off. Each pass takes about 3 1/2 hours.
The frequencies to be scanned are set by a few variables in the survey program itself which will then create and populate the frequency table in the database. It was originally written to handle 2 ranges of frequencies which I later figured was pointless because the IC-7000 changes antenna inputs at 60 MHz. You need to have PostgreSQL server running and create a database on it called "freqs", then change conninfo in the programs so it can connect. The program will create the tables on startup if they don't exist, in fact a good way of resetting everything is to drop the tables from psql or pgadmin3. The average is stored as a real so given enough scans it can potentially be quite accurate. You should probably scan on both weekdays and weekends to get a representative sample.
Frequency +5 KHz +10 +15 +20 +25 +30 +35 +40 +45 0.050 5811 5816 5865 5867 5736 5383 4797 4167 3597 3118 0.100 2760 2454 2222 2065 2395 3031 1763 1678 1668 1646 0.150 1668 1627 1589 1595 1581 1976 2356 1537 1506 1475 0.200 1438 1459 1377 1351 1370 1287 1264 1240 1209 1491 0.250 1473 1160 1123 1144 1112 1101 1087 1393 2043 1730 0.300 1429 1945 1755 1309 1374 1889 1128 1195 1297 1174 0.350 1180 1411 1233 1322 1512 1160 1047 958 984 1025 0.400 1054 1013 939 903 895 944 915 1153 1490 875 0.450 861 922 973 986 952 908 885 939 991 1066 0.500 953 910 883 962 975 977 1389 1181 1675 1125 0.550 1380 1021 1627 2146 2572 2134 2144 1653 2196 1541 0.600 1761 1184 1740 1348 2017 1791 2325 1765 1995 1725 0.650 2117 2606 2919 2621 2153 1904 1949 1495 1852 2217 0.700 3171 3091 3258 3140 2882 2370 1994 2428 2708 2467 0.750 1602 2257 2676 2704 2440 2252 1805 1252 1651 2395
Within the program that does the plot above is an earlier version that queries the database and outputs a text file. It outputs about 100k of text with the list of frequencies and an integer average for each, constrained to fit into an 80 column width. The units are just soundcard units, not db or microvolts. You can turn this output off if you don't want it.
As usual, this was written under OpenBSD which mostly has the same way of doing sound as NetBSD where it originated. In princicple it should work under Linux, FreeBSD, etc. if you modify the sound routines first. Windows? Forget it. The tarball.
This again is mostly a programming example. It's what I did, it probably won't work on your radio unless you've got an IC-7000, and I don't have anything else so I'm not even trying to make it universal.
Here's the output of one of the original uses I had for this program. The frequency range of 18 - 22 MHz is interesting from a radio astronomy standpoint, and it doesn't matter that much where in there you listen because most of the events are broadband. Jupiter, solar events, this is where they mostly happen. I wanted to pick the quietest frequency in that range between all the manmade stuff to listen on. I did an average of 52 scans from 18-22 in 1 KHz increments. I exported and plotted sort of haphazardly, but these were done in sequence. It's interesting to see how they developed. Big peaks that suddenly appeared got averaged down in later plots.
This range includes the 17 and 15 meter ham bands and 20 MHz WWV, some foreign broadcast stations at times. The "normal" frequency to do this on is 20.150 MHz, which had an average of 638.208 which isn't bad, but 20.911 had an average of 598.943.
The absolute best according to a database query was 20.911 MHz. My only reservation about using it is that you can see a little jog in the baseline right about there so I wonder if there's some issue with my radio's sensitivity right there. So I did a query to find the 100 best frequencies and plotted them. 20.1500 isn't among them. I'm listening on 20.911 right now and hearing the usual things that don't sound manmade.
AB1JX / toys/