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

📄 floatpointfir.c

📁 CHP 4 - Real-Time Digital Signal Processing: Implementations and Applications, Second Edition by Sen
💻 C
字号:
// 
//  Project: Example 4.18: floating-point implementation of FIR filter - Chapter 4
//  File name: floatPointFir.c   
//
//  Description: This is a floating-point FIR filter implementation
//
//  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
//

#include "floatingPointFir.h"

void floatPointFir(float *x, float *h, short order, float *y, float *w)
{
  short i;
  float sum;

  w[0] = *x++;                        // Get the current data to delay line
  for (sum=0, i=0; i<order; i++)      // FIR filter processing
  {
    sum += h[i] * w[i];
  }
  *y++ = sum;                         // Save filter output

  for (i=order-1; i>0; i--)           // Update data delay line
  {
    w[i] = w[i-1];
  }
}

⌨️ 快捷键说明

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