Have a question? Email: toh@umd.edu
or join our group on Facebook
What does Google rate as the most highly
praised science software? Try
this search.
This page describes a series of downloadable Matlab
interactive signal processing tools for x,y timeseries data.
Technical background, documentation, and examples of application
are provided in "A Pragmatic Introduction to Signal
Processing", available in HTML and
PDF formats.
The interactive functions listed on this page run
in the Figure window and use a simple set of keystroke commands,
rather than onscreen buttons or menus or sliders, in order to
reduce screen clutter, minimize overhead, and maximize
processing speed. Press K
to see the list of keystroke commands within each program. The
Figure window can be resized as you wish, including maximized
to fullscreen to see the maximum detail in the signals, and can
be Saved in various formats, Copy/Pasted, or Printed, using the
standard Matlab menus. My goal is to make these programs very
easy to get working, with flexible input syntax, builtin help,
extensive online documentation, and many
simple examples that you can copy and paste into your Matlab
command window. Note:
all of the scripts and functions described below are written as
selfcontained Matlab functions (mfiles) and require no addon
toolboxes to run. They have been developed and tested in Matlab
7.8 R2009a and in Matlab 8.1 R2013a.
Peak Finding and MeasurementMatlab routines for locating and measuring the peaks (or valleys) in noisy timeseries data sets. It detects peaks by looking for downward zerocrossings (or upward zerocrossings for valleys) in the smoothed first derivative then determines the position, height, and width of each peak by leastsquares curvefitting of the raw data near the detected peaks. (This is useful primarily for signals that have several data points in each peak, not for spikes that have only one or two points).There are both commandline and interactive versions: (1) a set of commandline functions for
Matlab and Octave,
for finding peaks in signals and measuring
their positions, heights, widths, and areas by
leastsquares curvefitting, especially useful
as modules to use in your own custom scripts
and functions to automate data processing.
These include findpeaksb3.m, findpeaksplot.m,
findpeaksplotL.m,
findpeaksx,
findpeaksG.m, findvalleys.m, findpeaksL.m, findpeaksb.m,
peakstats.m, findpeaksnr.m,
findpeaksE, findpeaksGSS.m, findpeaksLSS.m, findpeaksT.m,
and findpeaksfit.m.
These can be used as components in creating
your own custom scripts and functions. Don't
confuse with the "findpeaks"
function in the Signal
Processing Toolbox.
These tools are the ones to use when (a)
the quantities of greatest interest are the peak positions
and amplitudes of the positive peaks in your signal, (b)
the peaks have distinct (even if noisy) maxima, and (c)
when you want all the peaks numbered and quantified
in one operation. You can use the interactive iPeak function
to determine the ideal input arguments for the findpeaks.m and findpeaksfit.m
commandline functions. Note: the latest version of
iPeak can perform iterative nonlinear curve
fitting on the peaks that it finds, using the builtin peakfit.m
function (described below); this is useful for highly
overlapped or nonGaussian peaks. For some demos,
download idemos.zip.
(2) a Matlabonly interactive keypressoperated function (iPeak) for adjusting the peak detection criteria interactively to optimize peak detection and measurement, for Matlab. There is an animated demonstration. 


Interactive smoothing and differentiation Frequency spectrum mode 




Hyperlinear quantitative absorption spectroscopyMatlab implementation of a computational method for quantitative analysis by multiwavelength absorption spectroscopy, called the transmissionfitting or “TFit” method, based on measuring the underlying absorbance by fitting a model of the instrumentallybroadened transmission spectrum to the observed transmission data, rather than by direct calculation of absorbance as simply log10(Izero/I).Advantages of the TFit method compared to conventional
methods are: (a) wider dynamic range; (b) greatly
improved calibration linearity;
(c) ability to operate under conditions that are
optimized for signaltonoise
ratio ratio
rather than for optical ideality. With a linear
response, absorbance can be converted to concentration
simply by multiplying by a constant factor. Just like the multilinear regression
(classical least squares) methods
conventionally used in absorption spectroscopy, the Tfit
method (a) requires an accurate reference spectrum of
each analyte, (b) utilizes multiwavelength data such as
would be acquired on diodearray, Fourier transform, or
automated scanning spectrometers, and (c) applies both
to singlecomponent and multicomponent mixture analysis. tfit.m is a commandline demo function for Matlab or Octave. TFitDemo.m is an interactive demo mfile that works in recent versions of Matlab. Version 2.1, November 2011. 

iPower: Interactive Power Spectrum DemoMatlab keyboardcontrolled interactive power spectrum demonstrator, useful for teaching and learning about the power spectra of different types of signals and the effect of signal duration and sampling rate. Single keystrokes allow you to select the type of signal (12 different preset signals included), the total duration of the signal, the sampling rate, and the global variables f1 and f2 which are used in different ways in the different signals. If you know some basic Matlab programming, you can even add your own custom signal functions to this program. When the Enter key is pressed, the signal (y) is sent to the Windows WAVE audio device. Press K to see a list of all the keyboard commands. Tested in Matlab version 7.8 (R2009a).Click here to view or download. You can also download it from the Matlab File Exchange. Version 2, October 2011 

Diffraction
Grating Demos
A set of
keyboardcontrolled interactive demonstration modules,
written as selfcontained Matlab functions, that are useful
for learning and teaching the
principles of diffraction
gratings. Shows a working cross
section
of the geometry of a diffraction grating (a common
illustration in textbooks of optics, spectroscopy, and
analytical chemistry). Single keystrokes allow you to
control such variables as the angle of incidence, grating
ruling density, wavelength, and diffraction order. One module
shows how the operation of a
diffraction grating emerges naturally just by adding up a
bunch of sine waves, without any higher math at all.

(a) Make sure you don't click on the “Show Plot Tools” button in the toolbar above the figure; that will disable normal program functioning. If you do; close the Figure window and start again.Background information on these and other signal processing methods is available in:
(b) To facilitate transfer of settings from one of these functions to another or to a commandline version,all these functions use the W key to print out the syntax of other related functions, with the pan and zoom settings and other numerical input arguments specified, ready for you to Copy, Paste and edit into your own scripts or back into the command window. For example, you can convert an curve fit from ipf.m into the commandline peakfit.m function; or you can convert a peak finding operation from ipeak.m into the commandline findpeaksG.m or findpeaksb.m or findpeaksb3.m functions.
(c) Recent versions of these three programs use the ShiftCtrlS, ShiftCtrlF, and ShiftCtrlP keys to transfer the current signal between iSignal.m, ipf.m, and iPeak.m
"Your Interactive Peak Fitter ... is very helpful."
"Your peak finding and fitting scripts ... turned out handy in analyzing my research
data."
"I found your peakfit.m program and it is great  thank you very much for sharing it!"
"...the codes for finding peaks and mathematical fits to
noisy data...were very helpful
for my experimental work."
"I appreciate all the work that must have gone into the PeakFit matlab coding. I've been using it for a couple of weeks, now, and it is becoming extremely useful."
"Thank you for your Matlab function findpeaks(). It is quite literally EXACTLY what I was looking for and far better than I could have hoped."
"Thank you so much for designing and creating MATLAB code for scientists! It's such a great resource to have code on MATLAB Central. I really appreciate your efforts."
"Thank you for making available your absolutely superb Peakfinder software. It is a snap to use...." "Wonderful program."
Copyright (c) 2014, 2016 Thomas C. O'Haver
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.