Portability | unknown |
---|---|
Maintainer | tomahawkins@gmail.com |
Safe Haskell | Safe-Inferred |
Fountain codes are forward error correction codes for erasure channels. They are able to recover lost packets without needing a backchannel. As a rateless code, transmitters generate packets at random, on the fly. Receivers then listen to as many packets as needed to reconstruct the message.
- data Droplet a = Droplet IntSet a
- data Decoder a
- type Precoding = [IntSet]
- precoding :: Int -> Int -> Int -> (Int, Int) -> Precoding
- droplets :: (Num a, Bits a) => Int -> Int -> Precoding -> [a] -> [Droplet a]
- decoder :: (Num a, Bits a) => Int -> Precoding -> Decoder a
- decode :: (Num a, Bits a) => Decoder a -> Droplet a -> (Decoder a, Maybe [a])
- test :: Int -> Int -> Precoding -> Int -> (Int, Bool, [Decoder Word8])
- test' :: Int -> Int -> Int -> (Int, Int) -> Int -> (Int, Bool, [Decoder Word8])
- decoderProgress :: Decoder a -> String
Datatypes
A message droplet is a set of message indices and the combined symbol.
Functions
precoding :: Int -> Int -> Int -> (Int, Int) -> PrecodingSource
Generates a random precoding matrix.
precoding seed messageLength extraSymbols boundaries
droplets :: (Num a, Bits a) => Int -> Int -> Precoding -> [a] -> [Droplet a]Source
An infinite list of droplets, given a seed, the max degree, precoding, and a message.
decoder :: (Num a, Bits a) => Int -> Precoding -> Decoder aSource
Creates a new decoder given a message length and the precoding.
Test
test :: Int -> Int -> Precoding -> Int -> (Int, Bool, [Decoder Word8])Source
Runs a test of a [Word8] message given the message length, max droplet degree, and a seed. Returns the number of droplets that were needed to decode the message and if the message was sucessfully decoded.
test' :: Int -> Int -> Int -> (Int, Int) -> Int -> (Int, Bool, [Decoder Word8])Source
Runs a test with a randomly generated precoding.
test' messageLength dropletMaxDegree extraSymbols (precodingMinDegree, precodingMaxDegree) seed
decoderProgress :: Decoder a -> StringSource
A visual of Decoder
progress.