⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccan.c

📁 DSP algorithm
💻 C
字号:
/* ccan.c - circular buffer implementation of canonical realization */void wrap();                              /* defined in \ref{hardware.sec} */double ccan(M, a, b, w, p, x)             /* usage: y=ccan(M, a, b, w, &p, x); */double *a, *b, *w, **p, x;                /* \(p\) = circular pointer to buffer \(w\) */int M;                                    /* \(a,b\) have common order \(M\) */{       int i;       double y = 0, s0;       **p = x;                                 /* read input sample \(x\) */       s0  = *(*p)++;                           /* \(s\sb{0}=x\) */       wrap(M, w, p);                           /* \(p\) now points to \(s\sb{1}\) */       for (a++, i=1; i<=M; i++) {              /* start with \(a\) incremented to \(a\sb{1}\) */              s0 -= (*a++) * (*(*p)++);              wrap(M, w, p);              }       **p = s0;                                /* \(p\) has wrapped around once */       for (i=0; i<=M; i++) {                   /* numerator part */              y += (*b++) * (*(*p)++);              wrap(M, w, p);                    /* upon exit, \(p\) has wrapped */              }                                 /* around once again */       (*p)--;                                  /* update circular delay line */       wrap(M, w, p);       return y;                                /* output sample */}

⌨️ 快捷键说明

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