Home > bioelectromagnetism > eeg_scan_freq_parse_script.m

eeg_scan_freq_parse_script

PURPOSE ^

eeg_scan_freq_parse_script - generate Hz bands of Neuroscan AVG export file

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 eeg_scan_freq_parse_script - generate Hz bands of Neuroscan AVG export file

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % eeg_scan_freq_parse_script - generate Hz bands of Neuroscan AVG export file
0002 
0003 clear; close all;
0004 
0005 src = input('type working directory (eg, /ringo/eeg5/psmis/):\n','s');
0006 file = input('\n\ntype fileprefix[.txt] to load (eg, text):\n','s');
0007 ext = '.txt';
0008 
0009 load (strcat(src, file, ext));
0010 volt = eval(file); clear (file);
0011 
0012 
0013     % Generate fast fourier transform and power spectrum
0014 
0015 ffx = fft(volt,256);         clear volt;
0016 Pxx = ffx.* conj(ffx) / 256; clear ffx;
0017 
0018 
0019     % Plot power spectrum
0020 
0021 %f = 4:4:128;
0022 %plot(f,Pxx(1:32,3), '-+');
0023 
0024 
0025     % Mean power from 3-7 Hz, 8-13 Hz, 35-40 Hz, 40-45 Hz
0026     % across elec/trials
0027 
0028     % check that array coloumns correspond to correct f
0029     % especially given a lower resolution than 1 Hz.
0030 
0031 theta  = Pxx( 1,:);
0032 alpha  = Pxx( 2,:);
0033 gamma1 = Pxx( 9,:);
0034 gamma2 = Pxx(10,:);
0035 
0036 
0037     % create output data
0038 
0039 th = fopen(strcat(src, file, '_th.dat'), 'wt');
0040 al = fopen(strcat(src, file, '_al.dat'), 'wt');
0041 g1 = fopen(strcat(src, file, '_g1.dat'), 'wt');
0042 g2 = fopen(strcat(src, file, '_g2.dat'), 'wt');
0043 
0044 fprintf(th, '%16.4f', theta);
0045 fprintf(al, '%16.4f', alpha);
0046 fprintf(g1, '%16.4f', gamma1);
0047 fprintf(g2, '%16.4f', gamma2);
0048 
0049 fclose('all');

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003