0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FIRフィルタの実装2 Double Size FIFO Buffer

Posted at
// 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++){
	ynew = ynew + h(i)*x(index-i);
}
index = index + 1;

if (index>=2*N){
	for (i=N-2;i>=0;i--){
	x[i+N+1] = x[i];
}
index = N-1;
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?