Skip to content
Discussion options

You must be logged in to vote

Hi,
You likely encountered the classic denormals problem. When a filter is fed with zeros, the filter's delay line can produce very small values known as denormals. These denormals can significantly degrade floating-point performance.
If you can tolerate negligible precision loss, you can configure the CPU to flush denormals to zero. This restores high performance for all floating-point operations within the IIR filter.
This issue is not related to KFR or how you use KFR and may happen with any code that produces very small numbers.

You can use an RAII helper to set CPU flags during audio processing:

struct fp_mode_scope {
    fp_mode_scope() noexcept : csr(_mm_getcsr()) {
        _MM_SET…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@geoffw64
Comment options

Answer selected by geoffw64
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants