| Interactive differentiation script for your own data, with sliders to control derivative order, smooth width, and scale expansion. Requires Matlab 6.5. To use it, place your signal in the global variables "x" and "signal" and then execute this m-file. Use the Order and Smooth sliders to change the derivative order and smooth width. Use the Scale slider to expand or contract the y-axis scale. The smoothed derivative is placed in global variable "derivative". The actual differentiation is performed by the function InteractiveDerivativeRedraw, which is called when the sliders are moved. If you wish, you can change the maximum range of the smooth width slider (MaxSmoothwidth in line 14) and the maximum range of the derivative order slider (MaxDerivativeOrder in line 15). You can also change the smoothing function by replacing "fastsbmooth" in InteractiveDerivativeRedraw with any other smoothing function. InteractiveDerivativeTest is a simple test of InteractiveDerivative; it generates a synthetic signal assigned to "signal", then calls InteractiveDerivative. |
Demonstration of the application of differentiation to
the detection of peaks superimposed on a strong, variable
background. Requires Matlab 6.5. Generates a signal peak, adds random noise and
a variable background, then differentiates and smooths it, and
measures the signal range and signal-to-noise ratio (SNR).
Interactive sliders allow you to control the following variables:Amp: The amplitude (peak height) of the signal peak. |
The second video, 17-second, 1.1 MByte, (DerivativeBackground2.wmv ) demonstrates the measurement of a weak peak buried in a strong sloping background. The amplitude (Amp) of the peak is varied between 0 and 0.14, but the background is so strong that the peak, located at x = 500, is hardly visible. Then the 4th derivative (Order=4) is computed and the scale expansion (Scale) is increased, with a smooth width (Smooth) of 88. Finally, the amplitude (Amp) of the peak is varied again, but now the changes in the signal are now quite noticable and easily measured.
Tom O'Haver
Professor Emeritus
Department of Chemistry and Biochemistry
The University of Maryland at College Park
toh@umd.edu
http://www.wam.umd.edu/~toh
Number of unique visits since May 17, 2008: