mohabouje / eDSP

A cross-platform DSP library written in C++ 11/14. This library harnesses the power of C++ templates to implement a complete set of DSP algorithms.
https://mohabouje.github.io/edsp-docs/
GNU General Public License v3.0
191 stars 33 forks source link

eDSP filter #20

Open SloHanna opened 2 years ago

SloHanna commented 2 years ago

Hello Mohammed! I'm trying to use your eDSP include files (without library generation) in my project. I have faced with problems when apply the filter.hpp conponents.

In particular when I tried to create Low Pass Filter object: auto flt = filter::designer<float, filter::designer_type::Butterworth, 50>().design(50, file_sample_rate, signal_bandwidth); // float Type, filter taps count 50 compiler gives 0 errors. But further when I'm trying to filter complex data: flt.filter(data.begin(), data.end(), data_out.begin()); // all data's are std::complex type compiler gives an error: C2664 'T edsp::filter::biquad_cascade<T,25>::tick(T) noexcept': cannot convert argument 1 from 'std::complex' to 'T' d:\eDSP-master\include\edsp\filter\biquad_cascade.hpp 220

When I change filter taps count to 51 a debug error apears during of program execution: Expected a real number Assertion failed: condition && msg.data(), file d:\eDSP-master\include\edsp\meta\expects.hpp, line 43

When I try to create filter with complex data: auto flt = edsp::filter::designer<std::complex, filter::designer_type::Butterworth, 50>().design(50, file_sample_rate, signal_bandwidth); compiler gives an error: C2677 binary '*': no global operator found which takes type 'const T' (or there is no acceptable conversion) d:\eDSP-master\include\edsp\filter\internal\butterworth_designer.hpp 52

Can you explaine me what did I wrong? Some working example will be very useful. Or probably I've detected bugs in your library ;-)

My environment is MS VS2019

With respect, Hanna