-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaser_subscriber.m
59 lines (43 loc) · 1.08 KB
/
laser_subscriber.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
function [ output_args ] = laser_subscriber(src, msg)
%LASER_SUBSCRIBER Lazer datalarinin alicisi
% simdilik sadece cizim
%plot(msg.Ranges)
%fft_al(msg.Ranges);
wname = 'db2';
scales = 10:1:60;
scales2 = 2;
scales3 = 20:1:22;
array=msg.Ranges;
% figure(1)
%
% subplot(2,1,1)
% plot(array)
%
% sinyal=diff(array,2);
% subplot(2,1,2)
% plot(sinyal)
sinyal=diff(array,2);
% figure(1)
% coefs = cwt(sinyal,scales,wname);
% wscalogram('image',coefs,'scales',scales,'ydata',sinyal);
load('dalga')
figure(2)
coefs2 = cwt(sinyal,scales2,dalga);
wscalogram('image',coefs2,'scales',scales2);
sinyal=double(sinyal);
% figure(3)
% subplot(2,1,1)
% plot(sinyal);
% subplot(2,1,2)
% surf(coefs2)
% coefs3 = cwt(sinyal,scales3,wname);
% wscalogram('image',coefs3,'scales',scales3,'ydata',sinyal);
for a=1:350
sonuc(a)=corr(sinyal(a:a+4),dalga);
end
figure(4)
subplot(2,1,1)
plot(sinyal)
subplot(2,1,2)
plot(sonuc)
end