Functions | Variables
hrl_lib::smooth Namespace Reference


def smooth


list l = ['original signal', 'signal with noise']
tuple t = linspace(-4,4,100)
list windows = ['flat', 'hanning', 'hamming', 'bartlett', 'blackman']
int ws = 31
tuple x = sin(t)
tuple xn = x+randn(len(t))
tuple y = smooth(x)

Function Documentation

def hrl_lib.smooth.smooth (   x,
  window_len = 11,
  window = 'hanning' 
smooth the data using a window with requested size.

This method is based on the convolution of a scaled window with the signal.
The signal is prepared by introducing reflected copies of the signal 
(with the window size) in both ends so that transient parts are minimized
in the begining and end part of the output signal.

    x: the input signal 
    window_len: the dimension of the smoothing window; should be an odd integer
    window: the type of window from 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'
        flat window will produce a moving average smoothing.

    the smoothed signal


see also: 

numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve
TODO: the window parameter could be the window itself if an array instead of a string
NOTE: length(output) != length(input), to correct this: return y[(window_len/2-1):-(window_len/2)] instead of just y.

Definition at line 8 of file

Variable Documentation

list hrl_lib::smooth::l = ['original signal', 'signal with noise']

Definition at line 98 of file

tuple hrl_lib::smooth::t = linspace(-4,4,100)

Definition at line 73 of file

list hrl_lib::smooth::windows = ['flat', 'hanning', 'hamming', 'bartlett', 'blackman']

Definition at line 83 of file

Definition at line 78 of file

Definition at line 74 of file

tuple hrl_lib::smooth::xn = x+randn(len(t))

Definition at line 75 of file

Definition at line 76 of file

Author(s): Cressel Anderson, Travis Deyle, Advait Jain, Hai Nguyen, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:34:06