Input from file and stdin¶
Reading from STDIN¶
AIS-catcher can read input in two ways using the -r switch: from a file by specifying a filename, or from standard input by using either a dot (.) or stdin as the argument:
AIS-catcher -r .
Pipeline example¶
AIS-catcher can be integrated into command-line processing pipelines for real-time signal processing. For example, you can capture radio signals using rtl_sdr and pipe them directly to AIS-catcher for decoding:
rtl_sdr -s 288K -f 162M - | AIS-catcher -r . -s 288K -v
sox. Here's an example of downsampling a signal before processing:
sox -c 2 -r 1536000 -b 8 -e unsigned -t raw posterholt.raw -t raw -b 16 -e signed -r 96000 - |AIS-catcher -s 96K -r CS16 . -v
As of version 0.36, AIS-catcher includes built-in sox functionality (if compiled with this feature), allowing for built-in usage of sox:
bash AIS-catcher -s 1536K -r CU8 posterholt.raw -v -go SOXR on
By default, AIS-catcher expects input files to be in raw unsigned 8-bit IQ format (CU8). You can specify other formats using the FORMAT setting.
NMEA0183 input from file¶
For a text file with NMEA input, we can use:
AIS-catcher -r txt nmea-file
AIS-catcher -r -ga FORMAT txt file nmea-file
Summary Settings¶
| Setting (JSON key / CLI setting name) | Type | Default | Description |
|---|---|---|---|
| Generic Options | |||
| sample_rate | integer | 1536K | Sampling rate in Hz (0-20,000,000) |
| bandwidth | integer | 0 | Tuner bandwidth in Hz (0-1,000,000), 0 = off |
| freqoffset | integer | 0 | Frequency correction in PPM (-150 to +150) |
| format | string | CU8 | Data type for input source |
| Specific Options | |||
| file | string | - | Input file path or "stdin" for standard input |
| loop | boolean | false | Enable continuous file looping |
| lossless | boolean | true | When reading from a file you usually want every sample decoded, not realtime playback. With lossless on (the default) the reader pauses if the decoder is briefly slower than the file, so nothing is lost. Set to false to mimic a live source and drop samples on overflow. |
| txt_block_size | integer | 2048 | Read block size in bytes when format is TXT (1-16384) |