ALANBORIS.COM

Bits about technology, gadgets, DIY and more!

Listening to HD Radio with an SDR

"HD Radio" is the technology by which US radio stations broadcast digital audio along with their regular analog signal. Standard FM radios only receive the analog signal and ignore the digital data. You need an HD Radio to listen to the digital audio. HD radios are most popular as features in newer automobiles, but adoption outside of car radios, as well as awareness by the public has been underwhelming.

The “HD” in HD Radio does not stand for "high definition." In fact, Ibiquity, the company that developed (and trademarked the name) HD Radio, claims that HD doesn’t stand for anything. For us hobbyists that routinely use SDR (software defined radio) to look at the waveforms of broadcast radio, we have seen the HD Radio signals as two rectangular blocks of data alongside a station’s main signal. However, since HD Radio uses a proprietary protocol, we have not been able to decode or listen to this data.

On June 9, 2017, a cybersecurity startup based in Austin, TX named Theori, posted a full description of how HD Radio works along with their open source software implementation using a $25 RTL-SDR radio. (They utilize the official government name for HD Radio, "NRSC-5.") Finally, the veil has been lifted on the mysterious encoding for this digital system, and it turns out that it is a slightly modified version of HE-AAC.

If you are looking for a fun two-hour project, you can use Theori’s code on GitHub to create your own NRSC-5 digital radio. I followed the instructions and with just a little extra troubleshooting, I was able to get it to work. Here is what the screen output looks like when you are successfully decoding NRSC-5 audio:

nrsc5 debug output

Here are some notes on my setup:

  1. I used Ubuntu Server 14.04 (no UI) on a VMWare virtual machine. 8GB of RAM and 2 processors. Make sure your machine (virtual or not) produces audio before proceeding with the setup. I used "speaker-test" for this purpose.
  2. Be sure to install all the dependencies first. You can use a package manager such as apt-get to do the installs.
  3. To do the build of nrsc5, first learn how to clone a repository on GitHub. I looked at a few examples and was able to make sense of the build instructions.
  4. When trying to run nrsc5, I received a "usb_claim_interface error -6" because my system was trying to load the SDR hardware as a TV device, so I had to blacklist that driver at boot so it would not interfere. Use these steps:
    a. Open your /etc/modprobe.d folder as an administrator.
    b. Create a new file 'blacklist-rtl.conf' and add this one line:
    blacklist dvb_usb_rtl28xxu
    c. Save the file, close the editor and restart the machine.
  5. A good antenna and strong signal are crucial. The digital signal is significantly lower in power than the main analog signal.

Good luck and I hope you enjoy the digital audio!

Sniffing GSM with SDR

I've been fascinated by software defined radio (SDR) for years but investigating the GSM cellular network has always been just a little too challenging and slightly out of reach. All of that changed earlier this year when someone finally posted a workable, step-by-step guide for decoding (but not decrypting) cellular (GSM) radio traffic.
 
For those not familiar, SDR involves moving much of the functionality of a radio's circuitry into software rather than hardware. An SDR is a stripped down radio that outputs digital data to a host (usually a computer) where sophisticated programs decode the data into audio. For instance with an SDR and the proper software, you just need to change some code to make the radio play FM instead of AM. In recent years, cheap $20 SDR USB dongles have come onto the market replacing ones that used to cost thousands. (To get started, I suggest checking out http://www.rtl-sdr.com)
 SDR
An SDR can easily pick up cellular phone transmissions but making sense of the data is complicated. Now you can read the detailed post here and make it happen. If you follow this EXACTLY, it will work!
 
UPDATE: Since the "2G Sunset" on 1/1/2017, I have been unable to find any local GSM transmissions in the 850 MHz band using "Kalibrate." I think the solution would be to search in the higher 1900 MHz band, but to do so would require a new more expensive SDR with a wider frequency range.

Sharing Data From the Netduino

As mentioned in an earlier post, I've been working with the Netduino microprocessor board, a .NET version of the open source Arduino. In preparation for designing a home energy monitoring system, I created a small project to measure and post data from the Netduino. The simplest circuit I could find consisted of a photocell and a resistor wired into one of the analog inputs. Every 60 seconds, the Netduino measures the value from the photo cell and posts the data to the Cosm website where it is graphed and displayed for all to see.

Data collection, analysis, and display are a particular interest of mine considering my background in SQL Server design and programming. Granted, this project produces a tiny amount of data, but it is a first step in integrating a microprocessor board with online graphing. One of the great features of Cosm is that you can set triggers for events to happen based on your data. For instance, when the daylight value reaches 66% I could send a tweet announcing that it is daybreak in Philadelphia. Cosm also provides graph widgets for any public data stream on their site, such as the one below.

view on Cosm.com

 

Bing Bang Theory Compression Test

It turns out that the opening sequence of the Big Bang Theory is great for determining the amount of video compression applied to the channel on which its airing. The rapid-fire images prove tricky for most compresion algorithms used by cable tv, satellite and fiber. With no or very little compression, the images in the title sequence will flow smoothly. The more compressed the signal, the more pauses or stuttering you'll see. For instance, when viewing the opening on the local independent station over the air with an HD tuner, little to no compression is seen. However, when viewing the same opening on TBS (via Verizon fiber) the sequence noticeably pauses on two of the images. (Most often on the image below)

A difficult question to answer is where the offending compression is being introduced. It could be from the uplink/downlink of the TBS signal to the local cable company. Or it could be the local cable company itself compressing video to fit more channels on their system. Although the compression artifacts are fairly minimal, they could make some viewers wonder why the producers chose to dwell on certain images, thus creating meaning where none exists. In any case, the next time you watch the opening titles, keep an eye out for tell-tale compression artifacts.