Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;clear all;clc;
- % Generation of Frank Codes
- PW = 100e-6;% Pulse Width
- PCR = 100; % Pulse Compression Ratio
- CPW = PW/PCR;% Compressed pulse width
- Fm = 2/CPW; %Frequency sweep
- N = floor(sqrt(PCR));
- steppedFreq = 0:Fm/(N-1):Fm; %stepped frequency approximation to LFM
- Fs = 8e6; %sampling frequency 4 times Fm assuming bandpass sampling
- bv = 0:N-1;
- Matrix = bv'*bv ;
- incPhi = 360/N; %incremental phase change
- Matrix = mod(Matrix*incPhi,360);
- FCP = []; %Frank code
- t = (0:Fs/(Fm/2)-1)./Fs; %time vector
- i = 1;
- for f = steppedFreq
- for p = 1:N
- FCP = [FCP,exp(1j*(2*pi*f*t + Matrix(i,p)*pi/180))];
- end
- i = i + 1;
- end
- AutoCorrelation = xcorr(FCP);
- AutoCorrelationdB = 20*log10(abs(AutoCorrelation)/max(abs(AutoCorrelation)));
- plot(AutoCorrelationdB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement