#NEWLINE# def hammingWindow( size ) : #NEWLINE# #INDENT# '\n    Windowing function from:\n    http://en.wikipedia.org/wiki/Window_function\n    ' #NEWLINE# ( w , h ) = size #NEWLINE# X = np . arange ( w ) . reshape ( w , 1 ) #NEWLINE# Y = np . arange ( h ) . reshape ( 1 , h ) #NEWLINE# X = ( X * np . ones ( ( 1 , h ) , 'd' ) ) #NEWLINE# Y = ( Y * np . ones ( ( w , 1 ) , 'd' ) ) #NEWLINE# window = ( ( 5.3836 - ( 0.46164 * np . cos ( ( ( ( 2 * np . pi ) * X ) / ( w - 1.0 ) ) ) ) ) * ( 5.3836 - ( 0.46164 * np . cos ( ( ( ( 2 * np . pi ) * Y ) / ( h - 1.0 ) ) ) ) ) ) #NEWLINE# return window