📄 fir_c.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0058)http://www.oxbad.com/DSP/maindoc/arithmetic_source/c/FIR.C -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3492" name=GENERATOR></HEAD>
<BODY><PRE>/* fir.c - FIR filter in direct form */
double fir(M, h, w, x) /* Usage: y = fir(M, h, w, x); */
double *h, *w, x; /* \(h\) = filter, \(w\) = state, \(x\) = input sample */
int M; /* \(M\) = filter order */
{
int i;
double y; /* output sample */
w[0] = x; /* read current input sample \(x\) */
for (y=0, i=0; i<=M; i++)
y += h[i] * w[i]; /* compute current output sample \(y\) */
for (i=M; i>=1; i--) /* update states for next call */
w[i] = w[i-1]; /* done in reverse order */
return y;
}
</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -