(1)Linking with -ldsp (in the nds32le-elf/lib/libdsp.a of the toolchain)
(2)Including header files provided by Andes DSP library. They are named according to function categories:
nds32_basic_math.h
nds32_complex_math.h
nds32_controller_math.h
nds32_filtering_math.h
nds32_matrix_math.h
nds32_statistics_math.h
nds32_transform_math.h
nds32_utils_math.h
AndeSight setting:
Attachment:
ldsp.png [ 12.24 KiB | Viewed 17969 times ]
Sample Code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <nds32_basic_math.h>
int main(void) {
float input1[3]={1.1,2.2,3.3};
float input2[3]={1.1,2.2,3.3};
float output[3];
nds32_add_f32(input1, input2, output, 3);
printf("result: 1,2,3= %f, %f, %f", output[0],output[1],output[2]);
return 0;
}
output
Attachment:
output.png [ 5.21 KiB | Viewed 17968 times ]
Attachment:
dsp_sim_sample.zip [57.38 KiB]
Downloaded 1643 times