#include "arm_math.h"
#include "math_helper.h"
#if defined(SEMIHOSTING)
#include <stdio.h>
#endif
#define SNR_THRESHOLD 90
#define TEST_LENGTH_SAMPLES 10
#define XSPACING (0.005f)
float32_t testInputSin_f32[TEST_LENGTH_SAMPLES] =
{
-0.649716504673081170, -2.501723745497831200,
0.188250329003310100, 0.432092748487532540,
-1.722010988459680800, 1.788766476323060600,
1.786136060975809500, -0.056525543169408797,
0.491596272728153760, 0.262309671126153390
};
float32_t testRefSinOutput32_f32[TEST_LENGTH_SAMPLES] =
{
-0.604960695383043530, -0.597090287967934840,
0.187140422442966500, 0.418772124875992690,
-0.988588831792106880, 0.976338412038794010,
0.976903856413481100, -0.056495446835214236,
0.472033731854734240, 0.259311907228582830
};
float32_t testLinIntOutput[TEST_LENGTH_SAMPLES];
extern const float arm_linear_interep_table[1884];
int32_t main(void)
{
uint32_t i;
for(i=0; i< TEST_LENGTH_SAMPLES; i++)
{
}
for(i=0; i< TEST_LENGTH_SAMPLES; i++)
{
}
snr1 = arm_snr_f32(testRefSinOutput32_f32, testOutput, 2);
snr2 = arm_snr_f32(testRefSinOutput32_f32, testLinIntOutput, 2);
{
#if defined (SEMIHOSTING)
printf("FAILURE\n");
#else
while (1);
#endif
}
else
{
#if defined (SEMIHOSTING)
printf("SUCCESS\n");
#else
while (1);
#endif
}
}