Another way to make Fir Filter
Posted: Fri Feb 17, 2023 3:19 am
I forget a little my previous experience with fir and how much it become hard when trying to do lot of tap..
Having to read a cycling memory and a fixed one. (which is more hard with the instruction set of 3.6)
So i got this idea. (But maybe it already existed ?)
Each new sample, is like adding an array (or some lfo/wave) multiplied by this sample.
So why not an array of wave reader that will cycle all at 1 sample interval,
each time one of the wave-reader reset it load the current sample and store it in his how variable.
It will now be multiply by this value
So this little example, a 64 tap fir filter that is composed by 64 wave reader
A little boring code to write, i wish i had made a text code compositor to make it but i copy paste and edit the number...
So the code work a little like this (but the line must be repeated and incremented for each tap..)
Having to read a cycling memory and a fixed one. (which is more hard with the instruction set of 3.6)
So i got this idea. (But maybe it already existed ?)
Each new sample, is like adding an array (or some lfo/wave) multiplied by this sample.
So why not an array of wave reader that will cycle all at 1 sample interval,
each time one of the wave-reader reset it load the current sample and store it in his how variable.
It will now be multiply by this value
So this little example, a 64 tap fir filter that is composed by 64 wave reader
So the code work a little like this (but the line must be repeated and incremented for each tap..)
Code: Select all
int x=0;
//Main Cycle//
mov eax,x[0]; add eax,16; and eax,1023;
mov x[0],eax;
//WaveReader1//
cmp eax,0; jnz v1;
movaps xmm0,in; movaps i1,xmm0;
v1:
movaps xmm0,co[eax]; mulps xmm0,i1;
//WaveReader2//
add eax,16; and eax,1023; cmp eax,0; jnz v2;
movaps xmm1,in; movaps i2,xmm1;
v2:
movaps xmm1,co[eax]; mulps xmm1,i2; addps xmm0,xmm1;
Etc Etc .... Then movaps out,xmm0;