To introduce my situation: I'm developing a digital synthesizer in a form of a C++ library, working with low level APIs like WASAPI, ASIO, ALSA etc. It's probably not very practical and I'm mostly "reinventing the wheel" but my intention is to learn about digital synthesis in depth. So far I have successfully implemented basic concepts like oscillators and modulation of their properties. The next logical step is a filter.

So my question is: How does a digital filter work on this low level? How exactly does it modify the individual samples?

I understand, that this involves a lot of math. That's not a problem for me. I only need a good starting point (some sources to learn) and an intuitive explanation as all I was able to find were either analogue explanations or just formulas explained with a lot of advanced terminology that I'm not familiar with.


migrated from music.stackexchange.com Sep 5 '18 at 7:16

This question came from our site for musicians, students, and enthusiasts.

  • 2
    $\begingroup$ I'm voting to close this question as off-topic because the question is both too broad and not about music practice, performance, or history. $\endgroup$ – David Bowling Sep 4 '18 at 22:18
  • 1
    $\begingroup$ The low-level workings of digital filters does not seem at all like music theory to me; rather this is the domain of digital signal processing. Maybe this would be a better fit at SE Electrical Engineering, or at one of the programming-related sites. $\endgroup$ – David Bowling Sep 4 '18 at 22:29
  • 3
    $\begingroup$ I have just stumbled upon the Signal Processing Stack Exchange. I don't know why I haven't found it earlier, but it may be actually a better place for this question. $\endgroup$ – McSim Sep 4 '18 at 22:52
  • 2
    $\begingroup$ Welcome! Please check the answers to this question, and also browse the site a bit. Any remaining question can be formulated as a new question on this site. $\endgroup$ – Matt L. Sep 5 '18 at 7:39
  • 1
    $\begingroup$ @MattL: Thanks, so far it looks exactly like the kind of information I was hoping to see. $\endgroup$ – McSim Sep 5 '18 at 11:18

What you probably want is what's called a finite impulse response filter, or FIR. I know that this answer might be rejected for not being specific enough, but honestly you need a good grasp of DSP. However, on the bright side, there could possibly be ready to go software that will generate a filter for you. This shit is not easy. Really you need know the math behind it.

  • 1
    $\begingroup$ For synths, IIRs tend to be much more useful than FIRs. $\endgroup$ – leftaroundabout Sep 4 '18 at 22:45
  • $\begingroup$ Interesting. because IIRs can be unstable. I just had though that synths use FIRs for that reason. I learn something new everyday. $\endgroup$ – Larry Troxler Sep 4 '18 at 22:49
  • $\begingroup$ The main advantage or IIRs is that their parameters can be interactively tweaked without latency. And, yes, badly designed IIRs can indeed be unstable – but so can an analogue state variable filter! Properly thought through design can prevent unrecoverable instability. Driving a filter into the almost-unstable resonant region is actually an effective way of making screaming-aggressive lead synth sounds though. This too is hard to do with FIRs (which are incapable of modelling nonlinear response. $\endgroup$ – leftaroundabout Sep 4 '18 at 22:58
  • $\begingroup$ Well... a digitized & sampled IIR is just a specially-tweaked FIR when it comes right down to it. $\endgroup$ – Carl Witthoft Sep 5 '18 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.