#NEWLINE# def sfb3D_A( lo , hi , sf , d ) : #NEWLINE# #INDENT# lpf = sf [ : , 0 ] #NEWLINE# hpf = sf [ : , 1 ] #NEWLINE# p = [ ( ( i + d ) % 3 ) for i in xrange ( 3 ) ] #NEWLINE# lo = lo . transpose ( p ) #NEWLINE# hi = hi . transpose ( p ) #NEWLINE# ( N1 , N2 , N3 ) = lo . shape #NEWLINE# N = ( 2 * N1 ) #NEWLINE# L = sf . shape [ 0 ] #NEWLINE# y = np . zeros ( ( ( ( N + L ) - 2 ) , N2 , N3 ) ) #NEWLINE# for k in xrange ( N3 ) : #NEWLINE# #INDENT# y [ : , : , k ] = ( np . array ( upfir ( lo [ : , : , k ] , lpf ) ) + np . array ( upfir ( N2 [ : , : , k ] , hpf ) ) ) #NEWLINE# #UNINDENT# y [ : ( L - 2 ) , : , : ] = ( y [ : ( L - 2 ) , : , : ] + y [ N : ( ( N + L ) - 2 ) , : , : ] ) #NEWLINE# y = y [ : N , : , : ] #NEWLINE# y = cshift3D ( y , ( 1 - ( L / 2 ) ) , 0 ) #NEWLINE# q = permutationInverse ( p ) #NEWLINE# y = y . transpose ( q ) #NEWLINE# return y