-
Notifications
You must be signed in to change notification settings - Fork 0
/
memread.m
72 lines (64 loc) · 1.44 KB
/
memread.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
% close all;
mraw = memmapfile('RLS_2_fileRLS_FFT_009.b',...
'Offset',0,...
'Repeat',50000,...
'Format',{...
'uint32',1,'size';...
'double',1,'time';...
'uint32',1,'senderID';...
'uint32',1,'signalType';...
'uint32',1,'signalMode';...
'uint32',1,'line_num';...
'uint32',1,'pos';...
'single',4096,'spectr'});
s1 = [];
pos = [];
k = 1;
for ii = 1:50000
pos(ii) = mraw.Data(ii).pos;
if ii > 1 && pos(ii-1) > pos(ii)
posnum(k) = ii - 1;
k = k + 1;
end
end
s1 = [];
for ii = posnum(1) : (posnum(2)-1)
s1 = [s1 mraw.Data(ii).spectr];
end
s4 = [];
Nrot1 = 50;
Nrot2 = 50;
for M = Nrot1:Nrot2
k = 0; %êîëè÷åñòâî àçèìóòîâ
s2 = [];
for ii = posnum(M) : (posnum(M+1)-1)
s2 = [s2 mraw.Data(ii).spectr];
k = k + 1;
end
s3 = [];
for j = 1:4096
s3 = [s3 (interp1(1:k, s2(j,1:k), 1:(k/801):k))'];
end
s3 = s3';
s4(:,:,M) = s3;
end
% subplot(1,2,1);
polarplot3d(s4(1:2000,:,50), 'RadialRange', [0 1])
% colormap(gray)
caxis([0 20])
set(gca,'Xlim',[-1.1 1.1],'Ylim',[-1.1 1.1])
view(2);
% im = rgb2gray(im);
% figure
% imshow(im)
% for i = 1:4096
% for j = 1:1000
% s4(i,j,:) = medfilt1(s4(i,j,:));
% end
% end
%
% subplot(1,2,2);
% polarplot3d(s4(:,:,50), 'RadialRange', [0 1]);
% caxis([0 20]);
% set(gca,'Xlim',[-1.1 1.1],'Ylim',[-1.1 1.1]);
% view(2);