Advertisement
Guest User

Generation of Frank codes in MATLAB

a guest
Aug 28th, 2014
899
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. close all;clear all;clc;
  2. % Generation of Frank Codes
  3.  
  4. PW = 100e-6;% Pulse Width
  5. PCR = 100; % Pulse Compression Ratio
  6. CPW = PW/PCR;% Compressed pulse width
  7. Fm = 2/CPW; %Frequency sweep
  8.  
  9. N = floor(sqrt(PCR));
  10.  
  11.  
  12. steppedFreq = 0:Fm/(N-1):Fm; %stepped frequency approximation to LFM
  13.  
  14. Fs = 8e6; %sampling frequency 4 times Fm assuming bandpass sampling
  15.  
  16. bv = 0:N-1;
  17.  
  18. Matrix = bv'*bv ;
  19.  
  20. incPhi = 360/N; %incremental phase change
  21.  
  22. Matrix = mod(Matrix*incPhi,360);
  23.  
  24. FCP = []; %Frank code
  25.  
  26. t = (0:Fs/(Fm/2)-1)./Fs; %time vector
  27.  
  28. i = 1;
  29.  
  30. for f = steppedFreq
  31.  
  32. for p = 1:N
  33.  
  34. FCP = [FCP,exp(1j*(2*pi*f*t + Matrix(i,p)*pi/180))];
  35.  
  36. end
  37. i = i + 1;
  38.  
  39. end
  40.  
  41. AutoCorrelation = xcorr(FCP);
  42.  
  43. AutoCorrelationdB = 20*log10(abs(AutoCorrelation)/max(abs(AutoCorrelation)));
  44. plot(AutoCorrelationdB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement