Difference between revisions of "Demod2"

From MyLabWiki
Jump to: navigation, search
(Top level applications)
(Examples)
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
The package contains a DSP lilbrary libdspfec.a and various utility programs for testing and demonstration purposes. The included Makefile will build the library and all executables.
 
The package contains a DSP lilbrary libdspfec.a and various utility programs for testing and demonstration purposes. The included Makefile will build the library and all executables.
 
  
 
=== Operational constraints ===
 
=== Operational constraints ===
  
 
# The reference implementation uses 48 ksps. For other sample rates the filter coefficients in nyquist.c must be reworked<ref>dpsk.h line 58-61</ref>. It is therefore easier to resample to 48 ksps.
 
# The reference implementation uses 48 ksps. For other sample rates the filter coefficients in nyquist.c must be reworked<ref>dpsk.h line 58-61</ref>. It is therefore easier to resample to 48 ksps.
 +
# The sample type is 16 bit linear PCM little-endian with range &plusmn;32767
  
 
== DSP library ==
 
== DSP library ==
Line 25: Line 25:
 
* Input: 500 bps arbitrary data; becomes 1000 symbols/sec with FEC (Since it is R=1/2 FEC, the HDLC framing code and CRC are part of the 500bps, i.e. 6 bytes / packet)
 
* Input: 500 bps arbitrary data; becomes 1000 symbols/sec with FEC (Since it is R=1/2 FEC, the HDLC framing code and CRC are part of the 500bps, i.e. 6 bytes / packet)
 
* Output: 48 kHz 16-bit linear PCM little-endian
 
* Output: 48 kHz 16-bit linear PCM little-endian
 
==== Examples ====
 
 
The following will take the data from input.dat, and output 48 ksps baseband that can be sent to audio:
 
 
  cat input.dat | ./mod > baseband.raw
 
  
 
=== demod ===
 
=== demod ===
Line 39: Line 33:
 
* Output: 500 bps data stream
 
* Output: 500 bps data stream
  
==== Examples ====
+
=== Examples ===
 +
 
 +
The following will take the data from input.dat, and output 48 ksps baseband that can be sent to audio:
 +
 
 +
  cat input.dat | ./mod > baseband.raw
  
 
The following will take the baseband data, demodulate and decode it:
 
The following will take the baseband data, demodulate and decode it:
  
 
   can baseband.raw | ./demod > output.dat
 
   can baseband.raw | ./demod > output.dat
 +
 +
We can also combine it into one command:
 +
 +
  cat input.dat | ./mod | ./demod > output.dat
 +
 +
input.dat and output.dat should be identical.
 +
 +
In case the cat command is not useful, e.g. because we call demod from a GUI and use pipes to connect we can use:
 +
 +
  ./demod < input.pipe > output.pipe
 +
 +
input.pipe would be the pipe for raw samples from the receiver (connected to the output of an USB demodulator at 48ksps) and output.pipe will contain the demodulated data. The same trick can be sued with mod.
  
 
== Utilities ==
 
== Utilities ==
  
 
=== addcw ===
 
=== addcw ===
 +
 +
Generates morse code signal and adds it to the input signal. See manual page for details.
  
 
=== addnoise ===
 
=== addnoise ===
 +
 +
Generates Gaussian noise and adds it to the input signal. See manual page for details.
  
 
=== async_hdlc_decode ===
 
=== async_hdlc_decode ===
Line 62: Line 76:
  
 
=== meter ===
 
=== meter ===
 
 
  
 
== Test programs ==
 
== Test programs ==

Latest revision as of 23:01, 12 August 2011

Some random notes about the reference BPSK-1000 reference modem for ARISSat-1 by Phil Karn, KA9Q.


Overview

The package contains a DSP lilbrary libdspfec.a and various utility programs for testing and demonstration purposes. The included Makefile will build the library and all executables.

Operational constraints

  1. The reference implementation uses 48 ksps. For other sample rates the filter coefficients in nyquist.c must be reworked[1]. It is therefore easier to resample to 48 ksps.
  2. The sample type is 16 bit linear PCM little-endian with range ±32767

DSP library

libdspfec.a and dsfec.h

Top level applications

mod

Complete encoder and modulator.

Takes arbitrary data stream as input (LSB first according to HDLC standard), applies CRC and FEC, and outputs modulated baseband.

  • Input: 500 bps arbitrary data; becomes 1000 symbols/sec with FEC (Since it is R=1/2 FEC, the HDLC framing code and CRC are part of the 500bps, i.e. 6 bytes / packet)
  • Output: 48 kHz 16-bit linear PCM little-endian

demod

Complete demodulator and decoder.

  • Input: 48 kHz 16-bit linear PCM little-endian
  • Output: 500 bps data stream

Examples

The following will take the data from input.dat, and output 48 ksps baseband that can be sent to audio:

 cat input.dat | ./mod > baseband.raw

The following will take the baseband data, demodulate and decode it:

 can baseband.raw | ./demod > output.dat

We can also combine it into one command:

 cat input.dat | ./mod | ./demod > output.dat

input.dat and output.dat should be identical.

In case the cat command is not useful, e.g. because we call demod from a GUI and use pipes to connect we can use:

 ./demod < input.pipe > output.pipe

input.pipe would be the pipe for raw samples from the receiver (connected to the output of an USB demodulator at 48ksps) and output.pipe will contain the demodulated data. The same trick can be sued with mod.

Utilities

addcw

Generates morse code signal and adds it to the input signal. See manual page for details.

addnoise

Generates Gaussian noise and adds it to the input signal. See manual page for details.

async_hdlc_decode

bplay

byteorder

dist

gentestdata

meter

Test programs

dotprod_test

pack_unpack_test

parity_test

peak_test

rand_test

sq_test

sub_test

viterbi27_streamtest

viterbi27_test

References

  1. dpsk.h line 58-61