Is it possible to get Spectral Features with int16 two's complement input data?

Hi,

I have an accelerometer that has 3 outputs of 16bit each, is it possible to use the Spectral Features block with it or does it require to convert it either to int8 or to float32?

It would be great if I can use int16 as it wouldn’t lose information and it would not require to have the data converted from int16 to float32 previously.

Thanks,
Julen

Hi @Julen,

You must convert any data being sent to an impulse (including impulses that use the spectral features block) to float. As you can see in the callback function here (example-standalone-inferencing/main.cpp at master · edgeimpulse/example-standalone-inferencing · GitHub), the C++ SDK expects raw data to be in floating point format:

// Callback: fill a section of the out_ptr buffer when requested
static int get_signal_data(size_t offset, size_t length, float *out_ptr) {
    for (size_t i = 0; i < length; i++) {
        out_ptr[i] = (features + offset)[i];
    }

    return EIDSP_OK;
}