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

📄 ale_fixpt_dsplib.c

📁 用dsp解压mp3程序的算法
💻 C
字号:
/*****************************************************************
*  ale_fixpt_dsplib.c - C program for implementing ALE using
*                       assembly routine from DSPLIB
******************************************************************
*  System configuration:
*
* d(n) ---------------------------
*     |             /             |
* d(n-1)|----------------| out(n) V
*  ---->| ALE (LMS-FIR)  |-----> |+|
*       |----------------|     -  | 
*             /___________________|
*
******************************************************************/

#include <math.h>
#include <tms320.h>
#include <dsplib.h>
	
#include "newtest.h"

DATA err[NX];
short i;
short oflag;
#define STEP 1310	/*66(2*0.001); 676(2*0.01); 1310(2*0.02) */

void main(void)
{
    asm(" STM   #0, SWWSR");
    /* clear */
    for (i=0;i<NH;i++) h[i] =0;	// clear coeff buffer (optional)
    for (i=0;i<NX;i++) r[i] =0;	// clear output buffer (optional)
    for (i=0; i<NH; i++) dbuffer[i] = 0; // clear delay buffer (a must)

    /* compute in block of samples   */

    /* (i) NX = 500; */
    /* oflag = dlms(x,h,r,&dp,des,STEP,NH, NX);*/ 
    
  
    
    /* (ii) 125 samples/block */ 
    /* if (NX >= 4)
    {
      oflag=dlms(x,h,r,&dp,des,STEP, NH, NX/4);
      oflag=dlms(&x[NX/4],h,&r[NX/4],&dp,&des[NX/4],STEP,NH,NX/4);
      oflag=dlms(&x[NX/2],h,&r[NX/2],&dp,&des[NX/2],STEP,NH,NX/4);
      oflag=dlms(&x[(3*NX)/4],h,&r[(3*NX)/4],&dp,&des[(3*NX)/4],STEP,NH,NX/4);
    } */ 
    
    /*  (iii) 2 sample/block mode since need delayed error */
    for (i=0; i<NX/2; i++)
    {
      oflag=dlms(&x[2*i],h,&r[2*i],&dp,&des[2*i],STEP,NH,2);
      oflag=dlms(&x[(2*i)+1],h,&r[(2*i)+1],&dp,&des[(2*i)+1],STEP,NH,2);
    } 
   
    for (i=0;i<NX;i++)
    {
      err[i]=des[i]-r[i];
    }
    return;
}

⌨️ 快捷键说明

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