Commit Graph

20 Commits

Author SHA1 Message Date
David Reid 323d7a69a1 Hide a biquad implementation detail. 2020-01-31 21:33:35 +10:00
David Reid ab518977ec Remove unnecessary casts. 2020-01-30 21:25:50 +10:00
David Reid 96f747d3f3 Don't allow format and channels to change for biquad and LPF filters.
Previously this would result in a glitch, however in the interest of
avoiding as many sources of glitching as possible, changing the format
and/or channel count of a biquad filter (and by extension, anything
derived from it, such as low-pass filters) will now result in an error.
2020-01-30 21:23:21 +10:00
David Reid 9dbcc39c6e Update biquad documentation. 2020-01-29 19:01:04 +10:00
David Reid c8b6fdaf2c Use fixed point arithmetic with s16 biquads. 2020-01-29 18:50:50 +10:00
David Reid 68b960215f Update old comments. 2020-01-28 22:03:47 +10:00
David Reid b9c2509d78 Fix an overflow bug in the s16 biquad pipeline. 2020-01-28 21:54:15 +10:00
David Reid 040dcf8d2c Add documentation for low-pass filters. 2020-01-28 21:49:33 +10:00
David Reid b97c6fd35b Remove the old direct form 1 biquad code. 2020-01-28 21:19:14 +10:00
David Reid 8a44789840 Remove the unnecessary config member from ma_lpf.
This is never actually used internally and saves a bit of memory.
2020-01-28 20:42:59 +10:00
David Reid 42095a3e5a Add documentation for biquads. 2020-01-28 20:41:41 +10:00
David Reid e525d457c9 Change biquad filter to use transposed direct form 2.
This change reduces memory usage by removing half the number of delay
registers.

This commit also sets up some infrastructure for future work on a fixed
point implementation. Both the floating and fixed point implementations
will run on a 32-bit pipeline for now.
2020-01-28 20:14:55 +10:00
David Reid 5d3ed8687e Bug fixes to the linear resampler.
This changes the the lpfCutoffFrequency config variable from a uint32
to a double. This is required because we simplify the sample rate
fraction which cant result in cases where the cutoff frequency is too
aggressively rounded down due to dividing tiny integers.
2020-01-27 18:12:25 +10:00
David Reid 13a5512879 Work in progress on the linear resampler. 2020-01-26 08:51:53 +10:00
David Reid 811e438d1b Add support for reinitialization of low-pass and biquad filters. 2020-01-20 19:01:42 +10:00
David Reid 7b27cda74a Add support for s16 format to biquad and low-pass filters. 2020-01-18 17:23:36 +10:00
David Reid 705e54c69a Add support for s16 format to the linear resampler. 2020-01-18 17:12:30 +10:00
David Reid 7d37789418 Resampling and LPF work. 2020-01-18 14:36:12 +10:00
David Reid 11d752ad78 Untested work in progress on the improved resampler. 2020-01-14 21:50:01 +10:00
David Reid 2b526f6945 Add experimental code for biquad and low-pass filters. 2020-01-09 11:27:57 +10:00