Main Module providing MP methods¶
Module mp¶
Greedy algorithms using the pymp objects¶
- PyMP.mp.mp(orig_signal, dictionary, target_srr, max_it_num, debug=0, pad=True, clean=False, silent_fail=False, debug_iteration=-1, unpad=False, max_thread_num=None)¶
Matching Pursuit Decomposition
This is the original, plain Matching Pursuit Algorithm
Parameters : orig_signal : Signal
the original signal (as a Signal object) to decompose
dictionary : BaseDico
the dictionary (as a Dico object) on which to decompose orig_signal
target_srr : float
a target Signal to Residual Ratio (SRR)
max_it_num : int
the maximum number of iteration allowed
debug : int, optional
requested debug level, default is 0
pad : bool, optional
whether to pad the signal’s edges with zeroes
Returns : approx : Approx
A Approx object encapsulating the approximant
decay : list
A list of residual’s energy across iterations
Other Parameters: clean : bool, optional
whether perform on the fly cleaning of atom’s waveforms to limit memory consumption
silent_fail : bool, optional
whether to allow energy increase when subtracting atoms
debug_iteration : int, optional
specify a specific iteration number at which the debug level should be raised to maximum
unpad : bool, optional
whether to remove added edges zeroes after decomposition
max_thread_num : int, optional
the maximum number of threads allocated
Raises : ValueError :
If a selected atom causes the residual signal’s energy to increase, see Signal.subtract()
See also
- greedy
- a decomposition method where the update strategy (MP, OMP, GP or CMP) can be set as a parameter
Notes
This is the original Matching Pursuit Algorithm transcribed to work with PyMP objects encapsulating signals and dictionaries It builds an approximant of as a linear combination of atoms from
Examples
For decomposing the signal x on the Dictionary D at either SRR of 10 dB or using 1000 atoms: x must be a Signal and D a Dico object
>>> approx, decay = mp.mp(x, D, 10, 1000)
- PyMP.mp.greedy(orig_signal, dictionary, target_srr, max_it_num, debug=0, pad=True, clean=False, silent_fail=False, debug_iteration=-1, unpad=False, update='mp', max_thread_num=None)¶
Common Greedy Pursuit Loop Options are detailed below:
Parameters : orig_signal : Signal
the original signal (as a Signal object) to decompose
dictionary : BaseDico
the dictionary (as a Dico object) on which to decompose orig_signal
target_srr : float
a target Signal to Residual Ratio (SRR)
max_it_num : int
the maximum number of iteration allowed
debug : int, optional
requested debug level, default is 0
pad : bool, optional
whether to pad the signal’s edges with zeroes
update : {‘mp’, ‘omp’, ‘locomp’, ‘locgp’}, optional
choice of update loop to consider
Returns : approx : Approx
A Approx object encapsulating the approximant
decay : list
A list of residual’s energy across iterations
Other Parameters: clean : bool, optional
whether perform on the fly cleaning of atom’s waveforms to limit memory consumption
silent_fail : bool, optional
whether to allow energy increase when subtracting atoms
debug_iteration : int, optional
specify a specific iteration number at which the debug level should be raised to maximum
unpad : bool, optional
whether to remove added edges zeroes after decomposition
max_thread_num : int, optional
the maximum number of threads allocated
Raises : ValueError :
If a selected atom causes the residual signal’s energy to increase, see Signal.subtract()
See also
- mp
- a decomposition method with plain mp only
Examples
For decomposing the signal x on the Dictionary D at either SRR of 10 dB or using 1000 atoms: x must be a Signal and D a Dico object
>>> approx, decay = mp.greedy(x, D, 10, 1000, 'mp')