timef() - Returns estimates and plots of event-related (log) spectral
           perturbation (ERSP) and inter-trial coherence (ITC) changes 
           in an input data channel. 

                                Example

 Usage: 
      >> timef('details') scrolls more detailed info.

      >> [ersp,itc,powbase,times,freqs,erspboot,itcboot] =        ...
            timef(data,                                           ...
                frames,tlimits,titl,                              ...
                    srate,cycles,winsize,timesout,                ...
                        padratio,maxfreq,tvec,eloc_file,          ...
                            alpha,marktimes,powbase,pboot,rboot);

 Inputs:                                               {defaults}

    data        = single-channel (1,frames*nepochs) data  {none}
    frames      = frames per epoch                        {768}
    tlimits     = epoch time limits (ms) [mintime maxtime]{[-1000 2000]}
    titl        = figure title                            {none}
    srate       = data sampling rate (Hz)                 {256}
    cycles      = If >0 -> number of cycles in each analysis window 
                  If =0 -> use FFT (constant window length)  {0}
                  Note: when cycles==0, nfreqs is srate/2
    winsize     = (cycles==0): data subwindow length (2^k < frames)
                  (cycles >0): *longest* window length to use; this
                  determines the lowest output frequency  {~frames/8}
    timesout    = number of output times (int < frames-winframes){200}
    padratio    = FFT-length/winframes (2^k)              {2}
                  Multiplies the number of output frequencies by
                  dividing their spacing. When cycles==0, frequency
                  spacing is (low freq/padratio).
    maxfreq     = maximum frequency to plot (Hz) (and to output, 
                      if cycles==0)                           {50}
    tvec        = scalp topography (map) to plot          {[]}
    eloc_file   = electrode location file for scalp map   {no default}
                  ascii file in format of  >> topoplot('example') 
    alpha       = Two-tailed bootstrap significance prob. level {none}
                  Sets n.s. plotted output values to green (0). 
    marktimes   = times to mark with a dotted vertical line{def|nan->none}
    powbase     = baseline spectrum to log-subtract       {def|nan->from data}
    pboot       = bootstrap power limits (cf. timef() out){def|nan -> from data}
    rboot       = bootstrap ITC limits (cf. timef() out)  {def|nan -> from data}

 Outputs:

    ersp        = log power spectral difference (dB) from baseline (nfreqs,timesout)
    itc         = inter-trial coherencies (nfreqs,timesout) (range: [0 1])
    powbase     = baseline power spectrum (in whole epoch or given baseline)
    times       = vector of output times (subwindow centers) in ms.
    freqs       = vector of frequency bin centers in Hz.
    erspboot    = [2,nfreqs] matrix of [lower;upper] ERSP significance diffs.
    itcboot     = [2,nfreqs] matrix of [lower;upper] ITC thresholds (not diffs).

       Uses either fixed-window, zero-padded FFTs (fastest), OR wavelet
       0-padded DFTs, both Hanning-tapered. Output frequency spacing is 
       the lowest frequency (srate/winsize) divided by the padratio.

       Left-click on a subplot to view it in a separate window.

       If a topo vector and electrode location file are given, 
       the figure also shows a topoplot() of the specified scalp map.

       If alpha is given, then bootstrap statistics are computed 
       (from a distribution of NACCU(=200) surrogate data epochs) and 
       non-significant features of the output plots are zeroed out 
       (i.e., plotted in green). 

 Notes:
      NaN input values (such as returned by eventlock()) are ignored.

      To plot only the ERSP or ITC, set ERSP_PLOT or ITC_PLOT flags to 0 
      in the script file.

      If BASE_BOOT set in the script, surrogate ERSP data is drawn from 
      windows with center times < DEFAULT_BASELN(=0) [use this when 
      adequate baseline data are available].

                                                       Toolbox function list