Skip to content

Commit

Permalink
update with an ASCII depicted explaination
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jul 27, 2024
1 parent 3040333 commit b63d30d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
17 changes: 12 additions & 5 deletions autotune.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
17 changes: 17 additions & 0 deletions fec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit b63d30d

Please sign in to comment.