mp v.III ** 1996-1999 ** D. Ircha & P.J. Durka ** Warsaw University *
Matching Pursuit signal analysis with time-frequency Gabor dictionaries
                 info & current versions at http://brain.fuw.edu.pl/~mp
DESCRIPTIONS & OPTIONS | BUILT-IN COMMANDS | EXAMPLE

<<< FUNCTIONS / COMMANDS >>>

addpath add new path for scripts
countbook count sets of atoms (decompositions) stored in a "book" file
echo echo a string
fft FFT spectrum of signal or residuum
list print command names w/1-line descriptions
loadasc load signal from ASCII file
loadascbook load ASCII file with MP results ("book")
loadbook load binary (v.III) file with MP results ("book")
loadfloat load signal from [multichannel multiplexed] file of floating point numbers
mp run Matching Pursuit on loaded signal, according to set parameters
mp_chan_float_rott batch analysis: floats, "natural" border conditions
mp_chan_float_sim batch analysis: floats, simmetric border conditions
mp_chan_int_rott batch analysis: integers, "natural" border conditions
mp_chan_int_sim batch analysis: integers, simmetric border conditions
norm signal normalization: sig -> (sig-aver(sig))/var(sig)
path set search path for scripts (*.mps)
quit quit=exit
reconst save signal's reconstruction
reinit reinitialize the dictionary
reset_sig set current signal to zeros
resetdic reset probability distribution of scales to defaults
save save MP results (a "book") in binary (v.III) format
saveascbook save ASCII file with MP results ("book")
saveoldbook save MP results (a "book") in "old" (pre-v.III) format
set settings (decompositon & signal parameters etc.)
setinfo set INFO field for book's file header (v.III binary)
showbook display parameters of fitted atoms (current book)
showdic save dictionary's structure
showdist print density of atoms at scales
showinfo show current INFO field for book's file header
showtitle show currently set printout's title
tf2gif save time-frequency - Wigner(MP) - map, in GIF or raw format
tf2ps time-frequency - Wigner(MP) - map, in PostScript
title set printout's title
tunedic set probability distribution of scales
type type the signal and residuum values
ver program version info
view display t-f representation of current signal's decomposition (java)
write save signal/residuum to disk

<<< BUILT-IN COMMANDS >>>

exit-leave shell
ls-current directory listing
history [nr]-display entered commands or execute [nr] if given
batch-run commands from file
!cmd-run a shell command cmd
man-display all available help
sys cmd-run shell command cmd in script
<TOP|

<<< DESCRIPTIONS & OPTIONS >>>

fft - FFT of signal or residuum
-O filename (default fftsig.asc)
-w val window: 1-Parzen (default), 2-square, 3-Welch
-o FFT of the signal (default)
-r FFT of the residuum
-p phase spectrum
-a amplitude spectrum (default)
<TOP|

loadasc - load signal from ASCII file
-O filename
-S simmetric border conditions
-L left border condition
-R right border condition
-C signal (default)
<TOP|

loadascbook - load ASCII file with MP results ("book")
-O filename
-L create current signal from book's reconstruction
<TOP|

loadbook - load binary (v.III) file with MP results ("book")
-O filename
-# val offset of book in file
-L create current signal from book's reconstruction
<TOP|

loadfloat - load signal from [multichannel multiplexed] file of floats i.e. floating point 4-byte numbers (Intel)

-O filename
-e val reference channel #1
-f val reference channel #2
-L left border condition
-R right border condition
-C signal (default)
-# val offset
-c chan which channel (counting from 1, not 0)
-h num_chan number of channels in file
-s shift number of bytes to skip (e.g. file header)
i.e. read from shift+offset*epoch_size*num_chan+chan
<TOP|

loadint - load signal from integer [multichannel multiplexed] file
-O filename
-e valreference channel #1
-f valreference channel #2
-L left border condition
-R right border condition
-C signal (default)
-# offset
-c chanchannel (counting from one, not zero)
-h num_channumber of channels in file
-s shiftnumber of bytes to skip (e.g. file header)
i.e. read from shift+offset*epoch_size*num_chan+chan
<TOP|

mp_chan_float_rott - batch analysis: floating point numbers (4 byte, Intel), "natural" border conditions, subsequent epochs of one channel, multichannel data multiplexed. Border conditions for each decomposition use most of the information about previous and next epochs.
-O filenamesignal file
-c channelwhich channel
-h num_chan number of channels in file
-# offset start from
-M offset stop at
-s shift
-I filename results (output) file ("book")
-R reinitialize dictionary before each decomposition
-e r1 reference channel (electrode) #1
-f r2 reference channel (electrode) #2
i.e.: if set, x(channel) -> x(channel)-(x(r1)+x(r2))/2
<TOP|

mp_chan_float_sim - batch analysis: floating point numbers (4-byte, Intel), simmetric border conditions, subsequent epochs of one channel, multichannel data multiplexed, simmetric border conditions.
-O filenamesignal file
-c channelwhich channel
-h num_chan number of channels in file
-# offset start from
-M offset stop at
-s shift
-I filename results (output) file ("book")
-R reinitialize dictionary before each decomposition
-e r1 reference channel (electrode) #1
-f r2 reference channel (electrode) #2
i.e.: if set, x(channel) -> x(channel)-(x(r1)+x(r2))/2
<TOP|

mp_chan_int_rott - batch analysis: integers, "natural" border conditions, subsequent epochs of one channel, multichannel data multiplexed, border conditions for each decomposition use most of the information about previous and next epochs
-O filenamesignal file
-c channelwhich channel
-h num_chan number of channels in file
-# offset start from
-M offset stop at
-s shift
-I filename results (output) file ("book")
-R reinitialize dictionary before each decomposition
-e r1 reference channel (electrode) #1
-f r2 reference channel (electrode) #2
i.e.: if set, x(channel) -> x(channel)-(x(r1)+x(r2))/2
<TOP|

mp_chan_int_sim - batch analysis: integers, simmetric border conditions, subsequent epochs of one channel, multichannel data multiplexed
-O filenamesignal file
-c channelwhich channel
-h num_chan number of channels in file
-# offset start from
-M offset stop at
-s shift
-I filename results (output) file ("book")
-R reinitialize dictionary before each decomposition
-e r1 reference channel (electrode) #1
-f r2 reference channel (electrode) #2
i.e.: if set, x(channel) -> x(channel)-(x(r1)+x(r2))/2
<TOP|

norm - normalization of current signal, substracting average and dividing by variance: sig -> (sig-aver(sig))/var(sig)
<TOP|

path (addpath) - set (add to) search path for scripts. Scripts (in examples named *.mps) - ASCII files, containing hereby listed commands - can be used to extend functionality e.g. by calling external programs, or to perform batch decompositions of large amounts of data.
<TOP|

reconst - save signal's reconstruction
-O filename
-S all calculations (default)
-M save table with all fitted atoms in time domain
-R save residuum
-m val reconstruct atom fitted as number val only
<TOP|

reinit - reinitialize the dictionary
-R valnumber of (Gabor) atoms
-i + | - initialize random numbers generator
-d + | -use dyadic dictionary structure (scale = 2^j)
<TOP|

resetdic - reset probability distribution of scales to defaults, i.e. return to the default distribution of the parameters of dictionary's atoms
<TOP|

save - save MP results (a "book") in binary (v.III) format
-A fileadd current book to file
-a add current book to file book.b
-S file create a new file with current book
-s create new file 'book.b' with current book
<TOP|

saveascbook - save ASCII file with MP results ("book")
-A fileadd current book to file
-a add current book to file book.b
-S file create a new file with current book
-s create new file 'book.b' with current book
<TOP|

saveoldbook - save MP results (a "book") in "old" (pre-v.III) format
-A fileadd current book to file
-a add current book to file book.b
-S file create a new file with current book
-s create new file 'book.b' with current book
<TOP|

set - settings
-M val max number of algorithm's iterations
-A val increase max number of algorithm's iterations by val
-E val stop iterations after explaining val % of energy
-P +|- messages on|off (+|-)
-I +|- decomposition progress info on|off (+|-)
-O val signal size (val points)
-F val signal sampling frequency [Hz]
-C val signal calibration constant [usually points/microVolt]
-B val book filename
-T use dyadic dictionary (default stochastic)
-S val oversampling (for dyadic dictionary)
-h +|- use heuristic acceleration
-N val number of atoms for trial dictionary
-o val range of scales for heuristic
-f val range of frequencies for heuristic
-p val range of atom's positions for heuristic
<TOP|

setinfo - set text for the INFO field for book's file header (v.III binary). This ASCII field is stored in the binary "book" with results of MP decomposition (v.III) and can be used for any comments re. decomposed signal etc. For the complete format of binary files with MP results please consult accompanying examples of programs on C.
<TOP|

showdic - save dictionary's structure
-O filename(default dict.dat)
-r + | -histogram
-d + | -atom's parameters
<TOP|

showinfo - show current text to be written for the INFO field of book's file header (v.III binary). This ASCII field is stored in the binary "book" with results of MP decomposition (v.III) and can be used for any comments re. decomposed signal etc. For the complete format of binary files with MP results please consult accompanying examples of programs in C.
<TOP|

tf2gif - - time-frequency - Wigner(MP) - map, in GIF or raw format
-O file output GIF filename
-F val gamma correction coefficient (default 1)
-L log energy scale
-B file save "raw" t-f map (floats) in file
-b save "raw" t-f map (floats) in 'image.raw'
-X val horizontal dimension (points)
-Y val vertical dimension (points)
-a file average map using all the atoms in file
-s add (currently loaded) signal to the averaged map
-d map of dispersion (averaged map)
-l val laplasjan 0--3
-R reverse input signal on plot (sig -> -sig)
-S val (default 1) show lower 1/val of frequencies
-c color (default)
-g shades of gray
-k val cut off high values - may improve dynamics, experimental
-x val string on printout - default as set by 'title'
<TOP|

tf2ps - time-frequency - Wigner(MP) - map, in PostScript
-O file output PS filename
-F val gamma correction coefficient (default 1)
-L log energy scale
-B file save "raw" t-f map (floats) in file
-b save "raw" t-f map (floats) in 'image.raw'
-X val horizontal dimension (points)
-Y val vertical dimension (points)
-a file average map using all the atoms in file
-s add (currently loaded) signal to the averaged map
-d map of dispersion (averaged map)
-l val laplasjan 0--3
-R reverse input signal on plot (sig -> -sig)
-S val (default 1) show lower 1/val of frequencies
-c color (default)
-g shades of gray
-k val cut off high values - may improve dynamics, experimental
-x val string on printout - default as set by 'title'
-N no blobs numbers on printout
TO DECIDE:

-i val - (integer) font size in points (default 8)
-p val - number of points per microVolt
-g val - max number of pages on book printout
-F val - gamma correction coeff. (default 1)
-B file - read atoms ("book") from file
<TOP|

title (showtitle) - set (show) string to be printed in pictures produced by tf2ps and tf2gif
<TOP|

tunedic - set probability distribution of scales
-f filename distribution from file
-o val,val distribution for a single element
<TOP|

view - display t-f representation of current signal's decomposition (java). If java binaries (v. 1.2 or newer) is installed in your system, java application will be called, allowing e.g saving of the interactively reconstructed signal. Otherwise, netscape is called with security restrictions.
To use this function please install java binaries (jdk, jre etc.) or netscape v. 4.6 or newer.
option(s):
-v jdk | jre | hotjava | netscape | auto(default auto)
<TOP|

write - save signal/residuum to disk file
-O filename (default 'signal.asc')
-x save original signal (default residuum)
-a include border conditions
<TOP|

<<< A SIMPLE EXAMPLE >>>

this example illustrates basic usage of commands for loading a signal, running MP decomposition and viewing results in the time-frequency plane

Suppose we have the ASCII file chirp2.txt in the current directory; let's load it:

loadasc -O chirp2.txt
If the program does not complain about the size of the signal being different from the basis dimension (for which the dictionary is constructed, default 512 points, changed with set -O), we can run Matching Pursuit (with default simmetric border conditions) by simply typing
mp
After some time ;-) when the iterations are finished (the progress is displayed on screen, unless you set -P- or set -I-) you may try
view
If java binaries or netscape v. 4.6 or newer is installed on Your machine, a window should appear, displaying the computed representation, and letting yoy click&play with reconstructions. That's it!

This representation was computed with the default dictionary of 70000 Gabor functions, drawn from flat distributions of parameters, plus complete Dirac and Fourier bases (stochastic dictionary), no heuristic acceleration and settings equivalent to

set -M 32
set -E 95
i.e. stop after 32 iterations or after explaining 95% of signal's energy, whichever comes first.
To enjoy a more detailed representation, we can type e.g.:
reinit -R 1000000
set -M 100
set -E 99
mp
view
...which uses dictionary of 10^6 Gabor atoms, and tries to parametrize 99% of signal's energy, unless more than 100 iterations would be required.
<TOP|