📄 testlsp2lpc.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 : testlsp2lpc.c
Description : This module tests the lsp to lpc converion in
lsp2lpc.asm. i/p lsp's are in 1.15 format
Function used is _lsp2lpc(fract16 lsp[], fract16 lpc[])
*******************************************************************************/
#include <stdio.h>
#include "lsp2lpc.h"
int error_flag = 0;
void (*f1)();
int cycle_count[10];
void _lsp2lpc();
main()
{
int i,error;
f1 = _lsp2lpc;
/* Test1 begins here */
cycle_count[0] = Compute_Cycle_Count(lsp1, lpc);
//This function inturn calls lsp2lpc()
for(i=0;i<FiltOrd+1;i++)
{
error=LpcExpd1[i]- lpc[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(lsp2, lpc);
for(i=0;i<FiltOrd;i++)
{
error=LpcExpd2[i]- lpc[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(lsp3, lpc);
for(i=0;i<FiltOrd;i++)
{
error=LpcExpd3[i] - lpc[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 + -