kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.66k stars 253 forks source link

Poor documentation #168

Open MatthieuMv opened 1 year ago

MatthieuMv commented 1 year ago

Hello,

I want to use KFR for business purposes (and thus, pay the license). However, I am disappointed by the poor documentation. Do you plan to enhance developer experience in the future ?

Thank you

dancazarin commented 1 year ago

Hello,

Documentation is constantly being improved, new guides and how to’s are on the way.

Could you elaborate what topics in the documentation you are most interested in?

There are also priority tech support for all purchasers of commercial license.

MatthieuMv commented 1 year ago

Thank you for this fast answer @dancazarin. It would be great if at least user functions/classes have a small description about its usage and parameters.

For example, let's consider the following function:

zpk<T> iir_lowpass(const zpk<T>& filter, identity<T> frequency, identity<T> fs = 2.0)

The argument 'fs' is not clear, I had to check this example to see that you pass 48'000 and deduce that this is the sample rate and that the frequency is not normalized.

However, if we take the low pass design function of FIR, it is very well commented:

/**
 * @brief Calculates coefficients for the low-pass FIR filter
 * @param taps array where computed coefficients are stored
 * @param cutoff Normalized frequency (frequency_Hz / samplerate_Hz)
 * @param window pointer to a window function
 * @param normalize true for normalized coefficients
 */
template <typename T, univector_tag Tag>
void fir_lowpass(univector<T, Tag>& taps, identity<T> cutoff, expression_handle<T>& window, bool normalize = true) 

Another example is DSP naming: functions like "to_sos" or structs like "zpk" are not self explanatory, a comment would be great when you don't know maths abbreviations. I often end-up in MatLab documentation to understand what's happening.

KFR seems to be one of the best C++ DSP library but it is hard for DSP newcomers (like me) to understand and use: more in-code documentation could help a lot.

PS: I think there is a typo in the section title here "Biquad Peak filter (0.3, 3, -2dB)" should be "Biquad Bandpass filter (0.25, 0.2)"

Thank you for your time and have a nice day.

dancazarin commented 1 year ago

@MatthieuMv Thank you for providing these details. The documentation should definitely be expanded to include the description of newer features such as IIR filter design. Naming mainly follows python numpy library and is compatible with it in terms of parameters and ranges.

Thank you for catching the typo.