maduba12001
Banned
I need a help with filter realization. I dont understand how this works. This is a multiply and accumulate filter, I dont understand why cof[0] constant is multiplied, here is the code cof is the filter coefficients and sample is the samples. Any help with this very appreciated. Thank you
Code:
long long mac(int len, int *sample, int *cof, int item)
{
int i, io;
static long long y;
io = 0;
y = 0;
item /= 4;
for ( i = 0; i < len; i++ )
{
y += (long long)sample[io] * (long long)cof[0];
cof +=item;
io++;
if ( io >= len )
io = 0;
}
return y;
}