sablib
Loading...
Searching...
No Matches
beads.h File Reference

Baseline estimation and subtraction using Baseline Estimation And Denoising using Sparsity(BEADS). More...

#include <stdexcept>
#include <tuple>
#include <vector>

Go to the source code of this file.

Enumerations

enum class  sablib::BeadsPenalty { L1_v1 , L1_v2 }
 Penalty types for the BEADS algorithm.(see Table 1 in Duval's paper). More...

Functions

const std::tuple< std::vector< double >, std::vector< double > > sablib::BaselineBeads (const std::vector< double > &y, const unsigned int s, const double frequency, const double r, const double lambda0, const double lambda1, const double lambda2, const unsigned int loop=30, const double eps=1e-3, const BeadsPenalty penalty=BeadsPenalty::L1_v2)
 Performs baseline estimation and denoising using Sparsity (BEADS).

Detailed Description

Baseline estimation and subtraction using Baseline Estimation And Denoising using Sparsity(BEADS).

Author
Izadori

References:

Definition in file beads.h.

Enumeration Type Documentation

◆ BeadsPenalty

enum class sablib::BeadsPenalty
strong

Penalty types for the BEADS algorithm.(see Table 1 in Duval's paper).

Enumerator
L1_v1 

Penalty type 1, using phi-B(x) function and it's derivative.

L1_v2 

Penalty type 2, using phi-C(x) function and it's derivative.

Definition at line 24 of file beads.h.

Function Documentation

◆ BaselineBeads()

const std::tuple< std::vector< double >, std::vector< double > > sablib::BaselineBeads ( const std::vector< double > & y,
const unsigned int s,
const double frequency,
const double r,
const double lambda0,
const double lambda1,
const double lambda2,
const unsigned int loop = 30,
const double eps = 1e-3,
const BeadsPenalty penalty = BeadsPenalty::L1_v2 )

Performs baseline estimation and denoising using Sparsity (BEADS).

Parameters
yThe input data.
sOrder of the derivative for baseline sparsity (typically 1 or 2).
frequencySampling frequency of the signal.
rHigh-pass filter parameter (cut-off frequency relative to sampling frequency).
lambda0Sparsity parameter for the baseline.
lambda1Sparsity parameter for the first-order derivative of the signal.
lambda2Sparsity parameter for the second-order derivative of the signal.
loopMaximum number of iterations.
epsConvergence threshold.
penaltyPenalty type (L1_v1 or L1_v2).
Returns
A tuple containing (baseline, denoised signal).
Exceptions
std::invalid_argumentOne or more parameters are wrong.

Definition at line 70 of file beads.cpp.