Table Of Contents

filter_sg

Version:
    Last Modified: March 15, 2017

    Applies a Savitzky-Golay FIR smoothing filter.

    Syntax

    y = filter_sg(x, p, f)
    y = filter_sg(x, p, f, w)
    y = filter_sg (x, p, f, w, d)
    Legacy name: sgolayfilt

    Inputs

    x

    Input signal to filter. x is a real array. If x is a matrix, the filter operates on each column of x.

    p

    Order of the polynomial. p is a positive integer.

    f

    Number of points to use in fitting. f is a positive odd integer.

    w

    Weighting vector. w can be an empty vector or a real vector with length f.

    d

    Dimension.

    Outputs

    y

    Filtered signal.

    x = -1:0.01:1;
    y = x.^2+0.1.*rand(1, length(x));
    z = filter_sg(y, 2, 15);
    plot(x, y, 'r', x, z, 'b')

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics