Menu

[09bd5b]: / matlab / test_warpavg.m  Maximize  Restore  History

Download this file

43 lines (34 with data), 786 Bytes

 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
clear all; close all;
N= 100;
[si ui times Ri R u] = artificial_data(N, 500, 0);
for i=1:N
sRi(i) = closest(times, Ri(i));
end;
zero = closest(times, 0);
markers = [repmat(zero,[N 1]) sRi'];
uis = ml_denoise(si, 6, 0);
wa = ml_warpavg(uis, markers);
figure(2)
for i=1:N
plot(times, si(:,i), 'Color', [0.9 0.9 0.9]);
if i==1
hold on;
end;
end;
plot(times, u, 'r', 'LineWidth', 3);
plot(times, wa, 'b', 'LineWidth', 2);
plot(times, mean(uis, 2)', 'k');
hold off;
snrwa = snr(u, wa)
snrmean=snr(u, mean(uis, 2)')
rmsewa = rmse(u, wa)
rmsemean=rmse(u, mean(uis, 2)')
%
% figure(1);
% plot(times, s1, 'b');
% hold on;
% plot([Ri(1) Ri(1)], [-10 10], 'b');
% plot(times, s2, 'm');
% plot([Ri(2) Ri(2)], [-10 10], 'm');
% plot(times, wc, 'r');
% hold off;
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.