That code is extremely slow.
Don't use floats.
My code does basically the same.
A bunch of multiplications and averaging.
Add some feedback and you have just the right thing.
I spent years writing the filter.
Trying like you to figure out what it does.
When I knew how it works it wasn't that difficult.
Use it. Its faster than your float code.
This one is in Assembly
Plenty faster.