About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconMatching pursuit for 1D signals (Scripts) Publisher's description

Performs matching pursuit (MP) on a one-dimensional (temporal) signal y with a custom basis B.

Performs matching pursuit (MP) on a one-dimensional (temporal) signal y with a custom basis B.

Matching pursuit (Mallat and Zhang 1993) is a greedy algorithm to obtain a sparse representation of a signal y in terms of a weighted sum (w) of dictionary elements D (y ~ Dw). Sparse means that most elements are equal to 0 (nnz(w) << length(y)). Such a sparse representation is useful in many different scenarios: to obtain time-frequency spectrograms, denoise signals, compress signals, etc.

For temporal signals, it's natural to use a dictionary of elements D composed of basis elements B shifted to every possible time point. In this case, the weights form of a convolutional or shift-invariant sparse code in a highly overcomplete dictionary:

y ~ r
r = sum_i conv(ws(:,i),B(:,i),'same')
and nnz(ws(:)) << length(y)

If B is equal to a bunch of windowed sinusoids, this representation forms a time-frequency decomposition of the signal. One application of this decomposition is EEG/MEG and LFP analysis (http://www.scholarpedia.org/article/Matching_pursuit).

Another application is expressing a sound signal as a sum of gammatone-like functions (Smith and Lewicki 2006) or chords (Blumensath and Davies 2006).

This implementation should be efficient enough for practical use. It precomputes all convolutions using the FFT and does not perform convolutions in the main loop. It uses a 3-level tree to search for the maximum correlation, and each iteration is O(sqrt(length(y))).

Function signature:
[ws,r] = temporalMP(y,B,nonnegative,maxiter,maxr2)

y: a mx1 signal
B: an nxp basis. n is the length of each basis function and p is
the number of such basis functions
nonnegative (optional): if true, uses a variant of MP where ws are
forced to be >= 0 (default false)
maxiter and maxr2 (optional): specifies when to stop iterating,
when #iterations > maxiter or the R^2 between y and r
is greater than maxr, whichever comes first (defaults: maxiter:
10000, maxr2: .999)

ws: an mxn matrix of weights
r: the approximation of y in terms of the weights and basis

Example use:
sig = load('gong.mat'); %included in matlab

%Build a basis of Gabors
rg = (-500:500)';
sigmas = exp(log(2):.3:log(200));
gabors = exp(-.5*(rg.^2)*sigmas.^(-2)).*cos(rg*sigmas.^(-1)*2*pi*2);

%Express signal as a sparse sum of Gabors
[ws,r] = temporalMP(sig.y,gabors,false,5000);

%See TryTemporalMP.m for more examples

System Requirements:

MATLAB 7.9 (2009b)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Matching pursuit for 1D signals (Scripts) Tags:

Click on a tag to find related softwares

Is Matching pursuit for 1D signals (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.