www.gusucode.com > phased 案例源码 matlab代码程序 > phased/EstimateULAPositionTaperUsingPilotCalibrationExample.m
%% Estimate ULA Element Position and Taper Errors Using Pilot Calibration % Construct a 7-element ULA array of isotropic antenna elements spaced % one-half wavelength apart. Assume the array is geometrically perturbed in % three dimensions. Perform pilot calibration on the array using 4 pilot % sources at azimuth and elevation angles of (-60,0), (10,80), (40,-40), % and (-80,0) degrees. For the calibration process, pilot signals have an % SNR of 30 dB. Each pilot signal containes 10,000 samples. Assume the % signals have a frequency of 600 MHz. %% Set up the ULA with nominal parameters % fc = 600e6; c = physconst('LightSpeed'); lam = c/fc; d = 0.5*lam; sIso = phased.IsotropicAntennaElement('FrequencyRange',[100,900]*1e6); Nelem = 7; NominalTaper = ones(1,Nelem); sULA = phased.ULA('Element',sIso,'NumElements',Nelem,'ElementSpacing',d,... 'Taper',NominalTaper); %% Create the pilot signals % Randomly perturb the element positions using a Gaussian distribution that % has a standard deviation of 0.1 wavelength. Do not perturb the position % of the first element. posstd = 0.1; rng default NominalElementPositions = getElementPosition(sULA)/lam; ReferenceElement = NominalElementPositions(:,1); PositionPert = [zeros(3,1),posstd*randn(3,Nelem-1)]; ActualElementPositions = NominalElementPositions + PositionPert; %% % Perturb the taper in magnitude and phase. Do not perturb the first taper. tapermagstd = 0.15; taperphasestd = 0.15; tapermagpert = tapermagstd*[0; randn(Nelem-1,1)]; ActualTaper = NominalTaper' + tapermagpert; taperphasepert = taperphasestd*[0;randn(Nelem-1,1)]; ActualTaper = ActualTaper.*exp(1i*taperphasepert); %% % Generate the signals using the perturbed positions, tapers and four % pilot sources. Nsamp = 10000; ncov = 0.001; PilotAng = [-60,10,40,-80; 10,80,-40,0]; Npilot = size(PilotAng,2); for n = 1:Npilot X(:,:,n) = sensorsig(ActualElementPositions,Nsamp,..., PilotAng(:,n),ncov,'Taper',ActualTaper); end %% Perform the pilot calibration % [estpos,esttaper] = pilotcalib(... NominalElementPositions - ReferenceElement*ones(1,Nelem),... X,PilotAng); %% % Add back the position of the reference sensor estpos = estpos + NominalElementPositions(:,1)*ones(1,Nelem); %% Examine the root mean square (RMS) error of the calibrated parameters % Compute the RMS values of the initial taper perturbations. tapermagpertRMSE = sqrt(tapermagpert'*tapermagpert/Nelem); taperphasepertRMSE = sqrt(taperphasepert'*taperphasepert/Nelem); %% % Compute the RMS value of the calibrated taper magnitude error. diff = abs(ActualTaper) - abs(esttaper); diff2 = diff'*diff; tapermagsolvRMSE = sqrt(diff2/Nelem); %% % Compare the calibrated RMS magnitude error to the initial RMS magnitude % error. The calibration reduces the RMS magnitude error. disp(tapermagsolvRMSE/tapermagpertRMSE) %% % Compute the RMS value of the calibrated taper phase error. diff = unwrap(angle(ActualTaper) - angle(esttaper)); diff2 = diff'*diff; tapersolvphaseRMSE = sqrt(diff2/Nelem); %% % Compare the calibrated RMS phase error to the initial RMS phase error. % The calibration reduces the RMS phase error. disp(tapersolvphaseRMSE/taperphasepertRMSE) % Compute the RMS value of the initial position error. numpos = 3*Nelem; initposRMSE = sqrt(sum(PositionPert(:).^2)/numpos); %% % Compute the RMS value of the calibrated position error. solvposErr = ActualElementPositions - estpos; solvposRMSE = sqrt(sum(solvposErr(:).^2)/(numpos)); %% % Compare the calibrated RMS position error to the initial position RMS error. % The calibration reduces the RMS position error. disp(solvposRMSE/initposRMSE)