It seems I am unable to understand how these filters work and what is the point of using them, no matter how many tutorials I watched.
Could someone please explain, in simple words, what FIR and IIR filters do?
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.Sign up to join this community
Filters modify the frequency content of a signal.
The terms Finite Impulse Response (FIR) filter and Infinite Impulse Response (IIR) filter refer to Linear Time Invariant (LTI) filters.
LTI filters can change the amplitude and phase of specific frequencies in a signal, but they cannot shift any frequency content to other frequencies.
LTI filters are usually used to remove undesired frequencies from an input signal.
As an example, your FM radio receives a signal that is the entire FM broadcast band, from 88 MHz to 108 MHz in the electromagnetic frequency spectrum, at its antenna. In a simplified view of an FM radio receiver, an LTI filter is used to filter out everything but the 200 kHz around 99.5 MHz, so that the radio can demodulate the audio from the station at 99.5 MHz without the frequencies from all the other stations interfering with that process. (In actuality FM radio receivers are more complicated, using a cascade of LTI filters with some non-linear "mixing" processes, but we're going for the concept here.)
To describe some of the math, at a high level:
When FIR and IIR filters are applied to signal in time domain, their application is equivalent to a mathematical operation called "Convolution".
The mathematical operation of convolution of a signal with an FIR or IIR filter, is equivalent to time-reversing the filter response, shifting it relative to the signal, performing pointwise multiplication, then summing up the values; then shifting the time-reversed filter response over slightly relative to the signal, preforming pointwise multiplication, then summing up the values; then ... keep repeating that for all of time (or until the input signal disappears to 0).