forked from xkonni/raspberry-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codes.m
27 lines (23 loc) · 1.01 KB
/
codes.m
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
% raw data received by arduino
remote=[10272 412 912 1064 276 400 932 1088 244 404 932 1088 248 416 920 392 952 384 940 1088 248 396 940 1080 248 424 912 400 944 392 952 1056 268 388 948 1060 268 408 932 1052 284 388 948 400 932 388 952 1040 296];
hi1=[10152 428 952 1120 268 436 952 1124 256 504 876 1104 284 424 952 496 884 432 956 1084 288 460 928 1096 296 420 956 460 924 432 960 1096 276 436 944 1088 308 424 952 1104 280 424 956 420 952 476 912 1068 312];
hi2=[11016 468 976 1136 296 448 972 1168 284 420 1012 1136 296 428 1012 404 1016 452 972 1140 296 428 1004 1176 260 436 992 408 1008 452 968 1136 292 416 1040 1180 304 380 1052 1132 300 420 1016 412 1028 424 1012 1140 316];
% calculate total timings per bit sent
for ii=2:2:48
g(ii/2)=remote(ii)+remote(ii+1);
s1(ii/2)=hi1(ii)+hi1(ii+1);
s2(ii/2)=hi2(ii)+hi2(ii+1);
end
% calculate factor
qh1=remote./hi1;
qh2=remote./hi2;
% min and max values
mh1=[min(qh1) max(qh1)]
mh2=[min(qh2) max(qh2)]
% plot
figure(1)
hold off
clf
hold on
plot(qh1, 'b');
plot(qh2, 'r');