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.
|
| 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).
|
| const std::vector< double > | sablib::BeadsExpandBoundaries (const std::vector< double > &y, const unsigned int n=400) |
| | Expands the signal boundaries by padding with a tapered sequence.
|
| const std::vector< double > | sablib::BeadsTrimBoundaries (const std::vector< double > &y, const unsigned int n=400) |
| | Trims the expanded signal boundaries.
|
Baseline estimation and subtraction using Baseline Estimation And Denoising using Sparsity(BEADS).
- Author
- Izadori
References:
Definition in file beads.h.
◆ BeadsPenalty
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.
◆ 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
-
| y | The input data. |
| s | Order of the derivative for baseline sparsity (typically 1 or 2). |
| frequency | Sampling frequency of the signal. |
| r | High-pass filter parameter (cut-off frequency relative to sampling frequency). |
| lambda0 | Sparsity parameter for the baseline. |
| lambda1 | Sparsity parameter for the first-order derivative of the signal. |
| lambda2 | Sparsity parameter for the second-order derivative of the signal. |
| loop | Maximum number of iterations. |
| eps | Convergence threshold. |
| penalty | Penalty type (L1_v1 or L1_v2). |
- Returns
- A tuple containing (baseline, denoised signal).
- Exceptions
-
| std::invalid_argument | One or more parameters are wrong. |
Definition at line 101 of file beads.cpp.
◆ BeadsExpandBoundaries()
| const std::vector< double > sablib::BeadsExpandBoundaries |
( |
const std::vector< double > & | y, |
|
|
const unsigned int | n = 400 ) |
Expands the signal boundaries by padding with a tapered sequence.
- Parameters
-
| y | The input data vector. |
| n | The number of elements to add at each end. |
- Returns
- A expanded vector.
- Exceptions
-
| std::invalid_argument | The length of y is zero. |
Definition at line 257 of file beads.cpp.
◆ BeadsTrimBoundaries()
| const std::vector< double > sablib::BeadsTrimBoundaries |
( |
const std::vector< double > & | y, |
|
|
const unsigned int | n = 400 ) |
Trims the expanded signal boundaries.
- Parameters
-
| y | The input data vector (expanded signal). |
| n | The number of elements to trim from each end. |
- Returns
- A trimmed vector.
- Exceptions
-
| std::invalid_argument | The length of y is zero or less than `2 * n`. |
Definition at line 282 of file beads.cpp.