frudawski

speccentroid

The speccentroid function determines the spectral centroid or “center of mass” for any given spectral power distribution (SPD) as in the following equation:

\lambda_{\textrm{c}} = \frac{\sum \lambda \cdot s(\lambda) \,\textrm{d}\lambda}{\sum s(\lambda) \,\textrm{d}\lambda}

See also: specpeak

Usage:

sc = speccentroid(lam,spec)

Where:

ParameterDescription
scReturns the spectral centroid, or center of mass wavelength.
lamSpecifies the wavelengths, vector or matrix.
specSpecifies the spectral power distribution(s), vector or matrix.

Examples:

Determine spectral centroid of the V(\lambda) curve:

lam = 380:780;
VL = ciespec(lam,'VL');
sc = speccentroid(lam,VL)

% plotting the result
plot(lam,VL)
grid minor
hold on
plot([sc sc],[0 1],'k--')
xlabel('\lambda in nm')
ylabel('relative SPD')
hold off

See also: ciespec

Result:

sc = 560.19

Determine the spectral centroids of the α-opic functions:

lam = 380:780;
spec = ciespec(lam,'aopic');
aopiccent = speccentroid(lam,spec)

See also: ciespec

Result:

aopiccent =

   450.03
   536.41
   561.34
   502.40
   489.69

Leave a comment

* I accept the use of cookies as well as the terms in the privacy policy. I accept that data provided by me is processed and saved. I know that comments are saved and published after review.