modefilt1

PURPOSE ^

One-dimensional mode filtering.

SYNOPSIS ^

function y = modefilt1( x, s )

DESCRIPTION ^

 One-dimensional mode filtering.

 Applies an order 2*r+1 one-dimensional mode filter to vector x.  That is
 each element of the output y(i) corresponds to the mode of
 x(i-s/2:i+s/2). At boundary regions, y is calculated on smaller windows,
 for example y(1) is calculated over x(1:1+s/2).  Note that for this
 function to make sense x should take on only a number of discrete values.

 USAGE
  y = modefilt1( x, s )

 INPUTS
  x   - length n vector
  s   - filter size

 OUTPUTS
  y   - filtered vector x

 EXAMPLE
  x=[0, 1, 0, 0, 0, 3, 0, 1, 3, 1, 2, 2, 0, 1]; s=4;
  ymedian = medfilt1( x, s );
  ymode   = modefilt1( x, s );
  [x; ymedian; ymode]

 See also MEDFILT1

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Wed 03-Oct-2007 13:09:09 by m2html © 2003