-  3.39.23
Functions
matfaust::tools Namespace Reference

The matfaust tools namespace. More...

Functions

function omp (y, D, varargin)
 Runs the greedy OMP algorithm optimized by Cholesky decomposition. More...
 

Detailed Description

The matfaust tools namespace.

Function Documentation

◆ omp()

function matfaust::tools::omp ( ,
,
varargin   
)

Runs the greedy OMP algorithm optimized by Cholesky decomposition.

Usage

    x=omp(y, D) runs the algorithm with the default configuration which is equivalent to x=omp(y, D, 'maxiter', length(y), 'verbose', false).
    x=omp(y, D, 'maxiter', N) stops the algorithm after N iterations.
    x=omp(y, D, 'tol', 10^-16) runs the algoritm until the relative error is lower or equal to 10**-16. This is equivalent to x=omp(y, D, 'tol', 10^-16, 'relerr', true)
    x=omp(y, D, 'maxiter', N, 'tol', 10^-16) runs at most N iterations until the tol precision is reached.
    x=omp(y, D, 'tol', 10^-16, 'relerr', false) runs the algorithm until the absolute error is lower or equal to 10**-16.

Parameters
yThe vector to approximate by D*x.
DThe dictionary as a matrix or a Faust.
'maxiter',number(optional) To define a maximum number of iterations (by default this length(y)).
'tol',number(optional) To define the error value used for the relative or absolute error (by default this is 0, for not stopping on any error criterion).
'relerr',true(optional) To define a stopping criterion based on the relative error (this is the default error).
'relerr',false(optional) To define a stopping criterion based on the absolute error.
'verbose',true(optional) To enable the verbosity.
'verbose',false(optional) To disable the verbosity (this is the default option).
Returns
x the solution of y = D*x (according to the error).

Example:

>> rng(42)
>> F = matfaust.rand(15, 10);
>> x = rand(10, 1)
x =
0.3745
0.9507
0.7320
0.5987
0.1560
0.1560
0.0581
0.8662
0.6011
0.7081
>> y = F * x;
>> x_ = matfaust.tools.omp(y, F)
Stopping. Exact signal representation found!
x_ =
0.3745
0.9507
0.7320
0.5987
0.1560
0.1560
0.0581
0.8662
0.6011
0.7081
matfaust
The FAuST Matlab Wrapper
Definition: bsl.m:1
matfaust::rand
function rand(M, N, varargin)
Generates a random Faust.
matfaust::tools::omp
function omp(y, D, varargin)
Runs the greedy OMP algorithm optimized by Cholesky decomposition.