Spline interpolation introduces negative values
ali8
Interpolate2/T=3/N=100/I=2/F=0/Y=spec_VT095_n_SS/X=freq_VT095_SS freq_VT095, spec_VT095_n
(spec=spectrum, freq=frequency).
The interpolation introduces some negative values in the new wave. What is the reason for this, and how can I overcome it?
A test experiment is attached.
Since your data has an abrupt change over few points at the beginning, you get what you see.
Smoothing spline interpolation has no analytical value - it is just to produce a smooth curve for visual effect. It works best noisy but reasonably smooth input.
If you set the first point to NaN and then redo the smoothing spline, you get better results because you have removed the discontinuity from the input:
spec_VT095_n[0] = NaN
Interpolate2/T=3/N=100/I=2/F=0/Y=spec_VT095_n_SS/X=freq_VT095_SS freq_VT095, spec_VT095_n
spec_VT095_n[0] = saveFirstPoint
Here is a recreation macro for the graph I used to examine the data:
PauseUpdate; Silent 1 // building window...
Display /W=(12,51,1038,674) spec_VT095_n vs freq_VT095
AppendToGraph spec_VT095_n_SS vs freq_VT095_SS
ModifyGraph mode(spec_VT095_n)=3
ModifyGraph marker(spec_VT095_n)=19
ModifyGraph rgb(spec_VT095_n_SS)=(1,16019,65535)
SetAxis left -4.40425531914894e-08,5.55957446808511e-07
SetAxis bottom -0.00941051769868653,0.16067755017735
Cursor/P A spec_VT095_n 3
ShowInfo
EndMacro
July 30, 2014 at 06:56 pm - Permalink
Thanks again.
July 31, 2014 at 08:56 am - Permalink