Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

filter_sg (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: filter implementation

Requires: MathScript RT Module

Syntax

y = filter_sg(x, p, f, w)

y = filter_sg(x, p, f)

Legacy Name: sgolayfilt

Description

Applies a Savitzky-Golay FIR smoothing filter.

Examples

Inputs

Name Description
x Specifies the input signal to filter. x is a real array. If x is a matrix, the filter operates on each column of x.
p Specifies the order of the polynomial. p is a positive integer.
f Specifies the number of points to use in fitting. f is a positive odd integer.
w Specifies the weighting vector. w can be an empty vector or a real vector with length f.

Outputs

Name Description
y Returns the filtered signal.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

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')

Related Topics

fir_sgsmooth


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit