Você está na página 1de 3

EP_den v2

Rodrigo Quian Quiroga (2003)

Help
How the program works:
The program requires matlab R.13. It gives different options for denosing the data using
the wavelet transform. The mother wavelet used is a Biorthogonal B-spline (3,15). Input
data should be a 1 column ASCII file in which trials should be concatenated one after the
other without blanks (each trial including the pre- and post-stimulus data). The program
assumes the number of samples per sweep is an exponent of 2. If not, use the function
Resample.m before denoising. Border problems are solved by taking the final (initial)
data points of the next (previous) trial. Be sure to have enough pre- and post-stimulus
data points.
The Save button stores the results in an output file with extension _den". This file
contains the matrix dd, in which each row are the denoised trials, and the matrix xx
with the original data in the same format.
Parameters:
Samples:
Stim:
Sr:
Scales:

number of samples per trial.


time of stimulus onset (in samples).
sampling frequency (in Hz).
number of scales in which the signal should be decomposed (max: 10)

Wavelet filtering:
Band-pass filtering:
The right panel gives the settings for doing band-pass filtering using wavelets. The
original data can be decomposed in up to 10 detail levels (D1 D10) and a last
approximation (Apr). The frequency limits of each scale are approx. calculated dividing
by 2 the sampling rate. In the case of 256 Hz, these are (with a 5 scales decomposition):
D1: 64 128 Hz; D2: 32 64 Hz; D3: 16 32 Hz; D4: 8 16 Hz; D5: 4 8 Hz; A5: 0
4 Hz. Note that D2, D3, D4, D5, A5 approx. correspond to the EEG frequency bands:
Gamma, Beta, Alpha, Theta and Delta, respectively.
Denoising:
The left panel gives the settings for denoising the data. For each scale, the range of
coefficients to be kept for denoising can be set with the minimum (left) and maximum

(right) numbers. The total number of coefficients for each active scale appears in blue in
the middle column (# Coeff.).
Make plots:
This menu plots either the wavelet coefficients; the reconstructed signal for each scale
(band); the single-trial traces (in gray the original trials and in red the denoised trials) or a
contour plot of the denoised trials (trials are in the y-axis). In all cases, the upper plot
always shows the original average ERP (in gray) and the average denoised signal (in red).
In the case of single-trial or contour plots, the number of trials to be plotted can be
selected with the bottom numbers.
Editing and printing:
The generated plots can always be edited using the matlab menus. In the same way,
theses can be printed or saved using the File menu. Depending on printer
configurations, the color may be changed. For keeping the original color, export the
figure as a color postscript file. For generating separated figures use the function
Graphs.m.
List of files:

EP_den_v2.m
This is the main program, which gives different options for denosing the data.

Run_EP_den.m
This file contains the wavelet denoising algorithm

Set_all_den_coeff.m & Set_den_coeff.m


Select the wavelet coefficients for denoising.

Load_filter_coefficients.m
Load coefficients of Biorthogonal B-Splines (3,15)

Resample.m
Fills the number of data points in each sweep to be a factor of 2.

Plot_coefficients.m
Does the different plots on the screen

Graphs.m
Does the plots in separate figures.

Ja_o1t.asc & cg25_o1t.asc


Two sample datasets with single-trial event-related potentials.

Installation and use:


Just create a subdirectory (e.g. c:/EP_den) and download there the file EP_den_v2.zip.
Unzip the file and start the program typing EP_den_v2 in the matlab command prompt.
The program was tested using matlab 6 in a windows machine (with 1024x768 display
resolution or higher). You are welcome to change the program for using it in other
platforms or to include your own routines. Any comments are welcome to
rodri@vis.caltech.edu.
Disclaimer:
Since this program is distributed for free it is offered without any warranty.
Distribution and Citation:
Theses programs and documentation can be distributed and used for free in any
noncommercial application. For other uses, contact the author at rodri@vis.caltech.edu.
You can refer to this material just citing the papers were it is described:
Obtaining single stimulus evoked potentials with Wavelet Denoising.
Quian Quiroga R.
Physica D, 2000; 145: 278-292.
Single-trial evoked potentials with Wavelet Denoising.
R. Quian Quiroga and H. Garcia.
Clin. Neurophysiol. 114: 376-390, 2003.

Back to main

Você também pode gostar