-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_dco_response.asv
44 lines (35 loc) · 1.2 KB
/
process_dco_response.asv
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
32
33
34
35
36
37
38
39
40
41
42
43
44
clear; close all; clc;
D = readmatrix('dco_response.csv');
timer = D(:,1);
freqr = D(:,2);
timef = D(:,3);
freqf = D(:,4);
submatrix = [timer' timef'; freqr' freqf'];
submatrix = submatrix';
submatrix = sortrows(submatrix);
time = submatrix(:,1)./1E-9;
freq = submatrix(:,2)./1E9;
idxhi_last = find(freq > 5.68, 1, 'last');
idxlo_first = find(freq < 5.24, 1, 'first');
timehi_last = time(idxhi_last);
timelo_first = time(idxlo_first);
close all;
fig_dcoresponse = figure('Position', [100 100 400 300]); clf;
p(1) = plot(time, freq, 'b', 'LineWidth', 2); hold on;
plot([timehi_last timehi_last], [-10 10], 'k--', 'LineWidth', 2); hold on;
plot([timelo_first timelo_first], [-10 10], 'k--', 'LineWidth', 2); hold on;
plot(time, freq, 'b.', 'MarkerSize', 20); hold on;
%annotation('textarrow', [timehi_last/5.5 timelo_first/5.5], [5.5/5.7 5.5/5.7]);
annotation('doublearrow', [0.4/5.5 ], [3.5/5.7 3.5/5.7]);
grid on;
hold off;
title('DCO freq. vs time for full-scale droop change');
xlabel('Time (ns)');
ylabel('DCO Frequency (GHz)');
xlim([4.5 5.5]);
xticks(4.5:0.1:5.5);
ylim([5.2 5.7]);
yticks(5.2:0.1:5.7);
set(gca, 'FontName', 'calibri');
set(gca, 'FontSize', 12);
saveas(fig_dcoresponse, 'fig_dco_response.png');