title: EEG Wavelet Analysis
body: <p>I want to do a time-frequency analysis of an EEG signal. I found the GSL wavelet function for computing wavelet coefficients. How can I extract actual frequency bands (e.g. 8 - 12 Hz) from that coefficients? The GSL manual says:</p>
  
  <blockquote>
    <p>For the forward transform, the elements of the original array are replaced by the discrete wavelet transform <code>f_i -&gt; w_{j,k}</code> in a packed triangular storage layout, where <code>J</code> is the index of the level <code>j = 0 ... J-1</code> and <code>K</code> is the index of the coefficient within each level, <code>k = 0 ... (2^j)-1</code>. The total number of levels is <code>J = \log_2(n)</code>.</p>
    
    <p>The output data has the following form, <code>(s_{-1,0}, d_{0,0}, d_{1,0}, d_{1,1}, d_{2,0}, ..., d_{j,k}, ..., d_{J-1,2^{J-1}-1})</code></p>
  </blockquote>
  
  <p>If I understand that right an output array <code>data[]</code> contains at position <code>1</code> (e.g. <code>data[1]</code>) the amplitude of the frequency band 2^0 = 1 Hz, and  </p>
  
  <pre><code>data[2] = 2^1 Hz  
  data[3] = 2^1 Hz  
  data[4] = 2^2 Hz  
  until  
  data[7] = 2^2 Hz  
  data[8] = 2^3 Hz
  </code></pre>
  
  <p>and so on ...</p>
  
  <p>That means I have only the amplitudes for the frequencies 1 Hz, 2 Hz, 4 Hz, 8 Hz, 16 Hz, ... How can I get e.g. the amplitude of a frequency component oscillating at 5.3 Hz? How can I get the amplitude of a whole frequency range, e.g. the amplitude of 8 - 13 Hz? Any recommendations how to get a good time-frequency distribution?</p>