Skip to content

Commit 7f05214

Browse files
committed
Add decimation factor checking. Clarify warning.
1 parent 8f3cb52 commit 7f05214

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

decode/decode.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ func (d Decoder) Log() {
7070
log.Println("Preamble:", d.Cfg.Preamble)
7171

7272
if d.Cfg.SymbolLength%d.Decimation != 0 {
73-
log.Println("Warning: decimation factor gives non-integer symbol length, sensitivity may be poor")
73+
log.Println("Warning: decimated symbol length is non-integral, sensitivity may be poor")
74+
}
75+
76+
if d.DecCfg.SymbolLength < 3 {
77+
log.Fatal("Error: illegal decimation factor, choose a smaller factor")
7478
}
7579

7680
return

0 commit comments

Comments
 (0)