B.2 Test script

26.1323GPPRelease 18Speech and video telephony terminal acoustic test specificationTS

%

% Set data format

%

fs = 16000;

conditioningTime = 23.5;

downlinkSystemDelay = 0;

%

% Segment the data

%

offsetDoubleTalk = conditioningTime;

offsetNearEnd = conditioningTime;

segmentDoubleTalkIndex(1) = {[0, 20]};

segmentNearEndIndex(1) = {[0, 20]};

segmentDoubleTalkIndex(2) = {[20, 35]};

segmentNearEndIndex(2) = {[20, 35]};

lengthDoubleTalk = max(cell2mat(segmentDoubleTalkIndex(end)));

lengthNearEnd = max(cell2mat(segmentNearEndIndex(end)));

firstSampleDoubleTalk = round(fs*offsetDoubleTalk) + 1;

firstSampleNearEnd = round(fs*offsetNearEnd) + 1;

lastSampleDoubleTalk = round(fs*(offsetDoubleTalk+lengthDoubleTalk));

lastSampleNearEnd = round(fs*(offsetNearEnd+lengthNearEnd));

indexDoubleTalk = [firstSampleDoubleTalk, lastSampleDoubleTalk];

indexNearEnd = [firstSampleNearEnd, lastSampleNearEnd];

%

% Read data from file

%

fid = fopen(‘ms01_WB_rec2.pcm’, ‘r’);

fseek(fid, 2*round(fs*offsetDoubleTalk), ‘bof’);

processedData = fread(fid, round(fs*lengthDoubleTalk), ‘int16’);

fclose(fid);

fid = fopen(‘ms01_WB_ref.pcm’, ‘r’);

fseek(fid, 2*round(fs*offsetNearEnd), ‘bof’);

nearendData = fread(fid, round(fs*lengthNearEnd), ‘int16’);

fclose(fid);

fid = fopen(‘p501-downlink_WB.pcm’, ‘r’);

fseek(fid, 2*round(fs*offsetDoubleTalk), ‘bof’);

downlinkData = fread(fid, round(fs*lengthDoubleTalk), ‘int16’);

fclose(fid);

%

% Evaluate

%

ecEvaluation(processedData, nearendData, downlinkData, …

segmentDoubleTalkIndex, segmentNearEndIndex, …

‘ms01-rec2’, downlinkSystemDelay, …

fs, ‘bitExactTest.txt’);