Skip to content

DigitalSampler normalization bug #1

@FrigoCoder

Description

@FrigoCoder

We use sum normalization for lowpass filters, and alternating sum normalization for highpass filters.

Unfortunately this strategy becomes inconsistent at boundaries: Even if lowpass and highpass filters are complementary, the lowpass and highpass signal they generate are not, they do not add up to the original signal.

This can be easily seen with the filters [0.5, 1.0, 0.5] and [-0.5, 1.0, -0.5]. At position 0 they become [2/3, 1/3] and [2/3, -1/3], which sums up to [4/3, 0] instead of [1, 0]. At position 1 they are [0.25, 0.5, 0.25] and [-0.25, 0.5, -0.25], which sums up to the expected [0, 1, 0].

A workaround is to always work with lowpass filters and subtract the result from the original signal to get the highpass signal. Unfortunately this introduces heavy numerical instability, 1E-14 in double, and 1E-5 in float precision. It also limits our choice of filters, for example Daubechies wavelets do not conform to this strategy.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions