Andes Workshop

It is currently Sun Oct 13, 2024 4:34 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to use Andes DSP library
PostPosted: Wed May 06, 2015 3:57 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
(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
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
output.png [ 5.21 KiB | Viewed 17968 times ]

Attachment:
dsp_sim_sample.zip [57.38 KiB]
Downloaded 1643 times


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group