from implementation of digital pulse compression using matlab by siddhu
The Main Objective of the project is to Design the Pulse compression filter(Matched filter)

matched21.m
tic;
clc;
clf;
BW=5*10^6;%bandwidth
T=51.2*10^-6;%pulse width
fc=0;
n=fix(2*BW*T+1);% sampling points
sampling_interval = T / n;
freqlimit = 0.5/ sampling_interval;
alpha=BW/(T);%chirp rate
disp(alpha);
t=linspace(-T/2,T/2,n);%time interval

ichannel1=cos(2*pi*((fc)*t+alpha*t.^2));%real part
%imaginary part
qchannel2=sin(2*pi*((fc)*t+alpha*t.^2));
LFMD=1.414*(ichannel1+(1i.*qchannel2));%complex part of base band signal
LFMD(2:1:10)=0;
LFMD(504:1:511)=0;
disp(LFMD);
% freqmin=fc+BW/2;%minimum frequency at t= -T/2;
% freqmax=fc-BW/2;%maximum frequnecy at t=  T/2;
freq = linspace(-freqlimit/2,freqlimit/2,n);
FLFMD=fftshift(fft(LFMD));%frequency domain of lfm
[lfm,frei,flfm]=lffm1(BW,n,T);
figure(1)
 subplot(3,1,1)
 plot(freq,abs((FLFMD)),frei,abs(flfm));
 grid;
 xlabel('frequency');
 ylabel('amplitude')
 title('baseband and input signals of pulse compression filter');
 %plot(t,((LFMD)),'k')
% plot(t,(lfm),'k');
  rep=fliplr(LFMD);
  N=4097;%intilization of buffer value
ovr=1638;%overlap value
%for 10% overlap calling function
if ovr<=N*0.1
[YN11,t1]=ovsav1(LFMD,lfm,N,ovr);
 subplot(2,1,2)
  plot(t1,(YN11),'k');
grid;
%for 20% overlap calling function
elseif ovr<=N*0.2
    [YN11,t1]=ovsav2(LFMD,lfm,N,ovr);
 subplot(2,1,2)
 plot(t1,(YN11),'k');
grid;
%for 25%overlap calling function
elseif ovr<=N*0.25
    [YN11,t1]=ovsav3(LFMD,lfm,N,ovr);
 subplot(2,1,2)
 plot(t1,(YN11),'k');
grid;
%for 30%overlap calling function
elseif ovr<=N*0.3
     [YN11,t1]=ovsav4(LFMD,lfm,N,ovr);
 subplot(2,1,2)
 plot(t1,(YN11),'k');
grid;
%for 40%overlap calling function
elseif ovr<=N*0.4
[YN11,t1,n1]=ovsav51(LFMD,lfm,N,ovr,n);
 subplot(3,1,3)
 plot(t1,(YN11));
 xlabel('time domain')
 ylabel('amplitude')
 title('output of the pulse compression filter using overlap save method')
 grid;
 else 
 break;
end
toc;
    
 

Contact us at files@mathworks.com