Commit 92ddec2
committed
Add DC blocker post-mixer to remove DC offset
This implements a one-pole high-pass filter (alpha=0.995, ~8.7 Hz
cutoff) placed after the main mixer and before the soft clipper.
- Uses int64_t arithmetic to prevent overflow on large signals
- Clamps state to INT32_MIN/MAX for stability
- Truncates feedback (not rounds) to ensure full DC decay to zero
It removes DC bias introduced by waveshaping and asymmetric waveforms
with approximately 4 cycles/sample overhead.1 parent 94b7235 commit 92ddec2
1 file changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
| |||
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
868 | 875 | | |
869 | 876 | | |
870 | 877 | | |
871 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
872 | 899 | | |
873 | 900 | | |
874 | 901 | | |
| |||
0 commit comments