diff --git a/autotune.go b/autotune.go index f5d25ddc..b18e8a29 100644 --- a/autotune.go +++ b/autotune.go @@ -43,11 +43,18 @@ func (tune *autoTune) Sample(bit bool, seq uint32) { // Find a period for a given signal // returns -1 if not found // -// --- ------ -// | | -// |______________| -// Period -// Falling Edge Rising Edge +// +// Signal Level +// | +// 1.0 | _____ _____ +// | | | | | +// 0.5 | _____ | | _____ | | _____ +// | | | | | | || | | | +// 0.0 __|_____| |____| |__| || |__| |_____ +// | +// |-----------------------------------------------------> Time +// A B C D E F G H I + func (tune *autoTune) FindPeriod(bit bool) int { // last pulse and initial index setup lastPulse := tune.pulses[0] diff --git a/fec.go b/fec.go index 3437d563..b382d38a 100644 --- a/fec.go +++ b/fec.go @@ -20,6 +20,23 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +// THE GENERALIZED REED-SOLOMON FEC SCHEME +// +// Encoding: +// ----------- +// Message: | M1 | M2 | M3 | M4 | +// Generate Parity: | P1 | P2 | +// Encoded Codeword:| M1 | M2 | M3 | M4 | P1 | P2 | +// +// Decoding with Erasures: +// ------------------------ +// Received: | M1 | ?? | M3 | M4 | P1 | ?? | +// Erasures: | | E1 | | | | E2 | +// Syndromes: S1, S2, ... +// Error Locator: Λ(x) = ... +// Correct Erasures:Determine values for E1 (M2) and E2 (P2). +// Corrected: | M1 | M2 | M3 | M4 | P1 | P2 | + package kcp import (