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

📄 testlpc2lsp.c

📁 ADI BF535 DSP 音频的线性预测算法汇编优化源码
💻 C
字号:
/*******************************************************************************
Copyright(c) 2000 - 2002 Analog Devices. All Rights Reserved.
Developed by Joint Development Software Application Team, IPDC, Bangalore, India
for Blackfin DSPs  ( Micro Signal Architecture 1.0 specification).

By using this module you agree to the terms of the Analog Devices License
Agreement for DSP Software. 
********************************************************************************
  File Name      : testlpc2lsp.c
  Description    : This module tests the lpc to lsp converion in 
                   lpc2lsp.asm. i/p lpc coefficients are in 4.12 format
                   Function used is _lpc2lsp(PtrLpcCoeff,PtrLsp,PtrOldLsp)
*******************************************************************************/
#include <stdio.h>
#include "lpc2lsp.h"

int error_flag = 0;
void (*f1)();
int cycle_count[10];

void _lpc2lsp();

main()
{
    int i,error;
    f1 = _lpc2lsp;

    /* Test1 begins here */

    cycle_count[0] = Compute_Cycle_Count((PtrLpcCoeff1+1), PtrLsp, PtrOldLsp);   
                        //This function inturn calls lpc2lsp()

    for(i=0;i<FiltOrd;i++)
    {
        error=(LspExpd1[i]- PtrLsp[i]);
        if(error < 0)
            error = -error;
        if(error > MAX_PERMISSIBLE_ERROR)
        {
            error_flag = error_flag | 1;
            break;
        }
    }
    
    /* Test2 begins here */

    cycle_count[1] = Compute_Cycle_Count((PtrLpcCoeff2+1), PtrLsp, PtrOldLsp);

    for(i=0;i<FiltOrd;i++)
    {
        error=(LspExpd2[i]- PtrLsp[i]);
        if(error < 0)
            error = -error;
        if(error > MAX_PERMISSIBLE_ERROR)
        {
            error_flag = error_flag | 2;
            break;
        }
    }
    
    /* Test3 begins here */

    cycle_count[2] = Compute_Cycle_Count((PtrLpcCoeff3+1), PtrLsp, PtrOldLsp);

    for(i=0;i<FiltOrd;i++)
    {
        error=(LspExpd3[i]- PtrLsp[i]);
        if(error < 0)
            error = -error;
        if(error > MAX_PERMISSIBLE_ERROR)
        {
            error_flag = error_flag | 4;
            break;
        }
    }
    #ifdef PRINTF_SUPPORT
        if(error_flag & 1)
            printf("Test Case 1 failed\n");
        else
            printf("Test Case 1 passed\n");
        if(error_flag & 2)
            printf("Test Case 2 failed\n");
        else
            printf("Test Case 2 passed\n");
        if(error_flag & 4)
            printf("Test Case 3 failed\n");
        else
            printf("Test Case 3 passed\n");
    #endif
    
    printf("cycle_count[0]=%d,cycle_count[1]=%d,cycle_count[2]=%d\n",cycle_count[0],cycle_count[1],cycle_count[2]);
    

}

⌨️ 快捷键说明

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