DataPipeline/Processing.py
def smooth(self,x,y,windowlen=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.
        """

        if len(x) < windowlen:
            raise ValueError, "Input list needs to be bigger than window size."
        if windowlen<3:
            return y
        if not window in ['hanning', 'hamming', 'bartlett', 'blackman']:
            raise ValueError, 'wrong filter name'
        s=np.r_[y[windowlen-1:0:-1],y,y[-1:-windowlen:-1]]        
        w=eval('np.'+window+'(windowlen)')
        sy = np.convolve(w/w.sum(),s,mode='same')
        sy = list(sy)
        sx = np.r_[x[windowlen-1:0:-1],x,x[-1:-windowlen:-1]]
        print len(sx), len(sy)
        return sx[windowlen:-windowlen+1],sy[windowlen:-windowlen+1]
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.
        
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.
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 .
def smooth(self,x,y,windowlen=11,window='hanning'):
        if len(x) < windowlen:
            raise ValueError, "Input list needs to be bigger than window size."
        if windowlen<3:
            return y
        if not window in ['hanning', 'hamming', 'bartlett', 'blackman']:
            raise ValueError, 'wrong filter name'
        s=np.r_[y[windowlen-1:0:-1],y,y[-1:-windowlen:-1]]        
        w=eval('np.'+window+'(windowlen)')
        sy = np.convolve(w/w.sum(),s,mode='same')
        sy = list(sy)
        sx = np.r_[x[windowlen-1:0:-1],x,x[-1:-windowlen:-1]]
        print len(sx), len(sy)
        return sx[windowlen:-windowlen+1],sy[windowlen:-windowlen+1]
def smooth ( self , x , y , windowlen = 11 , window = 'hanning' ) : if len ( x ) < windowlen : raise ValueError , "Input list needs to be bigger than window size." if windowlen < 3 : return y if not window in [ 'hanning' , 'hamming' , 'bartlett' , 'blackman' ] : raise ValueError , 'wrong filter name' s = np . r_ [ y [ windowlen - 1 : 0 : - 1 ] , y , y [ - 1 : - windowlen : - 1 ] ] w = eval ( 'np.' + window + '(windowlen)' ) sy = np . convolve ( w / w . sum ( ) , s , mode = 'same' ) sy = list ( sy ) sx = np . r_ [ x [ windowlen - 1 : 0 : - 1 ] , x , x [ - 1 : - windowlen : - 1 ] ] print len ( sx ) , len ( sy ) return sx [ windowlen : - windowlen + 1 ] , sy [ windowlen : - windowlen + 1 ]
smooth the data using a window with requested size.
smooth the data using a window with requested size .
"""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.
        """
self
x
y
windowlen
window