title: Spectrogram from Complex Morlet wavelet ( recreating article result from data)
body: <p>I am trying to recreate the following results:</p>
  
  <p><img src="https://i.stack.imgur.com/muMxX.jpg" alt="Spectrogram"></p>
  
  <p>from the following data:</p>
  
  <p><a href="https://www.dropbox.com/s/mi3szqgzgku29rn/FS40.dat" rel="nofollow noreferrer">https://www.dropbox.com/s/mi3szqgzgku29rn/FS40.dat</a></p>
  
  <p>the time is in milliseconds (frequency is 40000 Hz)</p>
  
  <p>The article state that they used Complex Morlet wavelet to create the spectrogram:
  " Power estimates from the averaged LFPs were calculated from
  time–frequency spectrograms of the data from 1–88 Hz by convolving the signals with a complex Morlet wavelet of the form</p>
  
  <p>w(t,f0 ) = Aexp(−t^2 / 2*σ^2 )exp(2*i<em>π</em>f0*t)</p>
  
  <p>for each frequency of interest f0, where σ = m/2πf0, and i is the imaginary unit. The normalization
  factor was A = 1 /(σ (2π)^0.5 ), and the constant m defining the compromise between time and frequency resolution was 7.</p>
  
  <p>I only managed to get some "good" results using spectrogram function in matlab.
  But I dont have much idea of how to use the morlet complex wavelet.
  I got bad result when trying to use <a href="http://www.mathworks.com/help/wavelet/gs/continuous-wavelet-transform.html" rel="nofollow noreferrer">cwt</a> with 'morl' window</p>
  
  <p>Thank You.</p>
  
  <p>P.S. </p>
  
  <p>I'm trying to recreate this article:</p>
  
  <p>Computational modeling of distinct neocortical oscillations driven by cell-type selective optogenetic drive: separable resonant circuits controlled by low-threshold spiking and fast-spiking interneurons.</p>