function RawAdcDataProcCrossFiles(binFilename)
%close all;
NUM_ADC_SAMPLES = 64; NUM_CHIRPS = 128; NUM_VIRTUAL_ANTENNAS = 12; NUM_FRAMES = 2048;
adcRate = 5.0;

FileIndexCount = 0;
readSize_orig = NUM_ADC_SAMPLES * NUM_CHIRPS * NUM_VIRTUAL_ANTENNAS * 2;
readSize = readSize_orig;
newFileName = strcat(binFilename, '_0.bin');
fid = fopen(newFileName,'r');
newFileFlag = 0;
frameID = 0;
for frameID_ = 1:NUM_FRAMES - 5
    if (rem(frameID, 100) == 0)
        disp(frameID); 
    end
    dataChunk  = fread(fid,readSize,'uint16','l');
    if (length(dataChunk) ~= readSize)
        newFileFlag = 1;
        readSize = readSize_orig - length(dataChunk); 
    end
    if (newFileFlag ==1) 
        fclose(fid);
        FileIndexCount = FileIndexCount + 1;
        newFileName = strcat(binFilename, '_', num2str(FileIndexCount),'.bin');
        fid = fopen(newFileName,'r');
        newFileFlag = 0;
        dataChunk_ext  = fread(fid,readSize,'uint16','l');
        dataChunk = [dataChunk; dataChunk_ext];
        readSize = readSize_orig;
    end
    dataChunk = dataChunk - (dataChunk >= 2^15) * 2^16;

    % through iwr6843 + DCA1000,  radar_data has data in the following format 
    % Rx0I0, Rx0I1, Rx0Q0, Rx0Q1, Rx0I2, Rx0I3, Rx0Q2, Rx0Q3, ...
    % The following script reshapes it into a 4-dimensional array.    
    len = length(dataChunk) / 2;
    adcOut(1:2:len) = dataChunk(1:4:end) + 1j*dataChunk(3:4:end);
    adcOut(2:2:len) = dataChunk(2:4:end) + 1j*dataChunk(4:4:end);

    adcOut = reshape(adcOut, NUM_ADC_SAMPLES, NUM_VIRTUAL_ANTENNAS, NUM_CHIRPS, 1);
    adcOut = permute(adcOut, [1, 3, 2, 4]);
    
    zeroDetectionFlag = (min(min(sum(abs(adcOut),1))) == 0);
    if (zeroDetectionFlag == 1)
        continue;
    end
    frameID = frameID + 1;
    
    fftSize1D = 64;
    radar_data_1dFFT(1:fftSize1D, 1: NUM_CHIRPS, 1:NUM_VIRTUAL_ANTENNAS) = fft(adcOut(1:fftSize1D, :,:),[], 1);%.*window_1D 
    rangeProfile                    =   radar_data_1dFFT; 
   

end

fclose(fid);
 
end

