Friday, 14 October 2016

filters - What exactly is stored in the buffer array in the code below? Is it the values of x[n-k] or something else?


What exactly is stored in the buffer array in the FIR Filter code below? Is it the values of x[n-k] or something else?



float filter (float value){
for (int i = ntaps-1; i>0; i--){
buffer[i] = buffer[i-1];
}
buffer[0] = value;
for (int i = 0; i output += buffer[i]*h[i];
}
return ouput;
}


Answer



It stores the last $ntap$ samples of the input. So it's $x[n], x[n-1], ..., x[n-N+1]$


No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...