How to construct Polyphase (Frank) codes in MATLAB
% created by MUSTAFA SAMI AHMED
% Email mustafa_sami87@yahoo.com
clc;
clear all;
M =100;
L=sqrt(M);
bv = 0:L-1;
Matrix = bv'*bv ;
anglout = radtodeg(pi);
% alfa= (4*pi)/(L);

% Matrix_new = alfa*Matrix; 
incPhi = (2*pi)/L; %incremental phase change
Matrix = mod(Matrix*incPhi,2*pi);

b=reshape(Matrix,1,[]); % matrix 1D size 1xM
for p = 1:M
  d(p) = exp(1j*b(p)) ;
end    

AutoCorrelation = xcorr(d);

AutoCorrelationdB =10*log10(abs(AutoCorrelation)/max(abs(AutoCorrelation)));
 figure(1);
 stem(b);
%   x=wden(AutoCorrelationdB,'heursure','h','mln',10,'sym10');
  %x=wiener2(AutoCorrelationdB, [3 80 ]);
  figure(2);
plot((AutoCorrelationdB));