Code covered by the BSD License
-
DerivativeBackground(n,h)
Re-draws graph when Background slider is changed
-
DerivativeHeight(n,h)
Re-draws graph when Amp slider is changed
-
DerivativeNoise(n,h)
Re-draws graph when Noise slider is changed
-
DerivativeOrder(n,h)
Re-draws graph when Order slider is changed
-
DerivativeResample(n,h)
Re-draws graph when Resample slider is changed
-
DerivativeScale(n,h)
Re-draws graph when Exponent slider is changed
-
DerivativeSlope(n,h)
Re-draws graph when BackgroundPosition slider is changed
-
DerivativeSmoothWidth(n,h)
Re-draws graph when Smoothwidth slider is changed
-
DerivativeWidth(n,h)
Re-draws graph when Width slider is changed
-
InteractiveDerivative1(n,h)
Re-draws graph when Smoothwidth slider is changed
-
InteractiveDerivative2(n,h)
Re-draws graph when Scale slider is changed
-
InteractiveDerivative3(n,h)
Re-draws graph when scale slider is changed
-
InteractiveDerivative4(n,h)
Re-draws graph when Order slider is changed
-
d=deriv(a)
First derivative of vector using 2-point central difference.
-
exp(-((x-pos)./(0.6006.*wid))...
-
rtslid(fig,f,hh,varargin)
RTSLID Slider widget that responds to dragging realtime
-
s=boxcar(w)
boxcar(w) = Rectangular function of width w
-
s=bsmooth(a,w)
% Convolution...
-
smoothwidth. Works well with ...
-
DerivativeDemo.m
-
InteractiveDerivative.m
-
InteractiveDerivativeRedraw.m
-
InteractiveDerivativeTest.m
-
RedrawDerivative.m
-
View all files
from
Interactive Derivative
by Tom O'Haver
Interactive Derivative for time-series signals.
|
| InteractiveDerivativeRedraw.m |
% Redraws graph for InteractiveDerivative when the sliders are changed
global x
global signal
global derivative
global Exponent
global Order
global SmoothWidth
global Exponent
global Scale
axes(h);
switch Order
case 0,
Exponent=0;
derivativelabel='Original signal';
case 1,
Exponent=-2;
derivativelabel='First Derivative';
case 2,
Exponent=-3.8;
derivativelabel='Second Derivative';
case 3,
Exponent=-5.6;
derivativelabel='Third Derivative';
case 4,
Exponent=-7.3;
derivativelabel='Fourth Derivative';
otherwise
Exponent=-9;
derivativelabel=['Derivative Order = ' num2str(Order)];
end
PlotRange=[SmoothWidth.*3:length(x)-SmoothWidth.*3];
if Order > 0,
derivative=signal;
for k=1:Order,
derivative=deriv(derivative);
derivative=fastbsmooth(derivative, SmoothWidth);
end
else
derivative=signal;
end
derivative=fastbsmooth(derivative, SmoothWidth);
h=figure(1);
plot(x(PlotRange),derivative(PlotRange))
figure(1);
title('Interactive Derivative')
text(.1.*length(x),.9.*Scale.*10^Exponent,derivativelabel);
text(.1.*length(x),.8.*Scale.*10^Exponent,['Smooth Width = ' num2str(SmoothWidth) ])
xlabel([ 'Derivative Order = ' num2str(Order) ' Smooth Width = ' num2str(SmoothWidth) ' Signal range= ' num2str(range(derivative(PlotRange))) ])
h2=gca;
if Order==0,
axis([x(1) x(length(x)) -Scale/10.*10^Exponent Scale.*10^Exponent]);
else
axis([x(1) x(length(x)) -Scale.*10^Exponent Scale.*10^Exponent]);
end
|
|
Contact us at files@mathworks.com