// N : number of coefficients
// h(n) : filter coefficients, n = 0,…N-1
// x(n) : stored input data, n = 0,…2N-1
// input sample : variable that contains the newest input sample
// index : variable that contains the current place where the new sample is to be stored
x[index] = input_sample
// Filter the data
ynew = 0;
for (i=0;i<N;i++){
if((index-i)<0){
ynew = ynew + h[i]*x[index-i+N];
} else {
ynew = ynew + h[i]*x[index-i];
}
}
index = (index+1)%N;
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00