def fft_multiply_repeated(h_fft, x, cuda_dict=dict(use_cuda=False)):
 if (not cuda_dict['use_cuda']):
  x = np.real(ifft((h_fft * fft(x)), overwrite_x=True)).ravel()
 else:
  cudafft = _get_cudafft()
  cuda_dict['x'].set(x.astype(np.float64))
  cudafft.fft(cuda_dict['x'], cuda_dict['x_fft'], cuda_dict['fft_plan'])
  _multiply_inplace_c128(h_fft, cuda_dict['x_fft'])
  cudafft.ifft(cuda_dict['x_fft'], cuda_dict['x'], cuda_dict['ifft_plan'], False)
  x = np.array(cuda_dict['x'].get(), dtype=x.dtype, subok=True, copy=False)
 return x

def fft_multiply_repeated ( h_fft , x , cuda_dict = dict ( use_cuda = False ) ) : if ( not cuda_dict [ 'use_cuda' ] ) : x = np . real ( ifft ( ( h_fft * fft ( x ) ) , overwrite_x = True ) ) . ravel ( ) else : cudafft = _get_cudafft ( ) cuda_dict [ 'x' ] . set ( x . astype ( np . float64 ) ) cudafft . fft ( cuda_dict [ 'x' ] , cuda_dict [ 'x_fft' ] , cuda_dict [ 'fft_plan' ] ) _multiply_inplace_c128 ( h_fft , cuda_dict [ 'x_fft' ] ) cudafft . ifft ( cuda_dict [ 'x_fft' ] , cuda_dict [ 'x' ] , cuda_dict [ 'ifft_plan' ] , False ) x = np . array ( cuda_dict [ 'x' ] . get ( ) , dtype = x . dtype , subok = True , copy = False ) return x
do fft multiplication by a filter function .