Identifying and Reducing Background Noise with KERMIT
This story is adapted from my story in the September 2023 issue of PAARAgraphs
RF Background noise has been a huge problem for my HF station lately. That's in part because I live in just about the worst possible environment for an HF station (a first floor apartment with a landlord that's not into the concept of an outdoor antenna), and in part because my corner of Palo Alto just seems to have a high RF noise floor. Because of that, I had been looking for a way to at least identify the noise, and hopefully a way to actually fix or avoid it since this spring.
Given my situation, I was overjoyed to see that the June PAARA meeting's guest speaker was going to help me do just that! I greatly enjoyed Jeff's (W4DD) talk about RF background identification and minimization, and was incredibly excited to try it out for myself. I did some searching based on the notes I took at the meeting and Jeff's QRZ page, but unfortunately wasn't able to find a way to download or use his RFI-mapper software. However, his talk was so good that I knew his approach well enough to try and replicate it. I decided that since it's such a useful program, and the project felt right up my alley given my day job as an operating systems engineer, I would try it out as a learning experience.
For those who couldn't make the meeting, Jeff's talk was all about isolating RF noise that plagues HF stations in populated areas. He specifically focused on two approaches: a "wide band" option for identifying large areas with high RF background, and a "narrow band" approach to isolate specific noise sources (such as malfunctioning power equipment). The "wide band" approach involves traversing an area while continuously sampling the RF noise floor. The data is then post-processed and overlaid on a street map. This approach is good at finding wide-band noise, and can be used for noise in a specific frequency range as well, by choosing an antenna that receives well on only the band you care about. The "narrow band" approach is conceptually more simple- it's a 137MHz yagi which you connect to your HT through a step attenuator. This lets you identify a single source of RF noise, as well as its strength. I replicated both, but spent most of my time working on the "wide band" mapping method.
I named my project the Known Electromagnetic Radiation mapping and Identification Toolkit (KERMIT). KERMIT has two functions, as of today:
Collect live data on current signal strength
Process collected data into an interactive strength map
The hardware for KERMIT was not expensive. I didn't yet have a mag-mount antenna on my car, so that was an extra expense, but beside that, I spent a total of under $30. I used:
A laptop I had lying around
A USB GPS receiver for $20 (because my laptop has no onboard GPS)
An RTL-SDR v3 which I already had (can be found for $30)
A couple of adapters for the SMA port on the RTL-SDR ($10 or so)
When plugged together in the passenger seat of my car, it looks like this:
On the software side, the work took a couple of weekends. I wrote the code in Python, and attempted to make it relatively easy to follow. Essentially, it tunes the RTL-SDR to a specific frequency (I recommend using 137.00 MHz as a starting point since 2m ham antennas receive it well and it's not commonly used for intentional transmissions), and continuously takes samples of what it receives. KERMIT performs a fast fourier transform (FFT) to calculate the signal strength of whatever it's receiving (In our case, the noise floor). It also collects its current GPS location, with 1m precision, a measure of GPS error, and the current time. This data is logged to a configurable file location. Every tenth sample, the program states the current signal strength out loud. This is for two reasons: so that the user knows where they should spend more time (samples are taken at a constant rate, so slowing down means taking more samples in a similar place), and for test transmissions. I tested the system by making transmissions on 146.520 with my HT and when the computer said "S9 plus 20 db" I knew KERMIT was working.
The RTLSDR provides a way to directly read the bytes of the signal sampled. From there, it's easy to take an FFT and extract the signal strength. However, not everyone has an RTLSDR, and I would like to provide the ability to record samples via line-in from any radio at some point in the future. The way I plan to do this is by creating a mapping from (AM) audio signal strength to RF signal strength, and provide a function in my code to let other people create similar mappings for their antenna and radio setups. This has two main limitations: it only works for AM, and those mappings are only as good as the control over the calibration transmissions. The AM limitation isn't too big a deal because the kinds of interference this project is meant to find tend to be both extremely wide-band and with a strong amplitude. That means it doesn't really matter what frequency you are tuned to (other than the ability to isolate from other intentional emissions) or what mode you are receiving in.
After collecting some data, KERMIT will post-process it into an interactive map. It reads all the recorded signal strengths, and plots them on an interactive and zoomable street map. It takes the average of any signals that happen to be within 2 meters of each other, to avoid false hot-spots. This is useful for situations like being stuck at a red light, where many samples are taken in the exact same location. Without this deduplication, each place the collection continues with motion stopped would result in a bright spot on the map. Since I didn't know of any places with genuine malfunctioning equipment, I tuned KERMIT to the N6NFI repeater during a 9am talk net and drove around, to see if the mapping was working properly. These were the results:
You can see a conversation happening while driving northwest on El Camino Real, across the bottom of the image. The small brighter spots are check-ins. The longer ones are a person saying a couple of sentences uninterrupted. Of course, the end goal of this project is not to record where I was while someone is talking on N6NFI, but this provided me proof that I was actually recording something. To get a sense of the level of detail recorded through this method, here is a zoomed-in example where each individual sample is visible:
Users can mouse-over the samples and the signal strength and lat/lng location show up in a tooltip. These interactive maps work just like google maps, and can pan/zoom easily. The error and timestamp are recorded in the map as well but don't show up in the tooltip by default.
In the future, I would like to crowdsource the collection of this data. I plan to create a website to host all of the data points collected by anyone, and provide a new function in KERMIT to upload user-collected data points to that website. That way, not only is the benefit of being able to see this map shared, but also it's possible to cover more area by spreading the work across many people.
The source code, installation instructions, and examples for KERMIT are available at https://github.com/benhg/kermit. KERMIT is pretty flexible and provides configurable options for all sorts of things, like the signal annunciation frequency, sample rate, and tuned frequency. I welcome any feedback, suggestions, contributions, or users.