MCPcopy
hub / github.com/fogleman/nes / FirstOrderFilter

Struct FirstOrderFilter

nes/filter.go:11–17  ·  view source on GitHub ↗

First order filters are defined by the following parameters. y[n] = B0*x[n] + B1*x[n-1] - A1*y[n-1]

Source from the content-addressed store, hash-verified

9// First order filters are defined by the following parameters.
10// y[n] = B0*x[n] + B1*x[n-1] - A1*y[n-1]
11type FirstOrderFilter struct {
12 B0 float32
13 B1 float32
14 A1 float32
15 prevX float32
16 prevY float32
17}
18
19func (f *FirstOrderFilter) Step(x float32) float32 {
20 y := f.B0*x + f.B1*f.prevX - f.A1*f.prevY

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected