espressif / esp-dsp

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

IIR inconsistencies and documentation problems (DSP-123) #80

Open Bobobel opened 7 months ago

Bobobel commented 7 months ago

I do read all and that moreover several times!

Dear Dimitry! Your doing a great and valuable job. IIR is running, so no complaint from my side. But some little problems with results in irr example (LP).

Environment

Problem Description

1) if I call as is given in Espressif docs: dsps_fft2r_fc32aes3 with underline, I have to handle extra w resp. delay. Giving {0,0} as suggested and used for coef gen will result in completely irregular spectrum with max[33]=inf for N=1024 in your example. If I call dsps_fft2r_fc32_aes3 (not so discribed in the docs), I can avoid extra w and everything with spectrum for Q=1 (see below) ist OK.

2) I had a lot of problems with dsps_view's scalings. In a first attempt I could not find the cut-off frequency nor the drop down.

So maybe this will help other people: please use at least dsps_view(y_cf, N/2, 128, 49, -48, 0, '-') now each vertical step is 1dB (so far as I do understand it) and each horizontal step is sample_freq(fs)/N4. When you understand N=1024 as fs apporx. 1000 Hz you see 4Hz in each step. Now the cutoff is at xpos="26", that means 104Hz or 0.1 in the logic of dsp. you can also see a dropdown of -18dB upt to xpos="62", that is a span of 374=148Hz. Take 2/3 then you have -12dB for an octave as expected for "biquad". With that knowledge I could even reproduce the position and amount of Q=10 "buggle". Nice!

3) dsps_view_spectrum: I do not see any spectrum if I input a signal as suggested in the docs. I is more or less same as dsps_view when you handle power spectrum data. It shows without asking '|' char plot.

4) I did not find any speedup for the IIR calculation with ESP32S3 optimized code (dsps_biquad_f32_aes3) againt pur _f32

Expected Behavior

Could you please expand the poor documentation for not sooo (!) experienced users? Same holds for the use of the delay, for which I do not find any doc. Same holds for the use of the dsps_view_spectrum: what is its benefit?

Actual Behavior

Steps to repropduce

use your example!

Thanks for the nice component.