Skip to content

Commit

Permalink
Start amplify impl
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Feb 21, 2025
1 parent ec2fd57 commit 5cc6db7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rvoice/fluid_iir_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ fluid_iir_filter_apply_local(fluid_iir_filter_t *iir_filter, fluid_real_t *dsp_b
{
/* The filter is implemented in Direct-II form. */
dsp_centernode = dsp_buf[dsp_i] - dsp_a1 * dsp_hist1 - dsp_a2 * dsp_hist2;
dsp_buf[dsp_i] = dsp_b02 * (dsp_centernode + dsp_hist2) + dsp_b1 * dsp_hist1;
fluid_real_t sample = dsp_b02 * (dsp_centernode + dsp_hist2) + dsp_b1 * dsp_hist1;
dsp_hist2 = dsp_hist1;
dsp_hist1 = dsp_centernode;

dsp_buf[dsp_i] = AMPLIFY ? dsp_amp * sample : sample;
/* Alternatively, it could be implemented in Transposed Direct Form II */
// fluid_real_t dsp_input = dsp_buf[dsp_i];
// dsp_buf[dsp_i] = dsp_b02 * dsp_input + dsp_hist1;
Expand Down

0 comments on commit 5cc6db7

Please sign in to comment.