function MakeSetiBatch(workingdir); % % MakeSetiBatch makes a list of the *.wav files in the % workingdir parameter and creates a dos batch file to execute % both wav2raw and SetiEasy for each wave file. % % Acknowledgements % 1. Wav2raw was created by Dan Kennedy can converts the wav file % to the raw format that setieasy requires. % 2. Dan Kennedy in a post gave the dos commands needed to % integrate both wav2raw and setieasy with error checking % 3. Setieasy source code by Robb Samuell, based on a subcluster % detection algorithm in Speakeasy by Rob Lodder, and % compiled by Don Owens in Borland C++. % % Requirements % 1. This function requires SetiEasy_v123.exe and wav2raw.exe % to be in the directory given as a parameter. % 2. Download the wav files to this directory. % 3. Requires Matlab. % % Usage % 1. download the wav files to your working directory % 2. make sure SetiEasy_v123.exe and wav2raw.exe also exist in this % directory % 3 Execute inside of matlab at the command line % >> MakeSetiBatch('E:\DSP\SetiEasy\web\') % where the string is your working directory. % note that the last '\' is important % 4. To run the batch file simply double click in explorer on the % filename. % % % MakeSetiBatchF.m created by Mark Desrosiers for the University of % Kentucky Project Argus group. % get wav file list cd(workingdir); d = dir('*.wav'); str = {d.name}'; files = char(str); [num k] = size(files); line2 = 'if errorlevel 1 echo Wav2RAW failed\r\n'; fid = fopen('runseti.bat', 'w'); for k = 1:num a = findstr(files(k,:), '.wav'); % trim off the wav extension fn = files(k,1:a-1); % create the 3 strings for the dos commands for each wav file line1 = ['wav2raw ', fn, '.wav ', fn, '.raw\r\n']; line3 = ['if NOT errorlevel 1 SetiEasy_v123.exe ',... fn, '.raw ',... fn, '.txt ',... fn, 'g.txt\r\n\r\n']; % print out the strings into the batch file fprintf(fid, line1); fprintf(fid, line2); fprintf(fid, line3); end fclose(fid); disp('Finished making SetiBatch file');