If you can't read please download the document
Upload
assignmentpedia
View
105
Download
1
Embed Size (px)
Citation preview
2. if ii==1, %% Array Response figure('WindowStyle','docked'); polar(deg2rad(scanAz(:)),abs(resp)); ax = gca; else polar(ax,deg2rad(scanAz(:)),abs(resp)); end viewSignals.m % Copyright 2013 The MathWorks, Inc %% Setup Visuals if m == 1 sScope = dsp.TimeScope('SampleRate',fs,... 'TimeSpan',10/prf,'Grid',true,... 'LayoutDimensions',[1 2],'MaximizeAxes','off', ... 'Position',[371 646 1000 409],'NumInputPorts',2); set(sScope,'ActiveDisplay',2,'YLabel','Magnitude','Title','Collected Signal') set(sScope,'ActiveDisplay',1,'YLabel','Magnitude','Title','Transmitted Signal') show(sScope); %% Range Doppler Map figure('WindowStyle','docked') hrdmap = imagesc(sgrid,rgrid,abs(rdmap)); xlabel('Speed (m/s)'); ylabel('Range (m)'); title('Range Doppler Map'); %% Detection and Range Estimation figure('WindowStyle','docked') tgtrange = [NaN NaN NaN]; pmax = tgtrange; hold on for n=1:3, plot(sTgtMotion{n}.InitialPosition(1)*ones(2,1),[0 7e-5],'r:') htext(n) = text(tgtrange(n),1.05*pmax(n),int2str(tgtrange(n))); %#ok end legend('Initial Range') xlabel('Range (m)'); ylabel('Magnitude'); title ('Estimated Range') hbar = sqrt(threshold)*ones(numel(fast_time),1); hline = plot(range_gates,[hbar hbar]); % Threshold offset = numel(sMFilt.Coefficients)-1; end %% Stream Signals step(sScope,abs(s),abs(rsig)); % Ctrl + A to scale axis limits set(hrdmap,'CData',abs(fliplr(rdmap))) drawnow 3. set(hline(2),'YData',[intpulses(offset:numel(fast_time)); NaN*ones(offset-1,1)]) for n=1:3, set(htext(n),'String',int2str(tgtrange(n)),'Position',[tgtrange(n) 1.05*pmax(n)]); end viewTrajectories.m %Copyright 2013 The MathWorks, Inc if ii==1, %% Global Coordinate System figure('WindowStyle','docked'); hold on; grid on antT = nan(3,N); % Array trajectory tgtT = nan(3,N); % Target trajectory antT = [antT(:,2:end) antpos/1e3]; tgtT = [tgtT(:,2:end) tgtpos/1e3]; hant = plot3(antT(1,:),antT(2,:),antT(3,:),'LineWidth',2); htgt = plot3(tgtT(1,:),tgtT(2,:),tgtT(3,:),'LineWidth',2,'Color','red'); axis([-100 100 -100 50 0 50]) xlabel('X'), ylabel('Y'), zlabel('Z') title('Global Coordinate System','FontWeight','bold') view(40,48) legend('Antenna','Target') %% Target Trajectory in Local Coordinate System (from antenna perspective) h2 = figure('WindowStyle','docked'); hold on; grid on axis([-130 0 6 13 0 50]) xlabel('Azimuth'), ylabel('Range'), zlabel('Elevation') title('Local Coordinate System','FontWeight','bold') view(-40,48) %% Array visualization figure('WindowStyle','docked'); viewArray(sAnt,'ShowSubarray','None') bx = get(gca,'Children'); hdots = bx(8); ndots = numel(get(hdots,'XData')); green = ones(ndots,1)*[0 1 0]; view(40,48) else %% Highlight active arrays mn=face(:)*ones(1,ndots); hlgt=repmat([mn(1,1:16) mn(2,17:32) mn(3,33:48) mn(4,49:64)],3,1); set(hdots,'CData',green.*hlgt'); %% Update global trajectories antT = [antT(:,2:end) antpos/1e3]; 4. tgtT = [tgtT(:,2:end) tgtpos/1e3]; set(hant,'XData',antT(1,:),'YData',antT(2,:),'ZData',antT(3,:)) set(htgt,'XData',tgtT(1,:),'YData',tgtT(2,:),'ZData',tgtT(3,:)) end %% Update local trajectory figure(h2) plot3(AzEl(1),range/1e4,AzEl(2),'ro','MarkerSize',20-round(range/1e4)) visit us at www.assignmentpedia.com or email us at [email protected] or call us at +1 520 8371215