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

    %% Propagation of Polarized Field from Source to Target
% Create a uniform linear array (ULA) consisting of four short-dipole antenna
% elements that support polarization. Set the orientation of each dipole to
% the z-direction. Set the operating frequency to 300 MHz and the element
% spacing of the array to 0.4 meters. While the antenna element supports
% polarization, you must explicitly enable polarization in the Radiator
% System object.

% Copyright 2015 The MathWorks, Inc.


%%
% Create the short-dipole antenna element, ULA array, and radiator
% System objects. Set the |CombineRadiatedSignals| property to |true| to
% coherently combine the radiated signals from all antennas and the
% |EnablePolarization| property to true to process polarized waves.
freq = 300e6;
nsensors = 4;
c = physconst('LightSpeed');
sAnt = phased.ShortDipoleAntennaElement('FrequencyRange',[100e6 900e6],...
    'AxisDirection','Z');
sArray = phased.ULA('Element',sAnt,...
    'NumElements',nsensors,...
    'ElementSpacing',0.4);
sRad = phased.Radiator('Sensor',sArray,...
    'PropagationSpeed',c,...
    'OperatingFrequency',freq,...
    'CombineRadiatedSignals',true,...
    'EnablePolarization',true,...
    'WeightsInputPort',true);

%%
% Create a signal to be radiated. In this case, the signal consists of one
% cycle of a 4 kHz sinusoid. Set the signal amplitude to unity. Set the
% sampling frequency to 8 kHz. Choose a radiating angles of 0 degrees
% azimuth and 20 degrees elevation. polarization, you must set a local axes
% - in this case chosen to coincide with the global axes. Set uniform
% weights on the elements of the array.
fsig = 4000;
fs = 8000;
A = 1;
t = [0:0.01:2]/fs;
signal = A*sin(2*pi*fsig*t');
radiatingAngles = [0;20];
laxes = ones(3,3);
y = step(sRad,signal,radiatingAngles,laxes,[1,1,1,1].');
disp(y)
%%
% The radiated signal is a |struct| containing the polarized field.
%%
% Use a |FreeSpace| System object to propagate the field from the origin to
% the destination.
sFree = phased.FreeSpace('PropagationSpeed',c,...
    'OperatingFrequency',freq,...
    'TwoWayPropagation',false,...
    'SampleRate',fs);

%%
% Set the signal origin, signal origin velocity, signal
% destination, and signal destination velocity.
origin_pos = [0; 0; 0];
dest_pos = [500; 200; 50];
origin_vel = [10; 0; 0];
dest_vel = [0; 15; 0];

%%
% Call the FreeSpace object |step| method to propagate the signals.
yprop = step(sFree,y,origin_pos,dest_pos,...
    origin_vel,dest_vel);

%%
% Plot the x-component of the propagated signals.
figure
plot(1000*t,real(yprop.X))
xlabel('Time (millisec)')