What is the purpose of the recurrence relation in low and high pass (audio) filters? Newbie here. I'm familiar with time and frequency domains from math. I think I understand what low and high pass filters do, sonically. But digging into an implementation of tone in csounds, I think I'm missing something fundamental. Take this description:

A first-order recursive low-pass filter with variable frequency response.
tone is a 1 term IIR filter. Its formula is:
yn = c1 * xn + c2 * yn-1
where

b = 2 - cos(2 π hp/sr);

c2 = b - sqrt(b2 - 1.0)

c1 = 1 - c2



I see that there is a recurrence relation. But I'm reading about IIRs and filters in general I don't see any explanation of why it's there or what it does.

Would performing a single pass of this formula not be considered performing a &quot;true&quot; low or high pass filter?

Or is that it takes multiple passes (infinite, in theory) to completely &quot;remove&quot; the frequencies desiring to be removed, so it's a tradeoff between iterations versus computation?


I'm gravitating toward the latter, but I don't see where that is being said. Can someone point me to the essential statement of it on Wikipedia or somewhere?
An IIR filter is a recursive one. It means, current value of output $y[n]$ is computed based on its previous value(s).
Consider a simple 1st order IIR filter definition:
$$y[n] = a \cdot y[n-1]+ b \cdot x[n]$$
$a$ and $b$ are the filter coefficients.
Now assume you have a long block of N samples input data. If you want to process that block of input data with this filter, you can do it like in this matlab code :
N = 1024;       % number of input samples
x = randn(N,1); % some random input.
a = 0.5;        % IIR filter coefficients
b = 0.9;

yi = 0;         % initial value for output
y = zeros(N,1); % matrix (array) to hold processed output samples

y(1) = a*yi + b*x(1)   % assign first output sample based on y(-1) 
for n=2:N              % assign rest
    y(n) = a*y(n-1) + b*x(n);
end