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