-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulation_3.m
41 lines (30 loc) · 949 Bytes
/
simulation_3.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
function simulation_3()
%% function simulation_3()
%
% Human NREM sleep
%
%
%% parameters
rng(10000);
data.N_smearing = 100000;
data.N_meas = 100000;
data.order = 1;
[amplitude, zenith] = meshgrid( 0.1:0.1:0.5, (1:2:24)/24*2*pi);
data.true.amplitude = amplitude(:);
data.true.zenith = zenith(:);
order = [ 30 36 setdiff(1:length(data.true.zenith), [30 36] ) ];
data.true.zenith = data.true.zenith(order);
data.true.amplitude = data.true.amplitude(order);
%% create acceptance
f = load('data/human_data.mat');
data.acceptance = f.data(2,1).acceptance;
%% induce and unfold
data = induce_and_unfold( data );
for i=1:2
fprintf('Induced: %.1f %.1f\n', data.true.amplitude(i), data.true.zenith(i)/pi*12 );
fprintf('Measured: %.1f %.1f\n', data.meas.amplitude(i), data.meas.zenith(i)/pi*12 );
end
%% plot
plot_simulation_results( data );
%% save
print('plots/simulation_3.svg','-dsvg');