Skip to content
This repository has been archived by the owner. It is now read-only.
see jj1bdx/airspy-fmradion // NGSoftFM is a command line software decoder for FM broadcast radio with stereo support (forked)
C++ CMake Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
include Embed EqParams inside FmDecoder::FmDecoder Feb 24, 2019
rxtest Add rxtest/*.png Mar 1, 2019
sfmbase
.clang-format Add .clang-format Jan 15, 2019
.gitignore Revise .gitignore Jan 15, 2019
CMakeLists.txt CMakeLists.txt: add more compilation options Jan 28, 2019
LICENSE Add GPLv3 license Jan 15, 2019
README.md README.md: announce migration to jj1bdx/airspy-fmradion Mar 12, 2019
main.cpp Version 0.1.14 Feb 24, 2019

README.md

ngsoftfm-jj1bdx

This repository is archived. See airspy-fmradion for the further development.

  • Version 0.1.14, 24-FEB-2019
  • Software decoder for FM broadcast radio with RTL-SDR, AirSpy, and HackRF
  • For MacOS and Linux
  • This repository is forked from NGSoftFM
  • Code merged from softfm-jj1bdx
  • Note: F4EXB no longer maintains this code.

Usage examples

For RTL-SDR:

ngsoftfm -q -t rtlsdr \
    -c freq=88100000,gain=14.4 -r 48000 \
    -b 0.5 -R - | \
    play -t raw -esigned-integer -b16 -r 48000 -c 2 -q -

For Airspy:

ngsoftfm -q -t airspy \
    -c freq=88100000,srate=2500000,mgain=14,lgain=14,vgain=1 \
    -b 0.5 -R - | \
    play -t raw -esigned-integer -b16 -r 48000 -c 2 -q -

Introduction

ngsoftfm-jj1bdx is a software-defined radio receiver for FM broadcast radio. It is a derivative work of SoftFM and NGSoftFM with a new application design and new features.

Hardware supported

  • RTL-SDR based (RTL2832-based) hardware is supported and uses the librtlsdr library to interface with the RTL-SDR hardware.
  • HackRF One and variants are supported with libhackrf library.
  • Airspy is supported with libairspy library.

Purposes of ngsoftfm-jj1bdx

Experimenting with digital signal processing and software radio while listening to my favorite radio station. ngsoftfm-jj1bdx actually produces pretty good stereo sound when receiving a strong radio station. :)

ngsoftfm-jj1bdx provides

  • mono or stereo decoding of FM broadcasting stations
  • buffered real-time playback to soundcard or dumping to file
  • command-line interface (only)

ngsoftfm-jj1bdx requires

  • Linux / macOS
  • C++11 (gcc, clang/llvm)
  • RTL-SDR library
  • HackRF library
  • Airspy library
  • sox
  • supported RTL-SDR DVB-T receiver, Airspy, or HackRF Rx/Tx
  • medium-fast computer for RTL-SDR, faster computer for Airspy and HackRF
  • medium-strong FM radio signal. However the R820T2 based dongles give better results than the former R820T based dongles. HackRF, or Airspy are usually even better but you have to spend more for the devices.

For the latest version, see https://github.com/jj1bdx/ngsoftfm-jj1bdx

Branches and tags

  • Official releases are tagged
  • master is the "production" branch with the most stable release (often ahead of the latest release though)
  • dev is the development branch that contains current developments that will be eventually released in the master branch
  • Other branches are experimental (and abandoned)

Prerequisites

Base requirements

  • sudo apt-get install cmake pkg-config libusb-1.0-0-dev libasound2-dev libboost-all-dev

RTL-SDR support

The Osmocom RTL-SDR library must be installed before you can build ngsoftfm-jj1bdx. See http://sdr.osmocom.org/trac/wiki/rtl-sdr for more information. ngsoftfm-jj1bdx has been tested successfully with RTL-SDR 0.5.3. Normally your distribution should provide the appropriate librtlsdr package. If you go with your own installation of librtlsdr you have to specify the include path and library path. For example if you installed it in /opt/install/librtlsdr you have to add -DRTLSDR_INCLUDE_DIR=/opt/install/librtlsdr/include -DRTLSDR_LIBRARY=/opt/install/librtlsdr/lib/librtlsdr.a to the cmake options

To install the library from a Debian/Ubuntu installation just do:

  • sudo apt-get install librtlsdr-dev

HackRF support

For now HackRF support must be installed even if no HackRF device is connected.

If you install from source (https://github.com/mossmann/hackrf/tree/master/host/libhackrf) in your own installation path you have to specify the include path and library path. For example if you installed it in /opt/install/libhackrf you have to add -DHACKRF_INCLUDE_DIR=/opt/install/libhackrf/include -DHACKRF_LIBRARY=/opt/install/libhackrf/lib/libhackrf.a to the cmake options.

To install the library from a Debian/Ubuntu installation just do:

  • sudo apt-get install libhackrf-dev

Airspy support

For now Airspy support must be installed even if no Airspy device is connected.

If you install from source (https://github.com/airspy/host/tree/master/libairspy) in your own installation path you have to specify the include path and library path. For example if you installed it in /opt/install/libairspy you have to add -DAIRSPY_INCLUDE_DIR=/opt/install/libairspy/include -DHACKRF_LIBRARY=/opt/install/libairspy/lib/libairspy.a to the cmake options.

To install the library from a Debian/Ubuntu installation just do:

  • sudo apt-get install libairspy-dev

macOS

  • Install HomeBrew rtl-sdr, hackrf, airspy

Installing

To install ngsoftfm-jj1bdx, download and unpack the source code and go to the top level directory. Then do like this:

  • mkdir build
  • cd build
  • cmake ..

CMake tries to find librtlsdr. If this fails, you need to specify the location of the library in one the following ways:

  • cmake .. -DRTLSDR_INCLUDE_DIR=/path/rtlsdr/include -DRTLSDR_LIBRARY_PATH=/path/rtlsdr/lib/librtlsdr.a
  • PKG_CONFIG_PATH=/path/to/rtlsdr/lib/pkgconfig cmake ..

Compile and install

  • make -j8 (for machines with 8 CPUs)
  • make install

Basic command options

  • -t devtype is mandatory and must be rtlsdr for RTL-SDR devices or hackrf for HackRF.
  • -c config Comma separated list of configuration options as key=value pairs or just key for switches. Depends on device type (see next paragraph).
  • -d devidx Device index, 'list' to show device list (default 0)
  • -r pcmrate Audio sample rate in Hz (default 48000 Hz)
  • -M Disable stereo decoding
  • -R filename Write audio data as raw S16_LE samples. Uuse filename - to write to stdout
  • -W filename Write audio data to .WAV file
  • -P [device] Play audio via ALSA device (default default). Use aplay -L to get the list of devices for your system
  • -T filename Write pulse-per-second timestamps. Use filename '-' to write to stdout
  • -b seconds Set audio buffer size in seconds
  • -X Shift pilot phase (for Quadrature Multipath Monitor) (-X is ignored under mono mode (-M))
  • -U Set deemphasis to 75 microseconds (default: 50)

Modification by @jj1bdx

See doc/NOTES-jj1bdx.md for the details of the modification.

  • Remove 19kHz pilot signal when the stereo PLL is locked
  • Add equalizer to compensate 0th-hold aperture effect of phase discriminator output
  • The compensation equalizer output parameters are pre-calculated and interpolated from 200kHz ~ 10MHz sampling rates
  • Increase the number of FineTuner table size from 64 to 256
  • Add quiet mode -q
  • Add option -X for Quadratic Multipath Monitor (QMM) (This option is not effective in monaural mode (-M option))
  • Add option -U to set deemphasis timing to 75 microseconds for North America (default: 50 microseconds for Europe/Japan)

Features remaining same as the original NGSoftFM

  • IF bandwidth: 200kHz (+-100kHz)
  • Default sample rate for RTL-SDR: 1000kHz

Device type specific configuration options

RTL-SDR

  • freq=<int> Desired tune frequency in Hz. Accepted range from 10M to 2.2G. (default 100M: 100000000)
  • gain=<x> (default auto)
    • auto Selects gain automatically
    • list Lists available gains and exit
    • <float> gain in dB. Possible gains in dB are: 0.0, 0.9, 1.4, 2.7, 3.7, 7.7, 8.7, 12.5, 14.4, 15.7, 16.6, 19.7, 20.7, 22.9, 25.4, 28.0, 29.7, 32.8, 33.8, 36.4, 37.2, 38.6, 40.2, 42.1, 43.4, 43.9, 44.5, 48.0, 49.6
  • srate=<int> Device sample rate. valid values in the [225001, 300000], [900001, 3200000] ranges. (default 1000000)
  • blklen=<int> Device block length in bytes (default RTL-SDR default i.e. 64k)
  • agc Activates device AGC (default off)

Airspy

  • freq=<int> Desired tune frequency in Hz. Valid range from 1M to 1.8G. (default 100M: 100000000)
  • srate=<int> Device sample rate. list lists valid values and exits. (default 10000000). Valid values depend on the Airspy firmware. Airspy firmware and library must support dynamic sample rate query.
  • lgain=<x> LNA gain in dB. Valid values are: 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10, 11 12, 13, 14, list. list lists valid values and exits. (default 8)
  • mgain=<x> Mixer gain in dB. Valid values are: 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10, 11 12, 13, 14, 15, list. list lists valid values and exits. (default 8)
  • vgain=<x> VGA gain in dB. Valid values are: 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10, 11 12, 13, 14, 15, list. list lists valid values and exits. (default 0)
  • antbias Turn on the antenna bias for remote LNA (default off)
  • lagc Turn on the LNA AGC (default off)
  • magc Turn on the mixer AGC (default off)

HackRF

(Note: @jj1bdx hasn't tested HackRF yet)

  • freq=<int> Desired tune frequency in Hz. Valid range from 1M to 6G. (default 100M: 100000000)
  • srate=<int> Device sample rate (default 5000000). Valid values from 1M to 20M. In fact rates lower than 10M are not specified in the datasheets of the ADC chip however a rate of 1000000 (1M) still works well with NGSoftFM.
  • lgain=<x> LNA gain in dB. Valid values are: 0, 8, 16, 24, 32, 40, list. list lists valid values and exits. (default 16)
  • vgain=<x> VGA gain in dB. Valid values are: 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, list. list lists valid values and exits. (default 22)
  • bwfilter=<x> RF (IF) filter bandwith in MHz. Actual value is taken as the closest to the following values: 1.75, 2.5, 3.5, 5, 5.5, 6, 7, 8, 9, 10, 12, 14, 15, 20, 24, 28, list. list lists valid values and exits. (default 2.5)
  • extamp Turn on the extra amplifier (default off)
  • antbias Turn on the antenna bias for remote LNA (default off)

Authors

  • Joris van Rantwijk
  • Edouard Griffiths, F4EXB
  • Kenji Rikitake, JJ1BDX

Acknowledgments

  • András Retzler, HA7ILM

License

  • As a whole package: GPLv3 (and later). See LICENSE.
  • Some source code files are stating GPL "v2 and later" license.
You can’t perform that action at this time.