.. highlightlang:: us .. _sgolayfilt: sgolayfilt ========== .. index:: smooth .. index:: Glätten .. index:: Golay .. index:: Savitzky-Golay .. index:: sgolayfilt .. us.tag sgolayfilt GERMAN Interpolation New580 :ref:`sgolayfilt` berechnet einen gleitenden Mittelwert mit dem Savitzky-Golay-Verfahren. .. function:: rvY2 = sgolayfilt(rvY1) rvY2 = sgolayfilt(rvY1, p) rvY2 = sgolayfilt(rvY1, p, nNeighbor) .. us.return **Returnwert** *rvY2* ist der Ergebnisvektor. .. us.params **Parameter** .. uparam:: rvY1 *rvY1* ist ein reeller Vektor mit mindstens *p* x-Koordinaten. .. uparam:: p *p* ist der Grad des Ausgleichspolynoms (1 .. 10, Default-Wert = 3). .. uparam:: nNeighbor *nNeighbor* ist die halbe Fensterbreite. Die gesamte Fensterbreite ist ``nNeighbor * 2 + 1``. (Default-Wert = 20). .. us.example **Beispiel** .. image:: S:/uniplot-obj/images/savitzky-golay.* :: def test_sgolay() { N = 200; t = linspace(0, 10, N); s = sin(2*PI/5*t); srand(1); sr = s + 0.3 * (rand(size(t))-0.5); // Sinus h = plot(t, s); XYSetProps(h[3], "curve-color='black'") XYSetLegendText(h[3], "sinus"); // sin+rand h = plot(t, sr, h[2]); XYSetProps(h[3], "curve-color='blue'") XYSetLegendText(h[3], "sinus+random"); y = moving_average(sr, 10) h = plot(t, y, h[2]); XYSetProps(h[3], "curve-color='red'") XYSetLegendText(h[3], "moving average (smooth())"); // smooth(sin+rand) y = sgolayfilt(sr, 3, 20); h = plot(t, y, h[2]); XYSetProps(h[3], "curve-color='green'") XYSetLegendText(h[3], "Savitzky-Golay Filter"); } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Beschreibung * - 5.8.0 - Neu. .. seealso:: :ref:`uberblick-mathematik`, :ref:`pspline`, :ref:`fspline`, :ref:`akimaspline`, :ref:`interpol`, :ref:`moving_average` :sub:`id-931091`