Exemplo n.º 1
0
func NewParser(symbolLength, decimation int, fastMag bool) (p Parser) {
	p.Decoder = decode.NewDecoder(NewPacketConfig(symbolLength), decimation, fastMag)

	// GF of order 32, polynomial 37, generator 2.
	p.field = gf.NewField(32, 37, 2)

	p.csum = make([]float64, p.Decoder.DecCfg.BufferLength+1)
	p.filtered = make([][3]float64, p.Decoder.DecCfg.BufferLength)
	p.quantized = make([]byte, p.Decoder.DecCfg.BufferLength)

	return
}
Exemplo n.º 2
0
Arquivo: r900.go Projeto: thess/rtlamr
func NewParser(chipLength, decimation int) parse.Parser {
	p := new(Parser)

	p.Decoder = decode.NewDecoder(NewPacketConfig(chipLength), decimation)

	// GF of order 32, polynomial 37, generator 2.
	p.field = gf.NewField(32, 37, 2)

	p.signal = make([]float64, p.Decoder.DecCfg.BufferLength)
	p.csum = make([]float64, p.Decoder.DecCfg.BufferLength+1)
	p.filtered = make([][3]float64, p.Decoder.DecCfg.BufferLength)
	p.quantized = make([]byte, p.Decoder.DecCfg.BufferLength)

	return p
}