www.gusucode.com > phased 案例源码 matlab代码程序 > phased/PropagateALinearFMPulseWaveformToTargetAndBackExample.m

    %% Propagate Linear FM Pulse Waveform to Target and Back
% Construct a linear FM pulse waveform of 50 ms duration with a bandwidth
% of 100 kHz. Model the range-dependent time delay and amplitude loss
% incurred during two-way propagation. The pulse propagates between the
% transmitter located at _(1000,250,10)_ and a target located at
% _(3000,750,20)_. The signals propagate at the speed of light.
%%
% *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.LinearFMWaveform('SweepBandwidth',1e5,...
    'PulseWidth',5e-5,'OutputFormat','Pulses',...
    'NumPulses',1,'SampleRate',1e6,'PRF',1e4);
signal = waveform();
channel = phased.FreeSpace('SampleRate',1e6,...
    'TwoWayPropagation',true,'OperatingFrequency',1e9);
y = channel(signal,[1000; 250; 10],[3000; 750; 20],[0;0;0],[0;0;0]);
%%
% Plot the magnitude of the transmitted and received pulse to show the
% amplitude loss and time delay.
t = unigrid(0,1/waveform.SampleRate,1/waveform.PRF,'[)');
subplot(2,1,1)
plot(t.*1e6,abs(signal))
title('Magnitude of Transmitted Pulse')
xlabel('Time (microseconds)')
ylabel('Magnitude')
subplot(2,1,2)
plot(t.*1e6,abs(y))
title('Magnitude of Received Pulse')
xlabel('Time (microseconds)')
ylabel('Magnitude')
%%
% The delay in the received pulse is approximately 14 μs, the
% expected value for a distance of 4.123 km.