How to parameterize a curve that is the derivative of a Gaussian
In the Gauss equation below, I can specify the height (a), width (c) and center (b).
f(x) = a*e^[-(x-b)^2 / (2c^2)]
The Gaussian derivative takes the form:
What I would like to do is come up with an equation where I can specify the height, width, and center of the curve, such as the Gaussian derivative .
The derivative of the Gauss equation above:
d = (a*(-x).*exp(-((-x).^2)/(2*c^2)))/(c^2);
The first-order Hermite function takes a similar form.
d = (((pi)^(-1/4)*exp(-0.5*(x.^2))).*x)*sqrt(2);
My goal is to have an equation that takes this general view and allows me to specify height, width, and center.
source to share
You need to make two changes to the Gaussian derivative expression:
-
Differentiation preserves changes in height and position. The only problem is that you are missing a parameter in the derivative expression
b
. You must replacex
withx-b
. -
Regarding changes in width, since the original Gaussian function has an area
1
, the higher onec
produces a larger width, but also a smaller height. To compensate for this, multiply byc
so that the height is not changed by changes inc
.
So the parameterized function
d = c*(a*(-x+b).*exp(-((-x+b).^2)/(2*c^2)))/(c^2);
Example:
figure hold on grid x = -20:.1:20; a = 1; b = 2; c = 3; % initial values d = c*(a*(-x+b).*exp(-((-x+b).^2)/(2*c^2)))/(c^2); plot(x, d, 'linewidth', 1) % blue a = 2; b = 2; c = 3; % change height d = c*(a*(-x+b).*exp(-((-x+b).^2)/(2*c^2)))/(c^2); plot(x, d, 'linewidth', 1) % red a = 1; b = 7; c = 3; % change center d = c*(a*(-x+b).*exp(-((-x+b).^2)/(2*c^2)))/(c^2); plot(x, d, 'linewidth', 1) % yellow a = 1; b = 2; c = 5; % change width d = c*(a*(-x+b).*exp(-((-x+b).^2)/(2*c^2)))/(c^2); plot(x, d, 'linewidth', 1) % purple
source to share