-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add HIIR library to LMMS #6553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HIIR library to LMMS #6553
Conversation
|
Why not add this library as a Git Submodule? |
JohannesLorenz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit weird to add code that is not used, but I can't see errors in the code.
Just so we can see what the license is here without having to look it up. 👍 http://www.wtfpl.net/ |
This reverts commit 4d1d887.
A crucial library for high-performance oversampling within LMMS, licensed under WTFPL.
There are many situations within LMMS that require oversampling. The quality of oversampling is heavily determined by the filters used in the process... the ideal is to have as steep of a filter slope as possible (to remove all aliasing without the filtering being audible at all) while also introducing minimal phase shifting (or else the filtering will audibly smear the audio).
Generic Butterworth lowpass filters are not adequate for this goal. In order for the desired steep slope to be achieved, it would be necessary to stack a very large number of these filters on top of each other, which results in tons of audible phase shifting and quite a hefty CPU demand.
An idealized FIR filter also won't work in many situations... the number of taps required to make the filter usable will result in large amounts of latency and quite a massive CPU demand once again.
HIIR solves this by using a different type of IIR filter called an elliptic filter, which is characterized by having an extremely steep slope with minimal filter taps.

Butterworth filters have such a gentle slope because they are designed to have minimal passband and stopband rippling. Elliptic filters allow a small amount of rippling and are able to have a far steeper slope as a result. Conveniently, this ripple is mostly only audible near the cutoff frequency, which is not an issue when you're filtering near Nyquist at frequencies too high for a human to hear.
The filters within HIIR are designed specifically with oversampling in mind, and will be the best things to use in almost all cases where oversampling is required. It also comes with some other useful filters which work in similar ways, like an IIR Hilbert Transform which shifts the audio by 90 degrees (an essential ingredient for frequency shifting).
I'll be modifying #6540 to make use of this library once it is added.