-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcheckCO.m
35 lines (25 loc) · 830 Bytes
/
checkCO.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function isGood = checkCO( startCO, finalCO, dispChunks)
isGood = 1;
% Construct the column chunks
colChunkWidth = size(startCO,2);
for i = 1:colChunkWidth:size(finalCO,2)
currChunk = finalCO(:,i:(i+colChunkWidth-1));
if (dispChunks == 1)
disp(currChunk);
end
% Outputs a 1 if the current chunk is self-complementary
isSelfCompl = areCompl(currChunk);
if(isSelfCompl ~= 1)
isGood = 0;
end
% Output a 1 if currChunk and nextChunk have pairwise cross
% correlations that sum to zero
for j = (i+colChunkWidth):colChunkWidth:size(finalCO,2)
nextChunk = finalCO(:,j:(j+colChunkWidth-1));
goodCC = max(abs(sumCCF(currChunk, nextChunk))) < 1e-5;
if(goodCC ~= 1)
isGood = 0;
end
end
end
end