# how can I make a simple lowpass filter with this constraints? [closed]

I'm searching for a simple low pass filter code in C with this constraints

• a modulable frequency cutoff (how can I convert all these crazy coefficients into a frequency?) I could change with a slider.
• a dB/Octave I can change in my code.
• a resonance I can change in my code.

the graphical result will be a simple slider moving from 0-44Khz. So far I've only managed to cut a bit of the high ends of my sounds by doing

int i = 0;
while (i < x.size - 1)
{
y[i] = (x[i] + x[i+1]) / 2;
i++;
}


where x is the input buffer (depends of the settings but it goes from 32 to 2048 samples) and y is the output buffer.

• It's not clear what you are asking. You want code to design a filter? You also want some kind of GUI code? Google would probably be the place to start. – AnonSubmitter85 Mar 8 '18 at 4:45