Instead of the rectangular waveform used in the End-to-End Radar System example, you can use a phase-coded waveform instead of a rectangular waveform. To do so, replace the phased.RectangularWaveform
System object™ with phased.PhaseCodedWaveform
.
Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step
syntax. For example, replace myObject(x)
with step(myObject,x)
.
waveform = phased.PhaseCodedWaveform('Code','Frank','NumChips',4,... 'ChipWidth',1e-6,'PRF',5e3,'OutputFormat','Pulses',... 'NumPulses',1);
Then, redefine the pulse width, tau
, using the properties of the new waveform.
tau = waveform.ChipWidth*waveform.NumChips;
The remainder of the code is almost identical to the code in the original examples and is presented here without comments. For a detailed explanation of how the code works, see the original End-to-End Radar System example.
antenna = phased.IsotropicAntennaElement('FrequencyRange',[1e9 10e9]); target = phased.RadarTarget('Model','Nonfluctuating',... 'MeanRCS',0.5,'PropagationSpeed',physconst('LightSpeed'),... 'OperatingFrequency',4e9); transmitterplatform = phased.Platform('InitialPosition',[0;0;0],... 'Velocity',[0;0;0]); targetplatform = phased.Platform('InitialPosition',[7000; 5000; 0],... 'Velocity',[-15;-10;0]); [tgtrng,tgtang] = rangeangle(targetplatform.InitialPosition,... transmitterplatform.InitialPosition); Pd = 0.9; Pfa = 1e-6; numpulses = 10; SNR = albersheim(Pd,Pfa,10); maxrange = 1.5e4; lambda = physconst('LightSpeed')/4e9; Pt = radareqpow(lambda,maxrange,SNR,tau,'RCS',0.5,'Gain',20); transmitter = phased.Transmitter('PeakPower',50e3,'Gain',20,... 'LossFactor',0,'InUseOutputPort',true,... 'CoherentOnTransmit',true); radiator = phased.Radiator('Sensor',antenna,... 'PropagationSpeed',physconst('LightSpeed'),... 'OperatingFrequency',4e9); collector = phased.Collector('Sensor',antenna,... 'PropagationSpeed',physconst('LightSpeed'),... 'Wavefront','Plane','OperatingFrequency',4e9); receiver = phased.ReceiverPreamp('Gain',20,'NoiseFigure',2,... 'ReferenceTemperature',290,'SampleRate',1e6,... 'EnableInputPort',true,'SeedSource','Property','Seed',1e3); channel = phased.FreeSpace(... 'PropagationSpeed',physconst('LightSpeed'),... 'OperatingFrequency',4e9,'TwoWayPropagation',false,... 'SampleRate',1e6);
T = 1/waveform.PRF; txpos = transmitterplatform.InitialPosition;
rxsig = zeros(waveform.SampleRate*T,numpulses); for n = 1:numpulses [tgtpos,tgtvel] = targetplatform(T); [tgtrng,tgtang] = rangeangle(tgtpos,txpos); sig = waveform(); [sig,txstatus] = transmitter(sig); sig = radiator(sig,tgtang); sig = channel(sig,txpos,tgtpos,[0;0;0],tgtvel); sig = target(sig); sig = channel(sig,tgtpos,txpos,tgtvel,[0;0;0]); sig = collector(sig,tgtang); rxsig(:,n) = receiver(sig,~txstatus); end rxsig = pulsint(rxsig,'noncoherent'); t = unigrid(0,1/receiver.SampleRate,T,'[)'); rangegates = (physconst('LightSpeed')*t)/2; plot(rangegates,rxsig) hold on xlabel('Meters'); ylabel('Power') ylim = get(gca,'YLim'); plot([tgtrng,tgtrng],[0 ylim(2)],'r') hold off