Products & Services Solutions Academia Support User Community Company

Learn more about Bioinformatics Toolbox   

mssgolay - Smooth signal with peaks using least-squares polynomial

Syntax

Yout = mssgolay(X, Intensities)

mssgolay(X, Intensities, ...'Span', SpanValue, ...)
mssgolay(X, Intensities, ...'Degree', DegreeValue, ...)
mssgolay(X, Intensities, ...'ShowPlot', ShowPlotValue, ...)

Arguments

XVector of separation-unit values for a set of signals with peaks. The number of elements in the vector equals the number of rows in the matrix Intensities. The separation unit can quantify wavelength, frequency, distance, time, or m/z depending on the instrument that generates the signal data.
IntensitiesMatrix of intensity values for a set of peaks that share the same separation-unit range. Each row corresponds to a separation-unit value, and each column corresponds to either a set of signals with peaks or a retention time. The number of rows equals the number of elements in vector X.

Description

Yout = mssgolay(X, Intensities) smooths raw noisy signal data, Intensities, using a least-squares digital polynomial filter (Savitzky and Golay filters). The default span or frame is 15 samples.

mssgolay(X, Intensities, ...'PropertyName', PropertyValue, ...) calls mssgolay with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:


mssgolay(X, Intensities, ...'Span', SpanValue, ...)
modifies the frame size for the smoothing function. If SpanValue is greater than 1, the window is the size of SpanValue in samples independent of the X vector. Higher values smooth the signal more with an increase in computation time. If SpanValue is less than 1, the window size is a fraction of the number of points in the input data, X. For example, if SpanValue is 0.05, the window size is equal to 5% of the number of points in X.

mssgolay(X, Intensities, ...'Degree', DegreeValue, ...) specifies the degree of the polynomial (DegreeValue) fitted to the points in the moving frame. The default value is 2. DegreeValue must be smaller than SpanValue.

mssgolay(X, Intensities, ...'ShowPlot', ShowPlotValue, ...) plots smoothed signals over the original. When mssgolay is called without output arguments, the signals are plotted unless ShowPlotValue is false. When ShowPlotValue is true, only the first signal in Intensities is plotted. ShowPlotValue can also contain an index to one of the signals in Intensities.

Examples

  1. Load a MAT-file, included with the Bioinformatics Toolbox software, that contains mass spectrometry data variables, including MZ_lo_res, a vector of m/z values for a set of spectra, and Y_lo_res, a matrix of intensity values for a set of mass spectra that share the same m/z range.

    load sample_lo_res
  2. Smooth the spectrograms.

    YS = mssgolay(MZ_lo_res, Y_lo_res);
  3. Plot the third spectrogram in Y_lo_res and its smoothed signal.

    mssgolay(MZ_lo_res,Y_lo_res,'SHOWPLOT',3);

See Also

Bioinformatics Toolbox functions: msalign, msbackadj, msheatmap, mslowess, msnorm, mspeaks, msresample, msviewer

Bioinformatics Toolbox demo:

Preprocessing Raw Mass Spectrometry Data
  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS