Difference between revisions of "SDR: gr-ais Ubuntu 12.04"

From OnnoWiki
Jump to navigation Jump to search
(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 ...)
 
Line 1: Line 1:
 
Project Name
 
Project Name
  
Contributors: Nick Foster
+
Contributors: Nick Foster
 
+
External Site:  https://github.com/bistromath/gr-ais
External Site:  https://github.com/bistromath/gr-ais
+
Project Root:  https://github.com/bistromath/gr-ais
 
 
Project Root:  https://github.com/bistromath/gr-ais
 
  
 
GNU Radio Compatibility:
 
GNU Radio Compatibility:
Line 11: Line 9:
 
     Tested on GR 3.3svn, should work on earlier versions (?)  
 
     Tested on GR 3.3svn, should work on earlier versions (?)  
  
Quick Links:
 
 
    Project Description
 
    How To Install
 
    How To Run
 
  
 +
Project Description
  
Project Description
+
==The basics==
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.
 
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.
Line 26: Line 19:
  
 
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.
 
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
+
 
 +
==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.
 
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.

Revision as of 17:36, 19 October 2012

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 (?) 


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