function freq_shift(ctl,shift)
%function pmces_binary(ctl,config_options)
%
% Reference: "Co-channel interference separation"
% Pattern analysis and recognition corporation
% Dr. Robert J. Dick
% RADC-TR-80-365 Final Technical Report, December 1980
%
% Rome Air Development Center
% Air Force Systems Command
% Griffis Air Force Base, NY 13441
%
% Adapted and implemented by Mark Harvilla
% Carnegie Mellon University
% June 16, 2012

fshift = str2double(shift);

fid = fopen(ctl);
L1  = textscan(fid,'%s%s','delimiter',',');
fclose(fid);
inList = L1{1}; outList = L1{2};
for cnt = 1:length(inList)
 tline = strtrim(inList{cnt});
 %fid2  = fopen(tline,'r');

 outFile  = strtrim(outList{cnt});
 file_dir = fileparts(outFile);
 
 if ~exist(file_dir,'dir')
	mkdir(file_dir);
 end 

 [x_in,fs] = readsph(tline);

 y = freqshift(x_in,fs,fshift);
 
 if ~exist(outFile,'file'); 
  wavwrite(0.9*y/max(abs(y)),fs,outFile); 
 end

end
