-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplotPhasewu.m
More file actions
31 lines (27 loc) 路 1.25 KB
/
Copy pathplotPhasewu.m
File metadata and controls
31 lines (27 loc) 路 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [phasePlot]=plotPhasewu(Radar,Digitizer,Sampling,LocFinder,Spec_shift,RMS_Amplitude,DoUnWrapping,titleText)
% PLOTPHASE Summary of this function goes here
% Detailed explanation goes here
phasePlot=figure('Name',titleText,'NumberTitle','off');
for i=1:length(LocFinder.locs_positive)
lineWithPeak=find(Sampling.f==LocFinder.locs_positive(i));
if DoUnWrapping==true
angleArray=1000*(Radar.lambda/(4*pi))*unwrap(angle(Spec_shift(lineWithPeak,1:Digitizer.wfrm))-angle(Spec_shift(lineWithPeak,1)));
else
angleArray=angle(Spec_shift(lineWithPeak,1:Digitizer.wfrm))-angle(Spec_shift(lineWithPeak,1));
end
plot(Radar.t_frame,(angleArray))
title(['Phase of Frequency ',num2str(LocFinder.locs_positive(i)),'Hz @ ',num2str((Radar.Tm*Radar.c_0 .*LocFinder.locs_positive(i))/(2*Radar.deltaf)),' m'])
if DoUnWrapping==true
ylabel('Offset (mm)')
else
ylabel('\phi (rad)')
ylim([-pi pi])
end
yyaxis right
plot(Radar.t_frame,mag2db(RMS_Amplitude/max(RMS_Amplitude)));
ylabel('Magnitude (dB)')
grid on
ax=gca;
ax.YAxis(1).Color=[0, 0.4470, 0.7410];
end
end