<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> import numpy as np <EOL> from . _ds_hann import ds_hann <EOL> from . _utils import circshift <EOL> def circ_smooth ( x , n = <NUM_LIT:16> ) : <EOL> """<STR_LIT>""" <EOL> assert len ( x . shape ) == <NUM_LIT:1> or <NUM_LIT:1> in x . shape <EOL> assert n % <NUM_LIT:2> == <NUM_LIT:0> <EOL> nx = max ( x . shape ) <EOL> w = ds_hann ( n ) / ( n / <NUM_LIT> ) <EOL> xw = np . convolve ( x , w ) <EOL> yp = np . hstack ( ( xw [ n - <NUM_LIT:1> : nx ] , xw [ : n - <NUM_LIT:1> ] + xw [ nx : ] ) ) <EOL> y = circshift ( yp , [ int ( n / <NUM_LIT> - <NUM_LIT:1> ) ] ) <EOL> return y </s>
