Problem Matched Filtering in Matlab.

조회 수: 11 (최근 30일)
Mail Abos
Mail Abos 2013년 3월 20일
I got the source code for simulation Mached Filtering in Matlab :
clear; clc
hsensor = phased.IsotropicAntennaElement(...
'FrequencyRange',[5e9 15e9]);
htx = phased.Transmitter('Gain',20,'InUseOutputPort',true);
fc = 10e9;
htgt = phased.RadarTarget('Model','Nonfluctuating',...
'MeanRCS',1,'OperatingFrequency',fc);
txloc = [0;0;0];
tgtloc = [5000;5000;10];
htxloc = phased.Platform('InitialPosition',txloc);
htgtloc = phased.Platform('InitialPosition',tgtloc);
[tgtrng,tgtang] = rangeangle(htgtloc.InitialPosition,...
htxloc.InitialPosition);
hwav = phased.RectangularWaveform('PulseWidth',25e-6,...
'OutputFormat','Pulses','PRF',1e4,'NumPulses',1);
c = physconst('LightSpeed');
maxrange = c/(2*hwav.PRF);
SNR = npwgnthresh(1e-6,1,'noncoherent');
Pt = radareqpow(c/fc,maxrange,SNR,...
hwav.PulseWidth,'RCS',htgt.MeanRCS,'Gain',htx.Gain);
htx.PeakPower = Pt;
hrad = phased.Radiator('PropagationSpeed',c,...
'OperatingFrequency',fc,'Sensor',hsensor);
hspace = phased.FreeSpace('PropagationSpeed',c,...
'OperatingFrequency',fc,'TwoWayPropagation',false);
hcol = phased.Collector('PropagationSpeed',c,...
'OperatingFrequency',fc,'Sensor',hsensor);
hrec = phased.ReceiverPreamp('NoiseFigure',0,...
'EnableInputPort',true,'SeedSource','Property','Seed',2e3);
hmf = phased.MatchedFilter(...
'Coefficients',getMatchedFilter(hwav),...
'GainOutputPort',true);
% Generate waveform
wf = step(hwav);
% Transmit waveform
[wf,txstatus] = step(htx,wf);
% Radiate pulse toward the target
wf = step(hrad,wf,tgtang);
% Propagate pulse toward the target
wf = step(hspace,wf,txloc,tgtloc,[0;0;0],[0;0;0]);
% Reflect it off the target
wf = step(htgt,wf);
% Propagate the pulse back to transmitter
wf = step(hspace,wf,tgtloc,txloc,[0;0;0],[0;0;0]);
% Collect the echo
wf = step(hcol,wf,tgtang);
% Receive target echo
rx_puls = step(hrec,wf,~txstatus);
[mf_puls,mfgain] = step(hmf,rx_puls);
% Get group delay of matched filter
Gd = length(hmf.Coefficients)-1;
% The group delay is constant
% Shift the matched filter output
mf_puls=[mf_puls(Gd+1:end); mf_puls(1:Gd)];
subplot(2,1,1);
t = unigrid(0,1e-6,1e-4,'[)');
rangegates = c.*t;
rangegates = rangegates/2;
plot(rangegates,abs(rx_puls)); title('Received Pulse');
ylabel('Amplitude'); hold on;
plot([tgtrng, tgtrng], [0 max(abs(rx_puls))],'r');
subplot(2,1,2)
plot(rangegates,abs(mf_puls)); title('With Matched Filtering');
xlabel('Meters'); ylabel('Amplitude'); hold on;
plot([tgtrng, tgtrng], [0 max(abs(mf_puls))],'r');
  댓글 수: 1
Mail Abos
Mail Abos 2013년 3월 20일
But, after i run this source code on Matlab, its can not run, there is error appears :
Error using phased.FreeSpace/step Too many input arguments; expected 3 (in addition to the object handle), got 5.
Please help to solve this problem, so this code can run on Matlab. Thank you very much.

댓글을 달려면 로그인하십시오.

채택된 답변

Honglei Chen
Honglei Chen 2013년 3월 20일
This is because you are using an older version of Phased Array System Toolbox. Technically, you just need to replace the following lines
wf = step(hspace,wf,txloc,tgtloc,[0;0;0],[0;0;0]);
with
wf = step(hspace,wf,txloc,tgtloc);
and it should run. However, you may want to find the corresponding example in your version to make sure other things are matched too.
The additional arguments are added in a later release so the Doppler effect within a pulse can be modeled. This is important for modeling range-Doppler coupling effect.
HTH

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by