Skip to content

Commit

Permalink
hardclip the filter value for high values
Browse files Browse the repository at this point in the history
  • Loading branch information
iurienistor committed Feb 12, 2024
1 parent e016b63 commit de4c012
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dsp/src/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ gkick_filter_val(struct gkick_filter *filter,
gkick_real *out_val,
gkick_real env_x)
{
if (isnan(in_val) || in_val > 1.0f || in_val < -1.0f) {
*out_val = 0.0f;
return GEONKICK_ERROR;
}
if (isnan(in_val))
in_val = 0.0;
else
in_val = geonkick_clamp(in_val, -1.0f, 1.0f);

if (filter == NULL || out_val == NULL) {
gkick_log_error("wrong arguments");
Expand Down

0 comments on commit de4c012

Please sign in to comment.