My first filter
Let's considere a signal x sampled at the frequence SR (SR = Sample Rate, usually SR = 44000 sample per second)
with
T=1/SR
T represent time between two sample of the signal.
Our sampled signal at the time nT is x(nT)
From this sample,
let's make a new signal :
y(nT)= 0.5*x(nT) + 0.5*x((n-1)T).
That's mean, we sum up at each sample the signal x(nT) with the last one x((n-1)T) and we multiply by 0.5 (on pourrait prendre d'autres valeurs mais pour cet exemple on prend 0.5). We have just built a simple low filter. Let's see why
We suppose that x(nT) is a sinusoïd, amplitude 1 (to simplify), we vary the frequency and watch how vary the output y(nT).
- If x(nT) has 0 frequency. x(nT) does not vary and has always the same value 1, at each nT. At output, y(nT)= 0.5*x(nT) + 0.5*x((n-1)T) = 0.5*1 + 0.5*1 = 1.Then at the output we have also at each nT. At null frequency, y(nT) = x(nT).

- Let's increase the frequency of x(nT) and let's take for exemple F=SR/4.

for n=0, we have y(0) = 0.5*x(0) + 0.5*x(-T) = 0.5*1 + 0.5*0 = 0.5
for n=1, we have y(T) = 0.5*x(T) + 0.5*x(0) = 0.5*0 + 0.5*1 = 0.5
for n=2, we have y(2T) = 0.5*x(2T) + 0.5*x(T) = 0.5*(-1) + 0.5*0 = -0.5
for n=3, we have a y(3T) = 0.5*x(3T) + 0.5*x(2T) = 0.5*0 + 0.5*(-1)= -0.5
etc...
the phase of y(nT) is
delayed and the amplitutde as decreased.
- Let's increase again the frequency and let's take the maximum frequency for x(nT) : F=SR/2.

for n=0, we have y(0) = 0.5*1 + 0.5*(-1) = 0
for n=1, we have y(T)= 0.5*(-1) + 0.5*(1) = 0
for n=2, we have y(2T) = 0.5*1 + 0.5*(-1) = 0
etc...
So, for F=SR/2, the output y(nT) is null.
We have then realized a low pass filter which does not modify the null frequency of the input signal and which attenuate the signal more and more when frequency increase, to remove it completly at the frequency SR/2.
Could we predicte that result ?
Let's considere again x(nT) and let's watch at the time 0. At null frequency, x(0)=1 et the previous sample , x(-T), is also egual to 1. So the sum of the 2 samples,
divided by 2, gives again 1.
When the frequency increase, the sample at 0 time does not change, but the previous sample dicrease more and more, to then reach the null value at frequency F=SR/4 and -1 valut at frequency F=SR/2. So, the sum of the 2 samples dicrease more and more, reach the value 0.5 at f=SR/4 and 0 at F=SR/2.
There is a more graphical way to anaylize that result.
Instead to visualize x(nT) function according time, let's watch X(0) et X(-T) in a plan x0z. The sample X(0) is located at the coordonates (x(0),0) whereas the sample X(-T) vary according of the frequency from (x(0),0)
for F=0 to (-x(0),0) for F=SR/2. X(-T) goes along the bottom half-circle, according to frequency. The real value of X(-T) is its projection on the axis x.

The x0z plan is, in fact, the "complex" plan and X(-T) the "complex" representation of x(-T) in this plan.
Let's define :
X(-T)=Z^(-1)*X(0)
Z^(-1) représent the "unit" value (X(-T)/X(0)) of the sample X(-T) in the complex plan (in our exemple, on a X(0)=1 but in the general case, X(0) can have any value). In the complex plan, Z^(-1) describe then, according to the frequency, the bottom half-circle le demi-cercle with the radius egual to 1.
Y(0)=0.5*X(0) + 0.5*Z^(-1)*X(0) = [0.5 + 0.5*Z^(-1)]*X(0)
To know the variation of Y(0) compared with X(0) To know the variation of Y(0) compared with X(0), we have to study the graph 0.5 + 0.5*Z^(-1) when Z^(-1) goes along the unit half-circle :

On the picture, the blue line represent the amplitude variation ( length of the segment) and phase (its angle with the 0x axe) of the output Y compared to X. We can then conclude that the output Y is egal to X at null frenquency, then decrease little by little with shift increasing and become null at frenquency=SR/2 with shift=90° or PI/2.
Making the filter with sync-modular :

inside the macro "simple filter"

I took the parabolic sinus because it works better at high frequency than the sinus of Dr Sync.
We could verify on the scope that the output decrease with frequency and become null at the frequency=22000 Hz.(don't forget to set sample rate at 44000 hertz in the menu "Sound", "Audio Set-up").
This exemple :
Simple filter
Back to unofficial Sync-modular home page