def cwt(data, wavelet, widths):
 output = np.zeros([len(widths), len(data)])
 for (ind, width) in enumerate(widths):
  wavelet_data = wavelet(min((10 * width), len(data)), width)
  output[ind, :] = convolve(data, wavelet_data, mode='same')
 return output

def cwt ( data , wavelet , widths ) : output = np . zeros ( [ len ( widths ) , len ( data ) ] ) for ( ind , width ) in enumerate ( widths ) : wavelet_data = wavelet ( min ( ( 10 * width ) , len ( data ) ) , width ) output [ ind , : ] = convolve ( data , wavelet_data , mode = 'same' ) return output
compute time freq decomposition with continuous wavelet transform .