• KAMO
    了解作者
  • Visual C++
    开发工具
  • 1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 1
    下载次数
  • 2017-08-30 10:59
    上传日期
FIR(Finite Impulse Response)滤波器:有限长单位冲激响应滤波器,又称为非递归型滤波器,是数字信号处理系统中最基本的元件,它可以在保证任意幅频特性的同时具有严格的线性相频特性,同时其单位抽样响应是有限长的,因而滤波器是稳定的系统。因此,FIR滤波器在通信、图像处理、模式识别等领域都有着广泛的应用。
Example_2833x_FIR.zip
  • Example_2833x_FIR.c
    5.1KB
内容介绍
// TI File $Revision: /main/9 $ // 上海汉远科技 //########################################################################### // // FILE: Example_2833x_FFT.c // // TITLE: FFT // // ASSUMPTIONS: // // This program requires the DSP2833x header files. // // Two different examples are included. Select the example // to execute before compiling using the #define statements // found at the top of the code. // // As supplied, this project is configured for "boot to SARAM" // operation. The 2833x Boot Mode table is shown below. // For information on configuring the boot mode of an eZdsp, // please refer to the documentation included with the eZdsp, // // $Boot_Table: // // GPIO87 GPIO86 GPIO85 GPIO84 // XA15 XA14 XA13 XA12 // PU PU PU PU // ========================================== // 1 1 1 1 Jump to Flash // 1 1 1 0 SCI-A boot // 1 1 0 1 SPI-A boot // 1 1 0 0 I2C-A boot // 1 0 1 1 eCAN-A boot // 1 0 1 0 McBSP-A boot // 1 0 0 1 Jump to XINTF x16 // 1 0 0 0 Jump to XINTF x32 // 0 1 1 1 Jump to OTP // 0 1 1 0 Parallel GPIO I/O boot // 0 1 0 1 Parallel XINTF boot // 0 1 0 0 Jump to SARAM <- "boot to SARAM" // 0 0 1 1 Branch to check boot mode // 0 0 1 0 Boot to flash, bypass ADC cal // 0 0 0 1 Boot to SARAM, bypass ADC cal // 0 0 0 0 Boot to SCI-A, bypass ADC cal // Boot_Table_End$ // // DESCRIPTION: // FFT变换 数字信号处理 // // // //########################################################################### // $TI Release: DSP2833x/DSP2823x Header Files V1.20 $ // $Release Date: August 1, 2008 $ //########################################################################### #include "DSP28x_Project.h" // Device Headerfile and Examples Include File #include "math.h" #define FIRNUMBER 25 #define SIGNAL1F 1000 #define SIGNAL2F 4500 #define SAMPLEF 10000 #define PI 3.1415926 float InputWave(); float FIR(); float fHn[FIRNUMBER]={ 0.0,0.0,0.001,-0.002,-0.002,0.01,-0.009, -0.018,0.049,-0.02,0.11,0.28,0.64,0.28, -0.11,-0.02,0.049,-0.018,-0.009,0.01, -0.002,-0.002,0.001,0.0,0.0 }; float fXn[FIRNUMBER]={ 0.0 }; float fInput,fOutput; float fSignal1,fSignal2; float fStepSignal1,fStepSignal2; float f2PI; int i; float fIn[256],fOut[256]; int nIn,nOut; void main(void) { nIn=0; nOut=0; f2PI=2*PI; fSignal1=0.0; fSignal2=PI*0.1; fStepSignal1=2*PI/30; fStepSignal2=2*PI*1.4; // Step 1. Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks // This example function is found in the DSP2833x_SysCtrl.c file. InitSysCtrl(); // Step 2. Initalize GPIO: // This example function is found in the DSP2833x_Gpio.c file and // illustrates how to set the GPIO to it's default state. // InitGpio(); Skipped for this example // Step 3. Clear all interrupts and initialize PIE vector table: // Disable CPU interrupts DINT; // Initialize PIE control registers to their default state. // The default state is all PIE interrupts disabled and flags // are cleared. // This function is found in the DSP2833x_PieCtrl.c file. InitPieCtrl(); // Disable CPU interrupts and clear all CPU interrupt flags: IER = 0x0000; IFR = 0x0000; // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // This will populate the entire table, even if the interrupt // is not used in this example. This is useful for debug purposes. // The shell ISR routines are found in DSP2833x_DefaultIsr.c. // This function is found in DSP2833x_PieVect.c. InitPieVectTable(); // Step 4. while(1) { fInput=InputWave(); fIn[nIn]=fInput; nIn++; nIn%=256; fOutput=FIR(); fOut[nOut]=fOutput; nOut++; if ( nOut>=256 ) { nOut=0; /* 请在此句上设置软件断点 */ } } } float InputWave() { for ( i=FIRNUMBER-1;i>0;i-- ) fXn[i]=fXn[i-1]; fXn[0]=sin(fSignal1)+cos(fSignal2)/6.0; fSignal1+=fStepSignal1; if ( fSignal1>=f2PI ) fSignal1-=f2PI; fSignal2+=fStepSignal2; if ( fSignal2>=f2PI ) fSignal2-=f2PI; return(fXn[0]); } float FIR() { float fSum; fSum=0; for ( i=0;i<FIRNUMBER;i++ ) { fSum+=(fXn[i]*fHn[i]); } return(fSum); } //=========================================================================== // No more. //===========================================================================
评论
    相关推荐
    • FIR.rar
      Finite Impulse Response C++ code, which contains four types of FIR filtering (LP, HP, BS, BB).
    • FIR.rar
      实现多带FIR滤波,可回复原始信号,主要针对噪声信号的处理。
    • FIR.rar
      这是关于离散数字信号处理的FIR变换窗程序(凯塞窗 汉明窗)
    • FIR.zip
      FIR(Finite Impulse Response)滤波器:有限长单位冲激响应滤波器,又称为非递归型滤波器
    • FIR_matlab
      这是基于matlab的有限冲激响应(Finite Impulse Response)实验。用到了FIR的各种函数,准确全面
    • FIR.rar
      实现FIR(Finite Impulse Response)滤波器:有限长单位冲激响应滤波器,又称为非递归型滤波器,是数字信号处理系统中最基本的元件,它可以在保证任意幅频特性的同时具有严格的线性相频特性
    • FIR.zip
      介绍用matlab进行fir滤波器算法的例程
    • fir.rar
      A fir filter design method
    • fir.rar
      FIR(Finite Impulse Response)滤波器:有限长单位冲激响应滤波器,是数字信号处理系统中最基本的元件,可以在保证任意幅频特性的同时具有严格的线性相频特性,同时其单位抽样响应是有限长的,因而滤波器是稳定的系统...
    • FIR.zip
      It is the source code for FIR using rectangular window.