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

📄 fixpoint_cascadetiir.c

📁 CHP 5 - Real-Time Digital Signal Processing: Implementations and Applications, Second Edition by Sen
💻 C
字号:
// 
//  Project: Exercise 5.24 implementation of fixed-point IIR filter in direct form-II - Chapter 5
//  File name: fixPoint_cascadeIIR.c   
//
//  Description: This is the fixed-point IIR filter in direct form I realization
//
//  For the book "Real Time Digital Signal Processing: 
//                Implementation and Application, 2nd Ed"
//                By Sen M. Kuo, Bob H. Lee, and Wenshun Tian
//                Publisher: John Wiley and Sons, Ltd
//
//  Tools used: CCS v.2.12.07
//              TMS320VC5510 DSK Rev-C
//

#include "directIIR.h"

void cascadeIIR(short in, short (*w)[3], short *y, 
                short (*b)[3], short (*a)[3], short section)
{
  long  temp32;
  short k,temp16;

  temp16 = in;
  for(k=0; k<section; k++)     
  {
    temp32  = (long)w[k][1] * a[k][1];
    temp32 += (long)w[k][2] * a[k][2];
    temp32 >>= 14;
    w[k][0] = temp16 - (short)(temp32);
    temp32  = (long)w[k][0] * b[k][0];
    temp32 += (long)w[k][1] * b[k][1];
    temp32 += (long)w[k][2] * b[k][2];
    temp32 >>= 14;
    temp16  = (short)(temp32);
    w[k][2] = w[k][1];
    w[k][1] = w[k][0];
  }

  *y = temp16;               // Save the result 
}

⌨️ 快捷键说明

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