#NEWLINE# def __init__( self , resolution = 1024 , width = 128 ) : #NEWLINE# #INDENT# self . width = width #NEWLINE# self . resolution = resolution #NEWLINE# N = ( resolution * width ) #NEWLINE# u = np . arange ( ( - N ) , N , dtype = float ) #NEWLINE# window = ( np . cos ( ( ( ( 0.5 * np . pi ) * u ) / N ) ) ** 2.0 ) #NEWLINE# h = ( np . sinc ( ( u / resolution ) ) * window ) #NEWLINE# self . filt = [ ] #NEWLINE# for index in range ( resolution ) : #NEWLINE# #INDENT# filt = h [ index : : resolution ] #NEWLINE# filt = filt [ : : ( - 1 ) ] #NEWLINE# self . filt . append ( filt ) #NEWLINE# #UNINDENT# lengths = [ len ( f ) for f in self . filt ] #NEWLINE# self . coeff_len = ( 2 * width ) #NEWLINE# assert ( set ( lengths ) == set ( [ self . coeff_len ] ) ) #NEWLINE# assert ( len ( self . filt ) == resolution )