So, yes, by replicating the sequences to as many cycles as we want to have, we will get periodic peaks of auto-correlations at every multiples of "N", where "N" is the number of cycles we have chosen for replicating the sequence or code set. %% n=100; %length of code K=2; % number of codes N=4; % Number of cycle ab = randn(n,K) + 1j*randn(n,K); % initialisation abc=repmat(ab, [N,1]); %Replicating the codes as many times as nu,mber of cycles "N" EE = xcorr(abc)/N; % find all possible auto and cross correlations %%
The highest peak will be at centre of the correlation length, i.e. at "N*n", where "N" is number of cycles, and "n" is length of the 2-code set we started with (the random initialization). And all other peaks away from this centre will be monotonically reducing in height as we move on each side towards the extremes of correlation length.
In order to normalize, we need to divide the correlations by "N", so that the central peak is normalized to "1", whereas all other peaks are at magnitude less than this.