Natpos SDR Software

Introduction - Usage Instructions - Download - Contact Info

Table of Contents

  1. System Requirements
  2. Command-Line Options
  3. User Interface Description
  4. Obtaining Hz Accuracy

System Requirements

Command-Line Options

Only the most essential options are documented here. You can learn about the rest with ./natpos ‑‑help

--server and --port configure what address and port Natpos will attempt to connect to rtl_tcp through. Note that, unlike most programs, rtl_tcp doesn't bind to INADDR_ANY, but rather to 127.0.0.1 and so it cannot be connected to from another computer unless you tell it to bind to your LAN IP, and if you do that, then you must tell Natpos to connect to it via your LAN IP, since it won't be accepting connections on 127.0.0.1.

--rate configures what sample rate you want to use with your SDR hardware. The default rate is 2.88 MHz which is the highest rate that both Natpos and USB 2.0 supports.

--bandwidth allows you to limit how much of the bandwidth given by --rate that you can actually see in Natpos. This is useful because the edges often contain frequencies that have wrapped around the edge of the waterfall, and can be very confusing when logging signals since they show up at the incorrect frequency. I'd personally rather not see the signals than see them incorrectly, so I like to use --bandwidth 2.1 so that I can still take 2 MHz steps when looking around for new signals, but there's enough left on the edge that any signal on the line between those 2 MHz steps is still visible.

--offset allows you to specify the frequency shift of your upconverter. You must then enable it with the button in the Natpos GUI. The default is 125 MHz. You can use a negative number if you have a downconverter.

--method controls which method is used to account for the fact that rtl_tcp doesn't tune to the frequency that you tell it to tune to. See "Obtaining Hz Accuracy" below for more information.

--minutes controls how many minutes of IQ history is saved and displayed via the waterfall. In Linux the buffer is memory-mapped and so you can make it quite large (many hours) if you have the available disk space. In Windows you will be limited by how much RAM you have but on a modern computer you can probably make it an hour long at least. The default is 1 minute.

--device will list the PortAudio output devices available, and let you choose which one to use, in case whatever device it chooses by default doesn't work.

There are more options to control start-up state and fine tune run-time behavior in ways that aren't easily changed at runtime, so use ./natpos ‑‑help | less if you want to learn about those

User Interface Description

This section will go over every part of the user interface and explain what it is and how you use it.

Left Panel

Center Frequency -- This is the current center frequecy of the waterfall, in other words, the frequency that the SDR hardware is tuned to. You can change this frequency by simply typing in a new frequency. A little pop-up window will appear after you start typing.

Tuned Frequency -- When you click into the waterfall, this selects the time offset and frequency offset that you want to demodulate. The frequency is shown here.

Direct Sampling -- Some SDR hardware has the option of using "direct sampling" which allows it to tune frequencies all the way down to 0 Hz. Supposedly you can enable this by clicking I or Q. I don't own one of these and so I can't be sure that this feature actually works.

Up/Down Converter -- If you are using an upconverter or downconverter, this tells Natpos to apply the frequency offset of your upconverter or downconverter (which defaults to 125 MHz and is specified with ‑‑offset on the command line) to the tuning.

Auto Gain Type -- These buttons allow you to enable one of two types of automatic gain.
  • "Off" means no automatic gain, in which case you set the gain with the slider below.
  • "HW" means to use the automatic gain provided by telling rtl_tcp to enable automatic gain.
  • "SW" means to use an algorithm built into Natpos that attemps to keep the peak IQ at about -12 dB. This will unfortunately produce visible gain changes in the waterfall as the actual gain that the hardware is capable of is random approximately 6 dB steps, but in most cases the changes have no audible effect.
Gain Slider -- With this you can choose a manual gain setting. If you click this control, "Off" is automatically selected for the Auto Gain Type.

Color Slider -- With this you can apply an offset to the color pallette used to render the FFT waterfall. In this way you can tune it to your preferences visually without having to choose a less-than-ideal gain setting.

Volume Slider -- This is the output volume of the radio.

Static Slider -- This slider controls a limit on how much audio gain the radio will apply, which effectively allows you to choose how loud the static is.

To find the ideal setting, first set the "Static" slider all the way to the right, the "Squelch" slider all the way to the left, and then adjust the "Volume" slider to how loud you want the radio to be when there is a voice transmission. Then reduce the "Static" slider until the static is as quiet as you want it to be. Note that if you reduce it completely, you won't hear weak transmissions, . Finally, adjust the squelch to your preferences, or just press the "S" key to adjust it to the current noise level.

A white line is drawn on the "Static" slider which indicates how much audio gain the current signal (or lack thereof) requires to bring it to full loudness, which is greater when signals are weaker. When the static slider is to the left of this white line, the audio gain is being limited. Only signals strong enough to bring the line left to the position of the slider will be heard at full loudness.

Squelch Slider -- This slider allows you to mute the radio until a signal over a certain strength is received. The current signal strength is indicated with a white line on the slider. You can also set the squency by pressing the "S" key when no signal is heard, which will set the slider a little above the current signal strength.

LSB, AM, USB, 12 kHz, 25 kHz, 200 kHz -- These buttons select the demodulation mode.

For LSB, USB, and AM, no channel size filter is applied, and so the audio filter ends up selecting the channel size.

For FM, the channel size and expected signal deviation are selected by which FM button you press, and the audio filter then applies an additional audio filter to the demodulated audio.

When pressing any of these buttons, a default audio filter size is selected automatically.

Audio Filter -- These buttons select the size of the audio filter.

Lame Scan Mode -- This activates a mode where Natpos constantly moves the playback cursor to whatever the strongest signal shown on the waterfall is. This can, for example, allow you to listen to many different channels on the aircraft band. To deactivate this mode, either click somewhere in the waterfall to select what you want to listen to, or right-click to disable demodulation.

PPMs Buttons -- These buttons are intended to help get the accuracy of frequencies shown in Natpos to within 10 Hz of the true frequency. Read the section "Obtaining Hz Accuracy" below for more information about these buttons. The "Reset" button will undo the changes these buttons made and restore the default state.

Toggle Test Flag -- This button will appear if I forgot to disable the test button. It is used for A/B testing features to find out which of two options works better.

Tuned Signal FFT -- This area appears when demodulation is enabled and the radio is not in FM200 mode. It has a horizontal scale above it showing -24 kHz to +24 kHz. This area shows a small FFT of the area near the playback cursor, which can be helpful for fine-tuning to signals.

Audio FFT -- This area appears when demodulation is enabled and there's enough screen space for it below the Tuned Signal FFT. It shows an FFT of the audio that runs horiztontally, with a scale on the side from 0 at the bottom and up to 24 kHz depending on how much space is available. You can use this to see how much audio bandwidth is actually in the signal that you are receiving.

Top Panel

The top panel contains four panel meters.

Peak IQ -- This meter is to help you decide on the ideal gain setting. In general you want your gain to be as high as it can be without this meter ever hitting its maximum. You'll get a lot of signal distorition if it reaches its maximum, and if it is too low, you're missing out on potential signal quality. For example, if the Peak IQ is -24 dB, then you're effectively using only 4 bits of the 8-bit ADC in your SDR hardware.

When adjusting manually, I try to aim for -6 dB which uses 7 of the 8 bits, leaving an extra bit for momentary extra-strong signals to come in without going over the limit. However I note that it seems difficult for my hardware to produce 0 dB input and so -3 might actually be the point at which distortion is beginning to occur. This is why I made the SW auto gain aim for -12 dB.

Carrier Offset -- When tuned to an AM or FM signal, this meter shows the exact carrier frequency of the signal. You can click on this meter, or press 'C' to tune to this exact frequency.

When in LSB or USB mode, this meter shows the exact frequency of the strongest signal within the audio, which is useful in some circumstances, like tuning to 124.9954 in USB mode and listening to the oscillator in my Ham-It-Up changing frequency as it warms up, while monitoring its exact frequency in the Carrier Offset meter at the same time.

Signal Strength -- This meter shows the signal strength of the tuned signal relative to full-scale input. The number shown depends upon your gain setting (and your antenna and all that) and so it is only useful for comparing the strength of signals received at the same gain setting. It's also not as easy to use as the Signal-to-Noise meter.

Signal-to-Noise -- This meter can be used to measure how far above the noise floor a received signal is. To use it, you must first zero the meter to the current noise level by waiting until there is no transmission and either clicking the meter or pressing the "Z" key. Then wait for a transmission to appear (or use the up/down arrow keys to move forward or backward in time) and then read the signal-to-noise ratio from the meter. If you want to measure a constant signal, you'll have to click somewhere that looks like it has a similar noise level, zero the meter there, and then click back to the signal that you want to measure. Like the signal strength meter, the values shown by this meter depend on how much gain is applied, and so when using it, you hsould set the auto gain type to "Off" and not change the "Gain" slider between zeroing the meter and making a measurement.

Main Waterfall

The main waterfall displays a Fourier Transform of the incomming IQ data from the SDR hardware, which allows you to see where in the frequency spectrum signals are that you might want to tune to.

The horizontal width, in terms of Hz, depends upon the sample rate that the SDR hardware is set to. This can be configured with the ‑‑rate command-line option.

The vertical size, in terms of time, is 1 minute by default, but can be made longer with the ‑‑minutes command-line option. A higher number of minutes will make the waterfall scroll more slowly, which allows you to collect a screenshot of the radio spectrum over time, and replay transmissions from futher in the past.

left click will select a frequency and a time offset for demodulation. The frequency is determined by the horizontal location of your click, and the time offset is determined by the vertical location of your click. You should click just below a signal that you want to tune to.

right click will disable demodulation, causing the radio to stop producing sound.

space bar will pause and unpause demodulation. This can be useful if, like me, you need a minute to decode every morse code character. The small waterfalls on the left will pause as well so you can see the morse code as well.

middle click when zoomed in, will shift the zoomed-in window so that where you clicked becomes the new center of the window. This will not change the current demodulation frequency.

shift middle click will adjust the center frequency so that, with the same zoom settings you have now, the frequency you clicked on moves to the center of the window. If you are fully zoomed out, this means that the center frequency is set to the frequency you clicked on. This will not change the current demodulation frequency.

scroll wheel will zoom in and out, keeping the frequency you are pointing in the same location after the zoom as before, except sometimes when zooming out when it is necessary to move it in order to avoid displaying a black area with no data on the side of the waterfall.

left & right arrow keys will shift the tuned frequency left or right by a fixed size according to which modifier keys you are holding:
  • no modifiers = 100 Hz steps
  • shift = 1000 Hz steps
  • control = 10 Hz steps
  • shift+control = 1 Hz steps
up & down arrow keys will shift the playback cursor 1 second forward or backward in time, or 10 seconds if shift is held.

[ and ] keys will shift the center frequency by a large amount, which is useful for scanning large amounts of spectrum for any signals. The exact amount is chosen to be a reasonably round number smaller than the total amount of spectrum visible.

- and = adjust the center frequency by 1% the amount as '[' and ']' which can be useful when there's some noise that's internal to the hardware radio that will shift around when the center frequency is slightly different, so that it's no longer over the top of the signal that you want to receive.

Home and End will move the playback cursor as far forward or backward in time as it can go.

Obtaining Hz Accuracy

I like for the frequency displays in Natpos to be as accurate as possible, since with SSB transmissions it's easier to just tune to the frequency everyone is using rather than have Natpos display some inaccurate frequency and have to fiddle with trying to find what frequency doesn't result in a bunch of detuned harmonics. So I've added a few features to try to get the most accurate frequencies possible.

Correcting for Upconverter Oscillator Inaccuracy

If you have a Ham-It-Up upconverter, this is probably the biggest correction you can make. My own Ham-It-Up has an oscillator that runs normally at 124.9955 MHz, but it doesn't start there, it starts somewhere else and slowly drifts to that frequency over about 10 minutes as it warms up.

To correct for this inaccuracy, start by using ‑‑offset on the command line to specify your upconverter frequency. You can specify it as accurately as you want, but it only needs to be within 20 kHz for Natpos to be able to measure it, and so the default 125 Mhz is probably fine unless your upconverter's oscillator is more than 20 kHz off. Mine is almost 4.5 kHz off so I imagine someone's might be more than 20 kHz off.

After starting Natpos, make sure your upconverter is turned on, and then click the On button in Natpos to enable upconverter mode. This will cause a Quick button to appear, which will be orange, indicating that you haven't clicked it even once since you've started Natpos. Click this orange Quick button.

After clicking the Quick button, Natpos will quickly disable upconverter mode, tune to the frequency of your upconverter, and use the carrier offset meter to measure what your upconverter's frequency is at that moment, at least to the accuracy that librtlsdr and your SDR hardware allows (and see below for what you can do abotu that). It will then switch back to upconverter mode, using the measured frequency as your upconverter frequency, instead of whatever was (or wasn't) specified on the command line.

In this way, you can calibrate to whatever your upconverter's frequency is as the moment, which is useful as it is drifting rapidly while warming up. As soon as SSB transmissions sound like the have drifted out of tune, you can click "Quick" during any one-second gap in the conversation to recalibrate to what the frequency is now.

I have no idea if this correction will work with a downconverter since I don't own one to test with.

Correcting for librtlsdr Tuning Inaccuracy

rtl_tcp via librtlsdr doesn't actually tune to the frequency requested, as the hardware isn't capable of tuning to just any frequency. Unfortunately both librtlsdr and rtl_tcp provide no feedback to the application of what frequency was actually tuned either.

By using duplicate frequency selection algorithms within Natpos itself, Natpos can attempt to compensate for this inaccuracy by calculating what frequency rtl_tcp will actually tune the hardware to and taking the actual frequency tuned into account in the user interface, so that when you demodulate 7.200000 MHz, you're actually getting something +/- 5 Hz instead of +/- 50 Hz. This makes a mountain of difference with SSB transmissions, as +/- 50 Hz tuning sounds bad, but +/- 5 Hz tuning is so close that you can't figure out if 5 Hz higher or lower is actually better or not. This is very helpful on Ham radio bands as Ham operators often tune their SSB transmissions to exact 1000 Hz offsets, making them easy to tune to when your own radio's tuning is accurate.

However, librtlsdr has changed the way that it chooses which frequency to tune to about two years ago, so Natpos has two methods which you'll have to test and figure out which one works. What's worse, neither of them may work if your SDR hardware doesn't have the same tuning chips as mine.

So the first thing to do is test Natpos with both ‑‑method 1 and ‑‑method 2 specified on the command line to figure out which, if either of these methods, works correctly for your SDR radio and librtlsdr version. The test procedure is as follows:

  1. Start up Natpos with either ‑‑method 1 or ‑‑method 2 specified on the command line.
  2. Tune to a clear constant carrier frequency somewhere. If you have a Ham-It-Up upconverter, you can turn it on and tune to 125 MHz (though be weary of the fact that it drifts a lot as it is warming up), but really any strong constant narrow-band signal should work, even if it isn't real, e.g. there's usually a strong signal at 28.8 MHz which is internal to the SDR hardware.
  3. Press the Home key to make sure that you're as close to real-time playback as possible.
  4. Switch to AM mode and use the arrow keys to tune relatively close to this signal, using the signal waterfall as a guide, to line the signal up with the 0 on its scale.
  5. Note the displayed carrier frequency in the carrier offset meter. It will probably be something slightly inaccurate like 28.799983. Make a mental note of the last 3 digits as you will be looking for changes in those 3 digits.
  6. Tune to a nearby center frequency by pressing the or = keys. Wait 1 second for the radio to tune and reacquire the signal, and for the carrier offset meter to update. Then observe the last few digits of the displayed carrier frequency. The frequency will change momentarily but it should return to the original value +/- 1 Hz.
  7. Repeatedly middle-click that same position (ignoring tha the playback cursor moved) to continue moving the center frequency by the same small amount, and after each change, check the displayed frequency again. The differences between a working method and a non-working method can be infrequent, and it is possible that you'll see a dozen correct results before you find one incorrect result.
If the result is always the same or only different by 1 or 2 Hz, then you have found the correct ‑‑method for your hardware and librtlsdr version.

If the result changes by +/- 50 Hz, then you are not using the correct ‑‑method, and if you have tried both methods and neither works, then you're probably better off not using either of them, since using them can turn a +/- 50 Hz error into a +/- 100 Hz error.

Other Features that Probably Don't Work

The following features are present but I suspect or know that they don't work correctly. You might find them useful anyway, but I don't. The main problem is that the frequency accuracy of my SDR hardware radio is too good for me to test whether these features are making meaningful corrections and for me to be motivated to put much work into implementing these features properly.

The "PPMs: Carrier Offset" button can be used when you have tuned to some frequency. The idea is that you tune to some signal that you know is exactly 100.000123 MHz or whatever it may be, and so you tune Natpos to exactly 100.000123 MHz, and the carrier offset meter shows 100.000456 due to the slight error of your SDR hardware radio's oscillator. So you click this button, and Natpos does some math to create a correction factor that makes the carrier offset meter show exactly 100.000123 MHz.

I know this doesn't actually work correctly because the tuning of the SDR hardware is more complex than the math behind this correction factor assumes. However, I don't know that it's incorrect enough that it won't provide a meaningful improvement in accuracy for someone. So I left the feature enabled so that, should it actually help someone, they can use it. Just don't be surprised if you find out it doesn't actually work correctly.

The "PPMs: Mysterious" button appears when you are in upconverter mode. The idea with this button is that Natpos makes multiple measurements of your upconverter frequency at various center frequencies and then finds a solution to a math equation that includes a correction factor for both your upconverter's actual frequency and your SDR hardware's oscillator PPM error, thereby accounting for both errors simultaneously

I suspect this doesn't actually do anything useful at all. Just using the "Quick" button alone seems to give me better results when measuring known-accurate stations like WWV whose frequencies are based on an atomic clock, and once again the actual tuning path of the SDR hardware is more complex than the equation being solved assumes. So this button is extremely unlikely to do anything useful for anyone.

The effects of all of the buttons can be removed with the "Reset" button, which will restore Natpos to whatever settings it had at start-up including what you may have specified on the command line.