2
$\begingroup$

I am looking to transition some of my MATLAB algorithms to C/C++ for deployment on target (PowerPC and/or ARM). Mostly 1D FIR/IIR filter in this instance.

In other domains, there are well-regarded general libraries (both speed and quality) with liberal licencing. For example, Linear Algebra has LAPACK and Eigen (amongst others), and computer vision has OpenCV.

There are well-regarded libraries for specific algorithms, such as FFTW, but what about a collection of general algorithms for 1D signals?

I'm not after DSP-specific libraries, such as for PIC32, CMSIS (ARM Cortex M4), DSPLIB (C64x) or Renesas, but nonetheless has similar functionality.

$\endgroup$
  • 1
    $\begingroup$ I've heard very good things about liquid DSP, but I haven't used it myself. $\endgroup$ – MBaz Nov 27 '14 at 1:11
  • 1
    $\begingroup$ I'll be frank and say that my library is not "well regarded" in the sense that hardly anyone knows about (i.e. it is not "regarded" at all :-) ), but it has lots of 1D DSP functionality. If you do find bugs in it, please let me know and I will be happy to fix them. github.com/JimClay/NimbleDSP $\endgroup$ – Jim Clay Nov 28 '14 at 13:50
5
$\begingroup$

Maybe a bit late, but since others might land here like me.

The following are good signal processing libraries/frameworks: * https://www.gnuradio.org/ - lots of classic signal processing + cascading options * https://root.cern.ch/ - advanced statistical signal processing Both provide generic facade, fall-back implementations as well as performance optimised sub-libraries (ie. fftw, atlas, LAPACK, gsl, VOLK, ...).

Together with OpenCV, these probably cover 90++% of use-cases.

| improve this answer | |
$\endgroup$
2
$\begingroup$

I was looking for a way of converting MATLAB code to C/C++ that I found Armadillo: http://arma.sourceforge.net/license.html. It's a C++ library covering various categories such as signal and image processing, statistics, matrix and vector, etc. For implementing a FIR filter for example, one can use the convolution (conv(A,B)) function.

| improve this answer | |
$\endgroup$
1
$\begingroup$

I have heard good things about eigen: http://eigen.tuxfamily.org/index.php?title=Main_Page

If you are on iOS I would look at: https://developer.apple.com/documentation/accelerate/vdsp

It is possible to call Matlab from C. But hardly portable or something you do for a product.

I have reimplemented parts of Matlab several times («a good Matlab programmer can write Matlab in any language»). It would have been nice to have a open source/debugged C library mirroring the core Matlab function signatures. Then we could focus on getting 0-based and 1-based counting, column-major vs row-major, Visual Studio not supporting C99/ complex float, and all of the other pifalls :-)

| improve this answer | |
$\endgroup$
1
$\begingroup$

I have used Matlab Coder/Embedded Coder/Simulink Coder toolboxes from Mathworks to convert Matlab/Simulink to C/C++. They work well. The code is easy to read and you can navigate from C/C++ to Matlab easily in the code generation report.

Pros :

  • The code is easy to read.
  • Integrates almost seamlessly with your code base.
  • Portable.

Cons :

  • Slightly slower than hand-written code
  • Expensive
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.