smoothing, first or second derivate of spectra according to Savitzsky-Golay
[result,SG_filter] = savgol(x,window,deriv(degree))
a Div structure or a matrix of dimensions (n x q)
the window for the calculation; an odd integer >=3
the derivative: 0 (smoothing), 1 (first derivative) or 2 (second derivative)
the degree of the polynom; an integer between 2 and 5 ;by default degree=2
the spectra obtained after the 0, 1 or 2nd derivative, into a Div structure
result.d is a matrix of dimensions (n x q)
a matrix such that: result = x * SG_filter
SG_filter.d is a matrix of dimensions (q x q)
Note: the calculation (x*SG_filter) is less precise than the first output (result) at less than window/2 from the edges of the spectra