#!/bin/sh

# Example of a (2000,1000) LDPC code with 3 checks per bit and 6 bits per 
# check, tested on Additive White Gaussian Noise channels with noise standard 
# deviations varying from 0.80 to 0.95.
#
# Testing is done by transmitting zero blocks, which is sufficient because both
# the channel and the decoding procedure are symmetrical.  Decoding is done
# using a maximum of 100 iterations of probability propagation.

set -x -e # Echo commands as they are executed; stop if an error occurs

make-ldpc ldpc36-1000a.pchk 1000 2000 1 evenboth 3 no4cycle
make-gen  ldpc36-1000a.pchk ldpc36-1000a.gen dense
true
true NOISE STANDARD DEVIATION 0.80, Eb/N0 = 1.94 dB
true
transmit 2000x100 ldpc36-1000a.rec 1 awgn 0.80
decode   ldpc36-1000a.pchk ldpc36-1000a.rec ldpc36-1000a.dec awgn 0.80 prprp 250
verify   ldpc36-1000a.pchk ldpc36-1000a.dec ldpc36-1000a.gen 
true
true NOISE STANDARD DEVIATION 0.85, Eb/N0 = 1.41 dB
true
transmit 2000x100 ldpc36-1000a.rec 1 awgn 0.85
decode   ldpc36-1000a.pchk ldpc36-1000a.rec ldpc36-1000a.dec awgn 0.85 prprp 250
verify   ldpc36-1000a.pchk ldpc36-1000a.dec ldpc36-1000a.gen 
true
true NOISE STANDARD DEVIATION 0.90, Eb/N0 = 0.92 dB
true
transmit 2000x100 ldpc36-1000a.rec 1 awgn 0.90
decode   ldpc36-1000a.pchk ldpc36-1000a.rec ldpc36-1000a.dec awgn 0.90 prprp 250
verify   ldpc36-1000a.pchk ldpc36-1000a.dec ldpc36-1000a.gen 
true
true NOISE STANDARD DEVIATION 0.95, Eb/N0 = 0.45 dB
true
transmit 2000x100 ldpc36-1000a.rec 1 awgn 0.95
decode   ldpc36-1000a.pchk ldpc36-1000a.rec ldpc36-1000a.dec awgn 0.95 prprp 250
verify   ldpc36-1000a.pchk ldpc36-1000a.dec ldpc36-1000a.gen 
