function split_signals()
[data_dir,signal_dir]=getLocalProperties();

reffile = [signal_dir, 'REFERENCE.csv'];
fid = fopen(reffile, 'r');
if(fid ~= -1)
	Ref = textscan(fid,'%s %s','Delimiter',',');
else
	error(['Could not open ' reffile ' for scoring. Exiting...'])
end
fclose(fid);

RECORDS = Ref{1};
target  = Ref{2};
% fid_a = fopen('answers_a.txt','w');
% fid_b = fopen('answers_b.txt','w');


for i = 4251:length(RECORDS)
    fname = RECORDS{i};
    [tm,ecg,fs,siginfo]=rdmat(fname);
     n_samples=length(ecg)/2;   
     ecg_1=ecg(1:n_samples,:);
     ecg_2=ecg(n_samples+1:end,:);
     name_1=strcat(fname,'_1');
     name_2=strcat(fname,'_2');
     mat2wfdb(ecg_1,name_1,fs,16,'mV',[],[],   {'ECG1'});
     mat2wfdb(ecg_2,name_2,fs,16,'mV',[],[],   {'ECG1'});
%      fprintf(fid_a,'%s,%s\r\n',name_1,char(target));
%      fprintf(fid_b,'%s,%s\r\n',name_2,char(target));

end
% fclose(fid_a);
% fclose(fid_b);

end
