espdev / csaps-cpp Goto Github PK
View Code? Open in Web Editor NEWEigen based C++11 implementation of cubic spline approximation (smoothing)
License: MIT License
Eigen based C++11 implementation of cubic spline approximation (smoothing)
License: MIT License
I was wondering if one can use csaps-cpp to smooth an array of complex numbers (for the y-data)? I believe one could split the complex data type y-arrays into two arrays, real and imaginary parts (doubles), and smooth them independently, but, it would likely be more convenient and performant to be able to just define the y-array as an Eigen::ArrayXcd (array of complex) if that were possible. Could this be done by templating some of your methods and adding an alias to Eigen::ArrayXcd in your code?
By the way, thanks so much for this code! Also many thanks for building your data types upon Eigen3. I find it MUCH easier to use libraries which are either build on the C++ STL for arrays or something nearly standard such as Boost or Eigen3 and your code apparently fits this.
Is this C++ implementation of CSAPS function compatible with MATLAB built-in implementation CSAPS (https://www.mathworks.com/help/curvefit/csaps.html), at least in the case of univariate signals? I mean especially definition of error/roughness weights and smoothing parameter "p".
I am using Eigen 3.4.0 and the csaps functionality to fit a smoothing spline. I am able to compile successfully (Visual Studio 2015) yet when I run the constructor instantiating the UnivariateCubicSmoothingSpline, I get an Access Violation Error that crashes my program. My syntax follows identically to the examples in the tests folder provided. My relevant code is below (error caused by line 115). Please let me know if you have any recommendation!
Im trying to create a smoothing spline with a dataset (it worked successfully in Matlab), but for some reason i keep getting this error when trying to create it:
Assertion failed: (m_factorizationIsOk && "The matrix should be factorized first"), function _solve_impl, file ./eigen-3.4.0/Eigen/src/SparseLU/SparseLU.h, line 317.
Do you know what could be causing a dataset to cause this error?
The code runs successfully in Linux.
In visual studio 2015, there is a compile error.
I modify
const DoubleArray SolveLinearSystem(const DoubleSparseMatrix &A,const DoubleArray &b);
to
const DoubleArray SolveLinearSystem(const DoubleSparseMatrix &A, DoubleArray &b);
,
then the error is solved.
Hi, can you please show me the equation of CubicSmoothingSpline used in your code?
I am attempting to smooth RF circuit (S-parameters) data vs frequency. The real and imaginary parts are smoothed separately as DoubleArrays and the frequency is in Hz and ranges up to 25E9 Hz. These high values in the frequency (x-axis) result in no smoothing until the smoothing parameter is set to something like 1E-25. To work around, I scale the x-axis, apply smoothing with a reasonable smoothing parameter, on the order of 0.8 or so, and then unscale the x-axis (frequency) to get back the original frequency scale.
This works but requires one to derive a scaling factor from the x-axis values, perhaps by using an average of the x-axis values?
If you like, I can send up an example program to illustrate.
Then again, I haven't looked deeply into this and the problem could well be my misunderstanding of how to use the software?
Thanks and best, Phil
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.