How to construct Polyphase (Frank) codes in MATLAB I have written a piece of code in MATLAB to generate Frank codes - Pastebin link for pulse compression.

I know that Frank codes are stepped frequency approximations to Linear Frequency modulation(LFM).

LFM Parameters are obtained here:

PW = 100e-6;% Pulse Width
PCR = 100; % Pulse Compression Ratio
CPW = PW/PCR;% Compressed pulse width
Fm = 2/CPW; %Frequency sweep



Stepped frequency approximation to LFM:steppedFreq = 0:Fm/(N-1):Fm;
The phase matrix is generated in the line:Matrix = mod(Matrix*incPhi,360);
Frank code is generated inside the for loop: FCP = [FCP,exp(1j*(2*pift + Matrix(i,p)*pi/180))];
The autocorrelation in dB is calculated here:AutoCorrelationdB = 20*log10(abs(AutoCorrelation)/max(abs(AutoCorrelation)));


My question:

The Peak side lobe level obtained is only around $3.5\textrm{ dB}$. Am I following a correct method for generating Frank codes? The peak side lobe level is given by the formula 20*log10(1/(N*sin(pi/M))) as per the book Principles of Modern Radar: Basic Principles by M.A. Richards - Page 825 which is equal to $29\textrm{ dB}$ for my case($N = 100,M = 10$).
% 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));