-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgenfig_R1_3_RD_MCS_TFR.m
132 lines (108 loc) · 3.02 KB
/
genfig_R1_3_RD_MCS_TFR.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
close all;
conf_genfig;
%% global var
L = 4096;
t = (0:L-1)'/L;
%% Signal def
% B = 3*L/4;
% phi_LC = L/8*t+B*(t.^2)/2;
% s_LC = exp(2*1i*pi*phi_LC);
% sigma_LC = 1/sqrt(B);
%
% B = floor(2*L/(2*pi));
% phi_cos = L/2*t+B/(2*pi)*cos(2*pi*t);
% s_cos = exp(2*1i*pi*phi_cos);
% sigma_cos = 0.0142;
%
% B = log(4096 - 510);
% phi_exp = 500*t+exp(B*t)/B;
% s_exp = exp(2*1i*pi*phi_exp);
% sigma_exp = 0.028;
phi1 = 256*t+2700*(t.^2)/2;
phi2 = 768*t+3000*(t.^2)/2;
s1 = exp(2*1i*pi*phi1);
s2 = exp(2*1i*pi*phi2);
s_LC = s1 + s2;
sigma_LC = 0.0188;
phi1 = 1400*t+1350/(2*pi)*cos(2*pi*t + pi/2);
phi2 = 3400*t+550/(2*pi)*cos(2*pi*t);
s1 = exp(2*1i*pi*phi1);
s2 = exp(2*1i*pi*phi2);
s_cos = s1 + s2;
sigma_cos = 0.0175;
B1 = log(2000);
phi1 = 200*t+2300*(t.^2)/2;
phi2 = 2000*t+exp(B1*t)/B1;
s1 = exp(2*1i*pi*phi1);
s2 = exp(2*1i*pi*phi2);
s_exp = s1 + s2;
sigma_exp = 0.0241;
%% test
SNR_in = -10;
Nfft = 512;
smooth_p = 1 - 10^(-4);
Nr = 2;
% 3 FIG sig. MCS
% 3 Courbes (spline, std sup, std inf)
%% LC
% noise = randn(L, 1)+1i*randn(L, 1);
load('mat/noise_R1_TFR_RD_LC.mat');
s_noise = add_noise(s_LC, noise, SNR_in);
[STFT, TFR] = sst2(s_noise, sigma_LC, Nfft);
QM = TFR.q_hat;
omega = TFR.omega1_hat;
tau = TFR.tau;
[Spl_LC, ~] = RRP_RD(STFT, QM, omega, tau, smooth_p, Nr);
Spl = Spl_LC;
sigma_s = sigma_LC;
IF1 = fnval(Spl(1).spline, t);
DF1 = fnval(fnder(Spl(1).spline), t);
R1 = 1/(sqrt(2*pi)*sigma_s)*sqrt(1 + sigma_s^4*DF1.^2);
IF2 = fnval(Spl(2).spline, t);
DF2 = fnval(fnder(Spl(2).spline), t);
R2 = 1/(sqrt(2*pi)*sigma_s)*sqrt(1 + sigma_s^4*DF2.^2);
% save('noise_R1_TFR_RD_LC.mat', 'noise');
fname = 'fig_R1_TFR_RD_LC';
R1_plot_fig5(STFT, IF1, R1, IF2, R2, fname);
% return;
%% cos
% noise = randn(L, 1)+1i*randn(L, 1);
load('mat/noise_R1_TFR_RD_cos.mat');
s_noise = add_noise(s_cos, noise, SNR_in);
[STFT, TFR] = sst2(s_noise, sigma_cos, Nfft);
QM = TFR.q_hat;
omega = TFR.omega1_hat;
tau = TFR.tau;
[Spl_cos, ~] = RRP_RD(STFT, QM, omega, tau, smooth_p, Nr);
Spl = Spl_cos;
sigma_s = sigma_cos;
IF1 = fnval(Spl(1).spline, t);
DF1 = fnval(fnder(Spl(1).spline), t);
R1 = 1/(sqrt(2*pi)*sigma_s)*sqrt(1 + sigma_s^4*DF1.^2);
IF2 = fnval(Spl(2).spline, t);
DF2 = fnval(fnder(Spl(2).spline), t);
R2 = 1/(sqrt(2*pi)*sigma_s)*sqrt(1 + sigma_s^4*DF2.^2);
% save('noise_R1_TFR_RD_cos.mat', 'noise');
fname = 'fig_R1_TFR_RD_cos';
R1_plot_fig5(STFT, IF1, R1, IF2, R2, fname);
% return;
%% exp
% noise = randn(L, 1)+1i*randn(L, 1);
load('mat/noise_R1_TFR_RD_exp.mat');
s_noise = add_noise(s_exp, noise, SNR_in);
[STFT, TFR] = sst2(s_noise, sigma_exp, Nfft);
QM = TFR.q_hat;
omega = TFR.omega1_hat;
tau = TFR.tau;
[Spl_exp, ~] = RRP_RD(STFT, QM, omega, tau, smooth_p, Nr);
Spl = Spl_exp;
sigma_s = sigma_exp;
IF1 = fnval(Spl(1).spline, t);
DF1 = fnval(fnder(Spl(1).spline), t);
R1 = 1/(sqrt(2*pi)*sigma_s)*sqrt(1 + sigma_s^4*DF1.^2);
IF2 = fnval(Spl(2).spline, t);
DF2 = fnval(fnder(Spl(2).spline), t);
R2 = 1/(sqrt(2*pi)*sigma_s)*sqrt(1 + sigma_s^4*DF2.^2);
% save('noise_R1_TFR_RD_exp.mat', 'noise');
fname = 'fig_R1_TFR_RD_exp';
R1_plot_fig5(STFT, IF1, R1, IF2, R2, fname);