Code covered by the BSD License
-
P=ipeak(DataMatrix,PeakD,AmpT...
Version 3.91, FitW now equals number of points, not number of intervals;
-
AmpTSlider(n,h)
Changes AmpThreshold when the AmpThreshold slider is moved.
-
BGSlider(n,h)
Called when the BG slider is clicked.
-
FitSlider(n,h)
Changes FitWidth when the FitWidth slider is moved.
-
P=findpeaks(x,y,SlopeThreshol...
function P=findpeaks(x,y,SlopeThreshold,AmpThreshold,smoothwidth,peakgroup)
-
P=findpeaks(x,y,SlopeThreshol...
function P=findpeaks(x,y,SlopeThreshold,AmpThreshold,smoothwidth,peakgroup,smoothtype)
-
P=findpeakslidersRedraw(x,y,S...
Redraws graph for FindPeakSliders when slider are moved.
-
PeakSlider(n,h)
Changes PeakNumber when the Peak slider is moved.
-
SlopeTSlider(n,h)
Changes SlopeThreshold when the SlopeThreshold slider is moved.
-
SmoothSlider(n,h)
Changes SmoothWidth when the SmoothWidth slider is moved.
-
V=findvalleys(x,y,SlopeThresh...
function P=findvalleys(x,y,SlopeThreshold,AmpThreshold,smoothwidth,peakgroup,smoothtype)
-
[index,closestval]=val2ind(x,...
Returns the index and the value of the element of vector x that is closest to val
-
d=deriv(a)
First derivative of vector using 2-point central difference.
-
d=secderiv(a)
Second derivative of vector using 3-point central difference.
-
exp(-((x-pos)./(0.6006.*wid))...
-
lorentzian(x,position,width)
-
rtslid(fig,f,hh,varargin)
RTSLID Slider widget that responds to dragging realtime
-
smoothwidth. Works well with ...
-
sy=condense(y,n)
Condense y by a factor of n, where n is a non-zero positive integer.
-
Demo4peaks.m
-
DemoFindPeak.m
-
DemoFindPeak.m
-
DemoFindPeakSliders.m
-
DemoFindPeakSliders2.m
-
DemoFindPeakSlidersG.m
-
FindPeakSliders.m
-
FindPeakSlidersG.m
-
RedrawPeak.m
-
TestPeakfind.m
-
ipeakdemo.m
-
ipeakdemo1.m
-
ipeakdemo2.m
-
ipeakdemo3.m
-
ipeakdemo4.m
-
View all files
from
Peak finding and measurement
by Tom O'Haver
Function to locate and measure the positive peaks and valleys in noisy data sets.
|
| Demo4peaks.m |
% A self-contained interactive demonstration of iPeak applied
% to a data set containing four simple peaks with increasing peak height
% and peak width. Use this to understand the difference between the
% variables SlopeThreshold (SlopeT), which discriminates on the basis
% of peak width, and AmpThreshold (AmpT), which discriminates on the
% basis of peak amplitude. Peak number and the estimated position, height,
% and width of each peak is returned in the matrix P.
% Tom O'Haver (toh@umd.edu). Version 1.6 October 26, 2006
warning off MATLAB:polyfit:RepeatedPointsOrRescale
format compact
close
clear
global x
global y
global SlopeThreshold
global AmpThreshold
global SmoothWidth
global FitWidth
global PeakNumber
global P
figure(1);clf
% Simulate data set
increment=1;
x=[1:increment:400];
% For each simulated peak, enter the amplitude, position, and width below
amp=[2 3 4 5]; % Amplitudes of the peaks
pos=[50 125 200 300]; % Positions of the peaks
wid=[20 40 60 80]; % Widths of the peaks
Noise=.04;
% A = matrix containing one of the unit-amplidude peak in each of its srow
A = zeros(length(pos),length(x));
for k=1:length(pos)
if amp(k)>0, A(k,:)=gaussian(x,pos(k),wid(k)); end; % Or you can use any other peak function
end
z=amp*A; % Multiplies each row by the corresponding amplitude and adds them up
y=z+Noise.*randn(size(z));
% Call the interactive findpeaks script
P=iPeak(x,y);
|
|
Contact us at files@mathworks.com