Skip to content

Commit

Permalink
Rename for later protocols.
Browse files Browse the repository at this point in the history
  • Loading branch information
bemasher committed Jan 7, 2015
1 parent 03369d1 commit 11d5802
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions decode/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ type Decoder struct {
Signal []float64
Quantized []byte

csum []float64
lut MagnitudeLUT
csum []float64
demod Demodulator

preamble []byte
slices [][]byte
Expand All @@ -77,9 +77,9 @@ func NewDecoder(cfg PacketConfig, fastMag bool) (d Decoder) {

// Calculate magnitude lookup table specified by -fastmag flag.
if fastMag {
d.lut = NewAlphaMaxBetaMinLUT()
d.demod = NewAlphaMaxBetaMinLUT()
} else {
d.lut = NewSqrtMagLUT()
d.demod = NewSqrtMagLUT()
}

// Pre-calculate a byte-slice version of the preamble for searching.
Expand Down Expand Up @@ -121,7 +121,7 @@ func (d Decoder) Decode(input []byte) (pkts [][]byte) {
signalBlock := d.Signal[d.Cfg.PacketLength:]

// Compute the magnitude of the new block.
d.lut.Execute(iqBlock, signalBlock)
d.demod.Execute(iqBlock, signalBlock)

signalBlock = d.Signal[d.Cfg.PacketLength-d.Cfg.SymbolLength2:]

Expand Down Expand Up @@ -167,8 +167,8 @@ func (d Decoder) Decode(input []byte) (pkts [][]byte) {
return
}

// A MagnitudeLUT knows how to perform complex magnitude on a slice of IQ samples.
type MagnitudeLUT interface {
// A Demodulator knows how to demodulate an array of uint8 IQ samples into an array of float64 samples.
type Demodulator interface {
Execute([]byte, []float64)
}

Expand Down

0 comments on commit 11d5802

Please sign in to comment.