Use the DSP cores. There is a library for that: https://github.com/espressif/esp-dsp?tab=readme-ov-file