Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

nrsc5

> 编程语言
Open source

NRSC-5 receiver for rtl-sdr

962 stars0 likes1 views
WebsiteGitHub

About

NRSC-5 receiver for rtl-sdr

nrsc5

This program receives NRSC-5 digital radio stations using an RTL-SDR dongle, or by reading from I/Q files. It offers a command-line interface as well as an API upon which other applications can be built. Before using it, you'll first need to compile the program using the build instructions below.

Building on Ubuntu, Debian or Raspbian

bash
sudo apt install git build-essential cmake autoconf libtool libao-dev libfftw3-dev librtlsdr-dev
git clone https://github.com/theori-io/nrsc5.git
cd nrsc5
mkdir build
cd build
cmake [options] ..
make
sudo make install
sudo ldconfig

Available build options:

-DUSE_NEON=ON            Use NEON instructions. [ARM, default=OFF]
-DUSE_SSE=ON             Use SSSE3 instructions. [x86, default=OFF]
-DUSE_FAAD2=ON           AAC decoding with FAAD2. [default=ON]
-DLIBRARY_DEBUG_LEVEL=1  Debug logging level for libnrsc5. [default=5]
-DBUILD_DOC=ON           Generate html API documentation [default=OFF]

You can test the program using the included sample capture:

bash
xz -d  /tmp/nrsc5.rb
brew install --HEAD -s /tmp/nrsc5.rb

Building for Windows

To build the program for Windows, you can either use MSYS2 on Windows, or else use a cross-compiler on an Ubuntu, Debian or macOS machine. Scripts are provided to help with both cases.

Building on Windows with MSYS2

Install MSYS2. Open a terminal using the "MSYS2 MinGW 64-bit" shortcut. (Or use the 32-bit shortcut if you prefer a 32-bit build.)

pacman -Syu

If this is the first time running pacman, you will be told to close the terminal window. After doing so, reopen using the same shortcut as before.

bash
pacman -Su
pacman -S git
git clone https://github.com/theori-io/nrsc5.git
nrsc5/support/msys2-build -j4

You can test your installation using the included sample file:

cd ~/nrsc5/support
xz -d sample.xz
nrsc5.exe -r sample 0

If the sample file does not work, make sure you followed all of the instructions. If it still doesn't work, file an issue with the error message. Please put "[Windows]" in the title of the issue.

Once everything is built, you can run nrsc5 independently of MSYS2. Copy the following files from your MSYS2 mingw64 (or mingw32) directory (e.g. C:\msys64\mingw64\bin):

  • libnrsc5.dll
  • nrsc5.exe

Cross-compiling for Windows from Ubuntu / Debian

bash
sudo apt install cmake autoconf libtool pkgconf git mingw-w64
git clone https://github.com/theori-io/nrsc5.git
cd nrsc5
support/win-cross-compile 64 --cmake-args="-DUSE_SSE=ON" -j4

Replace 64 with 32 if you want a 32-bit build. Once the build is complete, copy *.dll and nrsc5.exe from the build-win64/bin (or build-win32/bin) folder to your Windows machine.

Cross-compiling for Windows from macOS

bash
brew install cmake autoconf automake libtool pkgconf git mingw-w64
git clone https://github.com/theori-io/nrsc5.git
cd nrsc5
support/win-cross-compile 64 --cmake-args="-DUSE_SSE=ON" -j4

Replace 64 with 32 if you want a 32-bit build. Once the build is complete, copy *.dll and nrsc5.exe from the build-win64/bin (or build-win32/bin) folder to your Windows machine.

Usage

Command-line options:

frequency                            center frequency in MHz or Hz
                                       (do not provide frequency when reading from file)
program                              audio program to decode
                                       (0, 1, 2, or 3)
-g gain                              gain
                                       (example: 49.6)
                                       (automatic gain selection if not specified)
-d device-index                      rtl-sdr device
-p ppm-error                         rtl-sdr ppm error
-H rtltcp-host                       rtl_tcp host with optional port
                                       (example: localhost:1234)
-r iq-input                          read IQ samples from input file
--iq-input-format {cu8,cs16,cf32}      IQ input format (complex unsigned 8-bit @ 1488375 SPS,
                                       complex signed 16-bit @ 744188 SPS (FM) / 46512 SPS (AM) or
                                       complex float 32-bit @ 744188 SPS (FM) / 46512 SPS (AM).
                                       default is cu8.)
-w iq-output                         write IQ samples to output file
-o audio-output                      write audio to output file
-t audio-type                        type of audio output (wav or raw)
                                       (default is wav. used in conjunction with -o)
-q                                   disable log output
-l log-level                         set log level
                                       (1 = DEBUG, 2 = INFO, 3 = WARN)
-v                                   print the version number and exit
--am                                 receive AM signals
                                       (default is FM)
-T                                   enable bias-T
-D direct-sampling-mode              enable direct sampling
                                       (1 = I-ADC input, 2 = Q-ADC input)
--dump-aas-files dir-name            dump AAS files
                                       (WARNING: insecure)
--dump-hdc file-name                 dump HDC packets

Examples:

Tune to 107.1 MHz and play audio program 0:

nrsc5 107.1 0

Tune to 107.1 MHz and play audio program 0. Manually set gain to 49.0 dB and save raw IQ samples to a file:

nrsc5 -g 49.0 -w samples1071 107.1 0

Read raw IQ samples from a file and play back audio program 0:

nrsc5 -r samples1071 0

Tune to 90.5 MHz and convert audio program 0 to WAV format for playback in an external media player:

nrsc5 -o - 90.5 0 | mplayer -

Keyboard commands:

To switch between audio programs at runtime, press 0 through 7.

To quit, press Q.

RTL-SDR drivers on Windows

If you get errors trying to access your RTL-SDR device, then you may need to use Zadig to change the USB driver. Once you download and run Zadig, select your RTL-SDR device, ensure the driver is set to WinUSB, and then click "Replace Driver". If your device is not listed, enable "Options" -> "List All Devices".

Application Programming Interface (API)

If you would like to build an application that makes use of nrsc5's functionality, you can use the C API (documentation) or Python API. The nrsc5 command-line application is built on top of the C API, and an equivalent Python command-line application is built on top of the Python API. These applications serve as examples of how to use the API.

Note: When using the Python API or the Python command-line application on Windows, place libnrsc5.dll in the same folder as nrsc5.py.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言