|
NMSIS-DSP
Version 1.3.1
NMSIS DSP Software Library
|
#include <stdio.h>
#include "riscv_math.h"
#include "math_helper.h"
#define TEST_LENGTH_SAMPLES 1536
#define NUMTAPS 32
#define BLOCKSIZE 32
#define DELTA_ERROR 0.00009f
#define DELTA_COEFF 0.0001f
#define MU 0.5f
#define NUMFRAMES (TEST_LENGTH_SAMPLES / BLOCKSIZE)
uint32_t blockSize);
uint32_t fr_cnt,
uint32_t blockSize);
extern float32_t testInput_f32[TEST_LENGTH_SAMPLES];
int32_t main(void)
{
#if (defined(__riscv_vector))
__RV_CSR_SET(CSR_MSTATUS, 0x200);
#endif
uint32_t i;
uint32_t index;
for(i=0; i < NUMFRAMES; i++)
{
wire1,
wire2,
wire3,
err_signal,
BLOCKSIZE);
}
if (minValue > DELTA_ERROR)
{
printf("first failed\n");
}
if (minValue > DELTA_COEFF)
{
printf("second failed\n");
}
{
printf("failed\n");
return 1;
}
printf("passed\n");
return 0;
}
riscv_status
vector types
Definition: riscv_math_types.h:270
float float32_t
32-bit floating-point type definition.
Definition: riscv_math_types.h:257
void riscv_abs_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Floating-point vector absolute value.
Definition: riscv_abs_f32.c:64
@ RISCV_MATH_TEST_FAILURE
Definition: riscv_math_types.h:278
void riscv_fir_init_f32(riscv_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
Definition: riscv_fir_init_f32.c:74
void riscv_scale_f32(const float32_t *pSrc, float32_t scale, float32_t *pDst, uint32_t blockSize)
Multiplies a floating-point vector by a scalar.
Definition: riscv_scale_f32.c:76
void riscv_lms_norm_init_f32(riscv_lms_norm_instance_f32 *S, uint16_t numTaps, float32_t *pCoeffs, float32_t *pState, float32_t mu, uint32_t blockSize)
Initialization function for floating-point normalized LMS filter.
Definition: riscv_lms_norm_init_f32.c:60
void riscv_min_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult, uint32_t *pIndex)
Minimum value of a floating-point vector.
Definition: riscv_min_f32.c:59
Instance structure for the floating-point FIR filter.
Definition: filtering_functions.h:87
@ RISCV_MATH_SUCCESS
Definition: riscv_math_types.h:272
Instance structure for the floating-point normalized LMS filter.
Definition: filtering_functions.h:1682
void riscv_sub_f32(const float32_t *pSrcA, const float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector subtraction.
Definition: riscv_sub_f32.c:61
void riscv_fir_f32(const riscv_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR filter.
Definition: riscv_fir_f32.c:152
void riscv_lms_norm_f32(riscv_lms_norm_instance_f32 *S, const float32_t *pSrc, float32_t *pRef, float32_t *pOut, float32_t *pErr, uint32_t blockSize)
Processing function for floating-point normalized LMS filter.
Definition: riscv_lms_norm_f32.c:159
void riscv_copy_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Copies the elements of a floating-point vector.
Definition: riscv_copy_f32.c:59