majianjia / nnom

A higher-level Neural Network library for microcontrollers.
Apache License 2.0
820 stars 235 forks source link

Audioconversion from 32 bit to 16 bit #126

Open tnentwig opened 3 years ago

tnentwig commented 3 years ago

Hi Mr. Ma,

many thanks for your great work! I evaluate nnom on windows for later use on MCUs, but I have a problem with your KWS example. All values of the dense output are max values (127 as int).

When I was looking for the cause, I wondered if the quantisation of 32bit audio to 16bit audio with

SaturaLH((p_raw_audio[i] >> 8)*1, -32768, 32767);

should be

p_raw_audio[i] >> 16;

instead?