csos_c.mht

来自「常用的DSP算法集锦」· MHT 代码 · 共 44 行

MHT
44
字号
From: <由 Microsoft Internet Explorer 5 保存>
Subject: 
Date: Wed, 27 Sep 2006 22:39:29 +0800
MIME-Version: 1.0
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.oxbad.com/DSP/maindoc/arithmetic_source/c/CSOS.C
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY><PRE>/* csos.c - circular buffer implementation of a single SOS */

void wrap();

double csos(a, b, w, p, x)                      /* \(a,b,w\) are =
3-dimensional */
double *a, *b, *w, **p, x;                      /* \(p\) is circular =
pointer to \(w\) */
{
       double y, s0;

       *(*p) =3D x;                               /* read input sample =
\(x\) */

       s0  =3D *(*p)++;           wrap(2, w, p);
       s0 -=3D a[1] * (*(*p)++);  wrap(2, w, p);
       s0 -=3D a[2] * (*(*p)++);  wrap(2, w, p);

       *(*p) =3D s0;                              /* \(p\) has wrapped =
around once */

       y  =3D b[0] * (*(*p)++);  wrap(2, w, p);
       y +=3D b[1] * (*(*p)++);  wrap(2, w, p);
       y +=3D b[2] * (*(*p));                     /* \(p\) now points to =
\(s\sb{2}\) */

       return y;
}
</PRE></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?