Skip to content

Commit

Permalink
Correct filter benchmark. Remove symbol length test.
Browse files Browse the repository at this point in the history
  • Loading branch information
bemasher committed May 20, 2018
1 parent 4be127c commit d4b9855
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions decode/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@ func NewPacketConfig(chipLength int) (cfg PacketConfig) {
return
}

func TestSymbolLength(t *testing.T) {
for idx := 7; idx <= 72; idx++ {
d := NewDecoder(NewPacketConfig(idx))
pLen := d.Cfg.BlockSize + d.Cfg.PreambleLength
t.Logf("%d: %d/8 = %0.2f (%d)\n", idx, pLen, float64(pLen)/8.0, len(d.packed))

block := make([]byte, d.Cfg.BlockSize2)
d.Decode(block)
d.Decode(block)
d.Decode(block)
d.Decode(block)
}
}

func BenchmarkMagLUT(b *testing.B) {
d := NewDecoder(NewPacketConfig(72))

Expand All @@ -50,18 +36,7 @@ func BenchmarkFilter(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for n := 0; n < b.N; n++ {
d.Filter(d.Signal, d.Filtered)
}
}

func BenchmarkQuantize(b *testing.B) {
d := NewDecoder(NewPacketConfig(72))

b.SetBytes(int64(d.Cfg.BlockSize))
b.ReportAllocs()
b.ResetTimer()
for n := 0; n < b.N; n++ {
Quantize(d.Filtered[d.Cfg.SymbolLength:], d.Quantized[d.Cfg.PacketLength:])
d.Filter(d.Signal, d.Quantized[d.Cfg.PacketLength:])
}
}

Expand Down

0 comments on commit d4b9855

Please sign in to comment.