SDR: gr-ais Ubuntu 12.04

From OnnoWiki
Revision as of 17:35, 19 October 2012 by Onnowpurbo (talk | contribs) (New page: Project Name Contributors: Nick Foster External Site: https://github.com/bistromath/gr-ais Project Root: https://github.com/bistromath/gr-ais GNU Radio Compatibility: Tested on ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Project Name

Contributors: Nick Foster

External Site: https://github.com/bistromath/gr-ais

Project Root: https://github.com/bistromath/gr-ais

GNU Radio Compatibility:

   Tested on GR 3.3svn, should work on earlier versions (?) 

Quick Links:

   Project Description
   How To Install
   How To Run 


Project Description The basics

This module implements an AIS receiver for GnuRadio?. AIS is the Automatic Identification System, a protocol designed to facilitate safety at sea by broadcasting ship data such as speed, heading, rate of turn, tonnage, draft, ship name, destination, etc. Ships of more than 65 feet in length or 150 tons in weight are required by Federal law to utilize an AIS transceiver, so in densely-populated ports you will receive quite a bit of traffic.

The module outputs processed NMEA 0183 frames, designed to interface with any standard NMEA receiver. For a free Linux implementation, see ESR's gpsd program ( http://gpsd.berlios.de/), specifically the program ais.py included with the gpsd source distribution. The output of ais.py can be further parsed, to KML for instance, for a map implementation. If I had the first idea how to work the Google Maps API, I might try it myself. If you're into that sort of thing, please, pick up the baton, I'd really like to have a map interface. =)

There's also a TCP server option (--tcp) to pipe the data around the net, or to interface locally to gpsd. It comes up on port 9987. Technical details

AIS is a GMSK modulated packet broadcast at 9600bps on two channels: the A channel is 161.975MHz, and the B channel is 162.025MHz. The packets contain either 168 or 440 bits of information and are prefaced with a preamble and suffixed with a checksum. Packets are bit-stuffed to ensure timely bit transitions for clock recovery and that the HDLC frame markers are unambiguous, and then NRZI-encoded.

The receiver uses a quadrature demodulator followed by a low-pass filter to demodulate the signal. A frequency estimator based on the square-and-fft method is used to ensure the signal lies at baseband. The demodulated signal is passed to a M&M clock recovery module. From there, a modified decision-feedback estimator attempts to correct ISI caused by the GMSK modulation and channel distortion. The DFE is based on the gr.lms_dfe block included in GR, but with a reset input designed to accept a correlator output which is keyed to the training sequence. The DFE then resets its taps and runs through the first 150 bits of the packet 12 times, training the DFE for the channel. It then runs through the packet with the trained taps and outputs the ISI-corrected soft data, which then gets sliced. (NB: this is not the best way to go about this, but it works). The sliced data is differentially-decoded and inverted to decode the NRZI encoding.

Two receivers are instantiated in ais_decode.py, one for each channel, by tuning the receiver to the center of both channels (162.000MHz) and using frequency-xlating filters to shift either channel to baseband. Future improvements

If you're really good at this sort of thing, the optimal receiver for GMSK is a coherent demodulator using the Viterbi algorithm on a combined trellis. The gr-trellis module by Achilleas Anastasopolous includes basically everything necessary to do this except carrier synchronization and a reset input. The -v option currently instantiates the decoder using Rimoldi's CPFSK decomposition method, but without initial carrier phase estimation and a Viterbi decoder reset input, it hardly receives anything. It does work spectacularly well on phase- and packet-aligned data, such as a generated signal source. Suggestions welcome!

I'd love comments, feedback, or suggestions for improvement. How To Install

This project follows the gr-howto-write-a-block scheme.

./bootstrap
./configure
make
sudo make install

How To Run

cd src/python ./ais_rx.py -g 60

You might have to specify UHD address and subdev options, depending on your setup.

You can also use a -F <filename> option to make the decoder receive recorded data.


Referensi

Pranala Menarik