espressif / esp-dsp

DSP library for ESP-IDF
Apache License 2.0
465 stars 87 forks source link

Feature request: Optimized FIR with int32_t (DSP-68) #7

Closed Patrik-Berglund closed 1 year ago

Patrik-Berglund commented 4 years ago

Hi,

Would be great if you could make an optimized FIR filter for int32_t.

Best Regards Patrik Berglund

Kameeno commented 4 years ago

why not just convert into float ?

float bufferConsumer::convert(const unsigned char *src, uint8_t index) { int i = src[0 + index] << 24 | src[1 + index] << 16 | src[2 + index] << 8; return i / (float)(INT_MAX - 256); }

i take my 24bit data and i get directly a float

for example: 0x7FFFFF = +1.0 0x800000 = -1.0 0xC00000 = - 0.5 0x400000 = + 0.5