Posts Tagged SDR
Thinking of a 60 kHz crystal filter front end for the WWVB receiver brought a little bag of 32.768 kHz crystals to the surface; I figured I could use them as crash test dummies while a bag of 60 kHz crystals travels around the planet. Come to find out they don’t behave quite like crystals and a bit of investigation shows the little cans contain tuning fork resonators, not crystal slabs.
I had to see that, so I grabbed the base of one in a pin vise:
I don’t know the part number for those resonators, but it’s something like AT26, where the “26” means a cylindrical can 2 mm OD and 6 mm long, more or less.
Notching the can at the chuck with a triangular file, then wiggling the can with needle-nose pliers, eventually broke it off:
The other side:
A look through the microscope show they’re transparent, with laser trim scars on the ends:
The “holes” are unplated quartz areas, clear as the finest glass.
Not what I was expecting to see, at all!
Four SMA attenuators arrived from halfway around the planet:
The top line has ATTENUATOR wrapped around the body. They’re rated for 2 W = +33 dBm, suitable for antennas and SDR and suchlike, not real radios or even HTs.
That assortment provides 39 dB of attenuation in 3 dB steps:
- 3 6 9
- 10 13 16 19
- 20 23 26 29
- 30 33 36 39
Sweeping them on the spectrum analyzer shows they’re doing what they claim, to within the resolution of the analyzer, and remain flat through 1.5 GHz, where my cheap N-to-SMA adapter cables roll off by 3 dB. Stacking them produces 38 dB of attenuation, which is certainly the small difference of large values and fine for my simple needs.
Conversely, a quick test with a NooElec SDR shows plenty of hocus-pocus betwixt antenna and display: the RF doesn’t attenuate nearly the way you’d (well, I’d) expect.
Direct from the antenna, with AGC off and 50 dB of RF gain:
3 dB attenuator:
6 dB attenuator:
10 dB attenuator:
20 dB attenuator:
Ain’t nothin’ simple…
A tiny handful of known-good-quality SMA terminators arrived from eBay:
They’re described as KDI Triangle T187GS SMA Female Terminator, 50Ω, 1W, 0-4GHz. A bit of searching suggests MCE (whoever they are) borged KDI quite a while ago (their website, last updated in 2003, has been lightly vandalized) and a datasheet won’t be forthcoming.
In any event, a NooElec NESDR Mini 2+ radio connected to a dual-band VHF-UHF antenna perched near a window shows this for a local FM station:
Zooming to 5 dB/div:
Installing the terminator at the end of an MCX-to-SMA adapter cable:
Haven’t a clue about those tiny little spikes with the terminator in place, but they don’t line up with any of the high-energy inputs and are, most likely, junk brewed up within the radio. That’s with the RF gain set to 49.6 dB and AGC turned off.
The hardware looks like this:
The MCX connector on the radio isn’t the most durable-looking thing I’ve ever seen, so strapping the adapter cable to the case seems like a Good Idea. You can get an NESDR radio with an SMA connector for about the same price, which I’d have done if were available a while ago.
The terminated input looks to be about -75 dBFS, about 15 dB below the between-station noise, and the carrier tops out around -25 dBFS, for a “dynamic range” of 50 dB. Oddly, that’s just about dead on the maximum dynamic range you can get from the 8 bit RTL2832U demodulator / ADC stuffed inside the NESDR: 8 bits × 6 dB/bit.
It is not obvious to me the signal from a randomly chosen (albeit powerful) FM station should exactly fill the receiver’s dynamic range, particularly without AGC riding herd on the RF gain. Some hardware tinkering seems in order.
The GNU Radio flow graph:
Further results from the SDR-based WWVB receiver:
Seven hours of mid-January RF, tight-zoomed in both frequency and amplitude, from 0350 to 1050 local:
The yellow line of the WWVB carrier comes out 2 ppm high, which means the local oscillator chain is 2 ppm low. We know the WWVB transmitter frequency is exactly 60.000 kHz, translated up by 125 MHz to the N3’s tuning range; you can, ahem, set your clock by it.
The blue band marks the loop antenna + preamp passaband, which isn’t quite centered around 60.000 kHz. Tweaking the mica compression caps just a bit tighter should remedy that situation.
Given that input, a very very tight bandpass filter should isolate the WWVB carrier and then it’s all a matter of fine tuning…
All the blocks for a WWVB receiver, lined up on the attic floor:
The dramatis personae:
- 40 turn loop antenna along the bottom
- 60 kHz tuned preamp
- Ham-It-Up 125 MHz mixer (DC power from 5 V wart, offscreen top)
- ThumbNet N3 SDR (DC power from the linear supply at the top)
- Raspberry Pi 3 with Raspbian, plus reset switch
- Waterfalls from GQRX, available in the Raspbian repositories
The headless Pi connects to the house WLAN through its built-in WiFi link, so I can run the whole mess from the Comfy Chair at my desk through Remmina / VNC.
Recording 24 hours of WWVB shows it works:
The wavy line along the left edge looks like a birdie formed by a local oscillator in the attic, because the frequency varies (inversely) with temperature. It’s probably a signal on the Pi board, rectified by some junction, and translated in-band by some Ham-It-Up harmonic. Whatever.
The other traces come out bar-straight, suggesting that the 0.5 ppm (presumably, per °C) temperature-compensated oscillators along the whole RF chain behave as they should.
There’s a slight frequency shift, on the order of a few parts-per-million, between the absolutely accurate WWVB carrier and the indicated display. Not a big deal.
The broad, albeit irregular, orange band down the middle shows the loop antenna / preamp bandwidth, which is on the order of 2 kHz at -3 dB and a few kilohertz more down to the noise level.
The broad horizontal gashes seem to come from the N3’s on-board hardware AGC reacting to signals far outside the waterfall. Various birdies appear & disappear, even in this limited view, so you can just imagine what’s happening off-screen; anything popping up within the SDR’s tuning range clobbers the gain, which becomes painfully visible when zoomed this far in along both frequency and amplitude. Turning AGC off should stabilize things; perhaps software can tweak the SDR gain based on a very narrowband filter around 60.000 kHz.
The upper half of the waterfall shows decent reception for most of the night. The bottom half shows there’s basically nothing goin’ down during the day, which is about what I’d expect based watching the Alpha Geek Clock for seven years.
In any event, another 24 hours with the AGC turned off looks better:
Various sources still clobber the receiver response, but it’s not quite so dramatic.
For unknown reasons, probably having to do with the unmitigated disaster of trying to get an SDRPlay radio working with GNU Radio (about which, more later), Unicode keyboard input stopped working. This is not to be tolerated, because engineering notation requires a lot of Greek letters.
Unicode support seems to be baked into the lowest levels of the Linux operating system, although it’s not clear to me whether it’s in X, QT, GTK, or somewhere else. Googling the obvious keywords was unavailing; evidently this feature never ever fails or, more likely, very few people use it to any extent.
Note that I already have the Compose key set up, but Compose sequences don’t include Greek letters.
After considerable flailing, I added the Simple Greek keyboard layout and defined the (otherwised unused) Menu key as the keyboard layout switcher. That’s a pretty big hammer for a rather small problem; I devoutly hope Unicode mysteriously starts working again.
For reference, the Greek keyboard layout looks like this:
I’d have put Ω on the W key, rather than V, but that’s just because so many fonts do exactly that.
The solid model became slightly taller than before, due to a serious tangle of wiring below the board, with a narrower flange that fits just as well in the benchtop gripper:
Tidy brass inserts epoxied in the corners replace the previous raw screw holes in the plastic:
The screws standing on their heads have washers epoxied in place, although that’s certainly not necessary; the dab of left-over epoxy called out for something. The screws got cut down to 7 mm after curing.
The preamp attaches to a lumpy circle of loop antenna hung from the rafters and returns reasonable results:
The OpenSCAD source code as a GitHub Gist: