12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- %Written by Andrey Vinogradov, 2021
- %ADD THE CODE DIRECTORY TO MATLAB PATH [either manually or]:
- %addpath(genpath('your folder'));
- [files,path] = uigetfile('*.h5*', 'Select files for analysis','MultiSelect','on');%(filter)
- if iscell(files)
- list=cellfun(@(x) [path x], files,'UniformOutput',false);
- list=list';
- else
- list={[path files]};
- end
- %% PARAMETERS
- parameters.min_ref_per = 1.5; %detector dead time (in ms)
- parameters.w_pre = 20; %number of pre-event data points stored (def. 20)
- parameters.w_post = 44; %number of post-event data points stored (def. 44)
- %for sampling frequency 24000Hz, pre 20 events, post 44 events
- %Reference values. Adjusted for actual sampling frequency deeper in the code
- % 24000 events/s -> 20/24000, 44/24000 = handles.par.w_post/handles.par.sr
- % pre + post ==> amount of points stored per spike
- parameters.detection = 'both'; %type of threshold 'both','neg' or 'pos'
- parameters.stdmin = 4.5; %minimum threshold factor (def. 5) for the operation with SWTTEO 4.5 should be selected
- parameters.stdmax = 50; %maximum threshold factor. Is used for artefact removal
- parameters.interpolation = 'y'; %interpolation for alignment (not in use here as spike storage is not involved)
- parameters.int_factor = 2; %interpolation factor (interpolation for spike storing is not in use)
- parameters.detect_fmin = 200; %high pass filter for detection (def. 200)
- parameters.detect_fmax = 3000; %low pass filter for detection (def. 3000)
- parameters.segments = 1; %nr. of segments in which the data is cutted. --> segmentit voisi analysoida rinnakkain?
- %setting of the output directory
- csv_directory = uigetdir('title','SELECT YOUR OUTPUT FOLDER');
- %% RUN
- runrunman = FileRunner(parameters, list(:,1),csv_directory); %constructor method application
- [result, runrunman] = runrunman.ReadSpikesFromNextChannel(); %reading the next channel
- while ~isempty(result)
-
- clear result;
- [result, runrunman] = runrunman.ReadSpikesFromNextChannel();
-
- end
|