From XastirWiki
Jump to: navigation, search

Setting FM transmitter deviation using an RTL SDR dongle

The only hardware requirements are an RTL SDR dongle and a Linux box. Linux S/W controls the RTL SDR dongle to put it on frequency and receive the signal. The S/W measures the deviation, reporting in real-time. We use the "Tone dev" numbers that are output, i.e.:

 At 5 kHz deviation: Tone dev=4798.43  Full bw dev=4804.34  Carrier freq err=21.46(1ppm)
 At 4 kHz deviation: Tone dev=3841.88  Full bw dev=3850.28  Carrier freq err=21.39(1ppm)
 At 3 kHz deviation: Tone dev=2888.23  Full bw dev=2898.49  Carrier freq err=21.31(1ppm)
 At 2 kHz deviation: Tone dev=1927.62  Full bw dev=1941.84  Carrier freq err=21.32(1ppm)
 At 1 kHz deviation: Tone dev= 964.27  Full bw dev= 991.88  Carrier freq err=21.25(1ppm)


You'll need:

  • An RTL USB software-defined radio. These are typically between $10 and $25. The TCXO versions are much recommended. Look for R820T2 and TCXO in the description when buying. See the #References section below for one example of an RTL SDR dongle to buy.
  • A radio/APRS modem combo that will be used together, properly wired (the setup you're tuning up)
  • An antenna or dummy load on said radio
  • Control over the APRS modem to command it to send an individual constant tone for testing
  • To install a few packages on your Linux machine. Instructions for that are listed below

The general method is:

  • Specify in the config file the radio transmit frequency you'll use for testing (i.e. "144390000")
  • Start up software on the Linux box to measure deviation, specifying on the command-line the audio tone you'll be injecting (i.e. "1200" or "2200" Hz)
  • Key up the transmitter, injecting the tone you specified above
  • Adjust the modem's audio level to get the desired deviation from the radio

The procedure has been validated using real test equipment (a signal generated from a Wavetek signal generator).

Installation of Linux software

To get started, make sure you have "git", "make", "cmake", and "gcc-c++" packages installed, then:

Install rtl-sdr package:

  Pre-compiled package may be available for your Linux, else:
    http://sdr.osmocom.org/trac/wiki/rtl-sdr
    $ git clone http://git.osmocom.org/rtl-sdr
    Build it (read the docs/wiki, details not documented here)

Download/compile svxlink. Installation instructions are here, however this is what I did to compile it (Note: I didn't install it):

  $ git clone https://github.com/sm0svx/svxlink
  $ cd svxlink/src
  $ mkdir -p build
  $ cd build
  $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc -DLOCAL_STATE_DIR=/var ..
  $ make

Most likely you'll have to install additional packages at the "cmake" stage above. You'll need the "dev" or "-devel" packages associated with those packages as well. I had to install "g++", "libsigc++2-devel", "speex-devel", "libqt4-devel", "popt-devel", "libgcrypt-devel", "tcl-devel", "libasync", "libasync-dev", and "libgsm-devel" on SUSE Linux.

Man pages:

http://www.svxlink.org/doc/man/man1/devcal.1.html
http://www.svxlink.org/doc/man/man5/svxlink.conf.5.html

Configuration

Create two sections at the end of the svxlink.conf file (~/src/svxlink/src/build/svxlink/svxlink/svxlink.conf in the below example):

 [APRS]
 TYPE=Ddr
 FQ=144390000
 MODULATION=FM
 WBRX=WbRx
 [WbRx]
 TYPE=RtlTcp
 DEV_MATCH=0
 HOST=localhost
 PORT=1234
 FQ_CORR=0
 GAIN=0
 SAMPLE_RATE=960000

If you're using a TCXO RTL dongle you don't need to calibrate it to accomplish the short procedure below. If you're NOT using a TCXO version you'll need to run through the calibration procedure listed in the "CALIBRATING AN RTL2832U BASED DVB-T USB DONGLE" section of the DEVCAL manpage, set the "FQ_CORR" configuration variable as specified there, then continue with the procedure below.


Measuring Deviation

  • In one xterm window, start up the rtl_tcp daemon:
 ~/src/rtl-sdr/build/src/rtl_tcp
  • In a second xterm window:

Measure deviation on the APRS frequency with a 1200Hz tone being sent into the transmitter:

 ~/src/svxlink/src/build/bin/devcal -M -f1200 ~/src/svxlink/src/build/svxlink/svxlink/svxlink.conf APRS

-or- measure deviation on the APRS frequency with a 2200Hz tone being sent into the transmitter:

 ~/src/svxlink/src/build/bin/devcal -M -f2200 ~/src/svxlink/src/build/svxlink/svxlink/svxlink.conf APRS
  • Cause the TNC/modem to transmit and emit just one of its tones (must match the tone given on the command-line above).
  • Adjust the audio level out of the modem until the "tone dev" value matches what you wish for deviation. Note that this will match up one PAIR of radio/modem. If you change out the radio or the modem, the measurement/adjustment must be repeated for the new coupled pair.

Typical target deviation for a 1200 baud AFSK modem coupled with an FM transmitter would be 3 to 4 kHz.

For a 9600 baud modem you'll need to be around 3 or 3.25 kHz deviation and tap into the decriminator and varactor directly, instead of using speaker and mic connections.

References

A Youtube video showing another method (may work for Windows folks): Measuring Frequency Deviation of an FM Transmitter With an RTL-SDR

More links that may be of interest:

Understanding FM deviation, Modulation Index and Sideband theory with an RTL-SDR Dongle

discuss-gnuradio:Measure FM frequency deviation

Video: HB9UF: FM deviation, modulation index and sidebands with an RTL SDR dongle

mweyland/fm_experiments.grc, a gnuradio pipeline

John Ackermann's excellent page on setting deviation

The RTL SDR's I bought