quote:
Originally posted by cdrozdowski111
OriginPro 9.1 SR2 64-bit/32-bit, Win7 Pro 64-bit, running in VMware Fusion 5.0.4
I some questions about the Differentiate Gadget. I looked in the docs but didn't see the answer and wasn't able to 100% determine the answers myself.
Setup:
In the Differentiate Gadget dialog, specify 1st order derivative and S-G smoothing. Then in the flyout menu, you check "Show 2nd Derivative".
Questions:
1) Does the gadget use the smoothed 1st-order derivative data to calculate the 2nd-order derivative data?
2) Is the 2nd-order derivative data smoothed itself?
Also (without regard to smoothing), is there any true difference in outcome between:
1) Setting 1st order derivative in the dialog and "Show 2nd Derivative" in the flyout.
and
2) Setting 2nd order derivative in the dialog and "Show 1st Derivative" in the flyout.
Just checked the XFC file quickly....
For the first two:
m_vDerivY = m_vY;
m_v1stDerivY = m_v2ndDerivY = m_vY;
//..
ocmath_savitsky_golay_derivative(m_vX, m_vY, m_vDerivY, m_vX.GetSize(), nPts/2, -1, nPolyOrder, nOrder);
ocmath_savitsky_golay_derivative(m_vX, m_vY, m_v1stDerivY, m_vX.GetSize(), nPts/2, -1, nPolyOrder, 1);
ocmath_savitsky_golay_derivative(m_vX, m_vY, m_v2ndDerivY, m_vX.GetSize(), nPts/2, -1, nPolyOrder, 2);
Well, few documentation on this function, except:
OCMATH_API int ocmath_savitsky_golay_derivative(double *px, double *py, double *pSmooth, UINT nSize, int nLeftpts, int nRightpts = -1, UINT nPolydeg = 2, UINT nDervOrder = 1, bool bSmoothPeakPoint = false);
For the latter two:
m_vDerivY = m_vY;
//...
for ( int iOrder = 1; iOrder <= nOrder; iOrder++ )
{
if ( OE_NOERROR != ocmath_derivative(m_vX, m_vDerivY, m_vX.GetSize()) )
{
return error_report("Differentiate fail.");
}
if ( 1 == iOrder )
m_v1stDerivY = m_vDerivY;
else if ( 2 == iOrder )
m_v2ndDerivY = m_vDerivY;
}
if ( nOrder < 2 )
{
m_v2ndDerivY = m_v1stDerivY;
if ( OE_NOERROR != ocmath_derivative(m_vX, m_v2ndDerivY, m_vX.GetSize()) )
{
return error_report("Differentiate fail.");
}
}
later on, m_v1stDerivY and m_v2ndDerivY are used in updatePreviewGraphs(), being stored in workbook "wDerivative". In a word, no difference.
©c¡Ï ¤È¥¹ ©f¨u©c ©c¥ì ¥Î¤³ ©c/ ©¦£¯
©c¨Ê¥Î ¤´¥¨ ¥ó ¨× ¥ó¤á' ¥Ì©¦¥ /¤í ¥Õ©¦©f
¨Ö ¦á ©¦£þ ©` ¥Õ ©¦
©¦