#include "riscv_math.h"
#include "math_helper.h"
#include <stdio.h>
#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 riscv_linear_interep_table[1884];
int32_t main(void)
{
#if (defined(__riscv_vector))
__RV_CSR_SET(CSR_MSTATUS, 0x200);
#endif
uint32_t i;
for(i=0; i< TEST_LENGTH_SAMPLES; i++)
{
}
for(i=0; i< TEST_LENGTH_SAMPLES; i++)
{
}
snr1 = riscv_snr_f32(testRefSinOutput32_f32, testOutput, 2);
snr2 = riscv_snr_f32(testRefSinOutput32_f32, testLinIntOutput, 2);
{
}
else
{
}
{
printf("failed\n");
return 1;
}
printf("passed\n");
return 0;
}
float32_t riscv_linear_interp_f32(const riscv_linear_interp_instance_f32 *S, float32_t x)
Process function for the floating-point Linear Interpolation Function.
Definition: riscv_linear_interp_f32.c:80
float float32_t
32-bit floating-point type definition.
Definition: riscv_math_types.h:257
riscv_status
vector types
Definition: riscv_math_types.h:271
@ RISCV_MATH_TEST_FAILURE
Definition: riscv_math_types.h:278
@ RISCV_MATH_SUCCESS
Definition: riscv_math_types.h:272
float32_t riscv_sin_f32(float32_t x)
Fast approximation to the trigonometric sine function for floating-point data.
Definition: riscv_sin_f32.c:72
Instance structure for the floating-point Linear Interpolate function.
Definition: interpolation_functions.h:55