function [cP]=cband(P)
% function [cP]=cband(P)
% applies Stearns-Stearns spectra bandpass correction
% operates on matrix P of dimensions 1xn
% where n is the number of wavelengths
% returns corrected matrix cP
dim=size(P);
if (dim(1)==1)||(dim(2)==1);
    P=P(:)'; %force to be a row matrix
else
    disp('P must be a row matrix');
    return;
end

a=0.083;
n=length(P);
for i=2:n-1
    cP(i)=-a*P(i-1)+(1+2*a)*P(i)-a*P(i+1);
end
cP(1)=(1+a)*P(1)-a*P(2);
cP(n)=(1+a)*P(n)-a*P(n-1);
