<s> import core . modules <EOL> import core . modules . module_registry <EOL> from core . modules . vistrails_module import Module , ModuleError <EOL> from Array import * <EOL> import scipy <EOL> import scipy . signal <EOL> from scipy import sparse , fftpack <EOL> import numpy <EOL> class WindowModule ( object ) : <EOL> my_namespace = '<STR_LIT>' <EOL> class HanningWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . hanning ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class TriangularWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . triang ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class BlackmanWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . blackman ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class BlackmanHarrisWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . blackmanharris ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class ParzenWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . parzen ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class HammingWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . hamming ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class KaiserWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> beta = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . kaiser ( size , beta ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Float , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class BartlettHannWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . barthann ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class GaussianWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> sigma = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . gaussian ( size , sigma ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Float , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class BoxcarWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . boxcar ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class BohmanWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . bohman ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class BartlettWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . bartlett ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) <EOL> class NuttallBlackmanHarrisWindow ( WindowModule , Module ) : <EOL> def compute ( self ) : <EOL> size = self . get_input ( "<STR_LIT>" ) <EOL> out = NDArray ( ) <EOL> out . set_array ( scipy . signal . nuttall ( size ) ) <EOL> self . set_output ( "<STR_LIT>" , out ) <EOL> @ classmethod <EOL> def register ( cls , reg , basic ) : <EOL> reg . add_module ( cls , namespace = cls . my_namespace ) <EOL> reg . add_input_port ( cls , "<STR_LIT>" , ( basic . Integer , '<STR_LIT>' ) ) <EOL> reg . add_output_port ( cls , "<STR_LIT>" , ( NDArray , '<STR_LIT>' ) ) </s>
