Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tff2020
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
skmad-suite
tff2020
Commits
cbc60b86
Commit
cbc60b86
authored
4 years ago
by
Marina Kreme
Browse files
Options
Downloads
Patches
Plain Diff
refactor
parent
6c1132aa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#5971
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/tfgm/scripts/exp_all_tffP.m
+159
-180
159 additions, 180 deletions
matlab/tfgm/scripts/exp_all_tffP.m
matlab/tfgm/scripts/exp_gabmul_eigs_properties.m
+5
-0
5 additions, 0 deletions
matlab/tfgm/scripts/exp_gabmul_eigs_properties.m
with
164 additions
and
180 deletions
matlab/tfgm/scripts/exp_all_tffP.m
+
159
−
180
View file @
cbc60b86
...
@@ -6,69 +6,102 @@ clc; clear; close all;
...
@@ -6,69 +6,102 @@ clc; clear; close all;
% [1] Time-frequency fading algorithms based on Gabor multipliers,
% [1] Time-frequency fading algorithms based on Gabor multipliers,
% A. Marina Kreme Valentin Emiya, Caroline Chaux, and Bruno Torresani
% A. Marina Kreme Valentin Emiya, Caroline Chaux, and Bruno Torresani
%%
%%
w
b_list
=
{
'car'
,
'plane'
,
'train'
};
w
ideband_name
=
{
'car'
,
'plane'
,
'train'
};
loc
_
li
st
=
{
'beeps'
,
'bird'
,
'clicks'
,
'finger_snaps'
,
'modulations'
};
loc
a
li
zed_name
=
{
'beeps'
,
'bird'
,
'
chirps'
,
'
clicks'
,
'finger_snaps'
,
...
,
win_list
=
{
'gauss 256'
,
'hann 512
'
};
'modulations
'
};
wins_params
=
struct
(
'Gauss256'
,
struct
(
'win_type'
,
'gauss'
,
'win_len'
,
...
,
256
,
'hop_ratio'
,
1
/
4
,
'nbins_ratio'
,
4
,
'win_dur'
,
256
/
8000
),
...
,
'Hann512'
,
struct
(
'win_type'
,
'hann'
,
'win_len'
,
512
,
...
,
'hop_ratio'
,
1
/
8
,
'nbins_ratio'
,
2
,
'win_dur'
,
512
/
8000
));
keys
=
fieldnames
(
wins_params
);
%%
tol_subregions
=
1e-5
;
tol_subregions
=
1e-5
;
gamma
=
0.7
;
gamma
=
0.7
;
fs
=
8000
;
sig_len
=
16384
;
signal_params
=
generate_signal_parameters
(
fs
,
sig_len
);
%%
%%
f
=
fopen
(
'exp_
1area_cuicui
.csv'
,
'w'
);
f
=
fopen
(
'exp_
tffP_car_bird
.csv'
,
'w'
);
fprintf
(
f
,
'%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s
%s
\n'
,
'loc_src'
,
'wb_src'
,
...
,
fprintf
(
f
,
'%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s \n'
,
'loc_src'
,
'wb_src'
,
...
,
'win_type'
,
'win_len'
,
't_oracle'
,
't_
true_energy'
,
't_
est'
,
't_arrf'
,
...
,
'win_type'
,
'win_len'
,
't_oracle'
,
't_est'
,
't_arrf'
,
...
,
't_evdn'
,
't_ut_x'
,
'sdr_mix'
,
'sdr_interp'
,
'sdr_zero'
,
'sdr_est'
,
...
,
't_evdn'
,
't_ut_x'
,
'sdr_mix'
,
'sdr_interp'
,
'sdr_zero'
,
'sdr_est'
,
...
,
'sdr_oracle'
,
'is_interp'
,
'is_mix'
,
'is_true'
,
'is_zero'
,
'is_est'
);
'sdr_oracle'
,
'is_interp'
,
'is_mix'
,
'is_true'
,
'is_zero'
,
'is_est'
);
%%
%%
for
win
=
1
:
length
(
win_list
)
for
win_param
=
1
:
length
(
keys
)
%[win_type, win_dur, win_len, hop_ratio, nbins_ratio] = get_win_params(win_list{win});
[
win_type
,
win_dur
,
win_len
,
hop_ratio
,
nbins_ratio
]
=
get_win_params
(
win_list
{
win
});
win_len
=
wins_params
.
(
keys
{
win_param
})
.
win_len
;
win_type
=
wins_params
.
(
keys
{
win_param
})
.
win_type
;
win_dur
=
wins_params
.
(
keys
{
win_param
})
.
win_dur
;
hop_ratio
=
wins_params
.
(
keys
{
win_param
})
.
hop_ratio
;
nbins_ratio
=
wins_params
.
(
keys
{
win_param
})
.
nbins_ratio
;
params
=
get_params
(
win_len
,
win_type
);
fprintf
(
"window %s:\n\n"
,
win_type
);
fprintf
(
"window: %s - length: %.f\n"
,
win_type
,
win_len
);
% DGT parameters
dgt_params
=
generate_dgt_parameters
(
win_type
,
win_len
,
params
.
hop
,
...
,
params
.
nbins
,
sig_len
);
%DGT operators
[
dgt
,
idgt
]
=
get_stft_operators
(
dgt_params
,
signal_params
);
fprintf
(
"window: %s - length: %.f\n"
,
win_type
,
win_len
);
fprintf
(
"window: %s - length: %.f\n"
,
win_type
,
win_len
);
for
wb
=
1
:
1
%length(wb_list)
wideband_src
=
wb_list
{
wb
};
for
wb
=
1
:
length
(
wideband_name
)
wideband_src
=
wideband_name
{
wb
};
fprintf
(
"**************************************\n\n"
)
fprintf
(
"**************************************\n\n"
)
fprintf
(
"This is the %.f ieme run. wideband source is:%s \n"
,
wb
,
wb_list
{
wb
}
);
fprintf
(
"This is the %.f ieme run. wideband source is:%s \n"
,
wb
,
wideband_src
);
fprintf
(
"**************************************\n\n"
)
fprintf
(
"**************************************\n\n"
)
for
loc
=
1
:
1
%length(loc_list)
for
loc
=
1
:
length
(
localized_name
)
loc_source
=
localized_name
{
loc
};
pwd
;
fprintf
(
"loalized source number %.f : %s \n"
,
loc
,
loc_source
)
;
fig_dir
=
[
'fig_Paeras_'
,
wb_list
{
wb
},
'_'
,
loc_list
{
loc
},
'_'
,
win_type
,
'_'
,
num2str
(
win_len
)];
fprintf
(
"**************************************\n\n"
)
%%
fig_dir
=
[
'fig_'
,
wideband_src
,
'_'
,
loc_source
,
'_'
,
win_type
,
'_'
,
num2str
(
win_len
)];
if
~
exist
(
fig_dir
,
'dir'
)
if
~
exist
(
fig_dir
,
'dir'
)
mkdir
(
fig_dir
);
mkdir
(
fig_dir
);
end
end
addpath
(
fig_dir
)
addpath
(
fig_dir
)
%%
%%
fprintf
(
"loalized source number %.f : %s \n"
,
loc
,
loc_list
{
loc
})
;
fprintf
(
"**************************************\n\n"
)
loc_source
=
loc_list
{
loc
};
%%
[
alpha
,
thres
,
radius
]
=
set_smooth_mask_params
(
wideband_src
,
loc_source
,
win_type
);
[
alpha
,
seuil
,
radius
]
=
set_smooth_mask_params
(
wideband_src
,
loc_source
,
win_type
);
[
signals
,
dgt_params
,
signal_params
,
mask
,
mask_area
,
dgt
,
...
,
[
signals
,
dgt_params
,
signal_params
,
mask
,
mask_area
,
dgt
,
...
,
idgt
]
=
get_mix
(
loc_source
,
wideband_src
,
gamma
,
win_dur
,
hop_ratio
,
...
,
idgt
]
=
get_mix
(
loc_source
,
wideband_src
,
gamma
,
win_dur
,
hop_ratio
,
...
,
nbins_ratio
,
win_type
,
alpha
,
seuil
,
radius
,
fig_dir
);
nbins_ratio
,
win_type
,
alpha
,
thres
,
radius
,
fig_dir
);
fprintf
(
'win_len:%.f\n'
,
length
(
dgt_params
.
win
));
fprintf
(
'win_len:%.f\n'
,
length
(
dgt_params
.
win
));
fprintf
(
'hop:%.f\n'
,
dgt_params
.
hop
);
fprintf
(
'hop:%.f\n'
,
dgt_params
.
hop
);
fprintf
(
'n_bins:%.f\n'
,
dgt_params
.
nbins
);
fprintf
(
'n_bins:%.f\n'
,
dgt_params
.
nbins
);
%% create subregions
%% create subregions
mask_bool
=
mask
;
mask_bool
=
mask
;
[
mask_labeled
,
n_areas
,
t_subregions
]
=
get_nareas
(
mask_bool
,
dgt
,
idgt
,
dgt_params
,
...
,
[
mask_labeled
,
n_areas
,
t_subregions
]
=
get_nareas
(
mask_bool
,
dgt
,
idgt
,
dgt_params
,
...
,
signal_params
,
fig_dir
,
tol_subregions
);
signal_params
,
fig_dir
,
tol_subregions
);
%% EVD via Halko
%%
[
gabmul_list
,
mask_list
]
=
get_P_gabmul
(
mask_labeled
,
dgt
,
idgt
);
[
gabmul_list
,
mask_list
]
=
get_P_gabmul
(
mask_labeled
,
dgt
,
idgt
);
x_mix
=
signals
.
mix
;
x_mix
=
signals
.
mix
;
...
@@ -80,16 +113,15 @@ for win =1:length(win_list)
...
@@ -80,16 +113,15 @@ for win =1:length(win_list)
ut_x_list
,
r
]
=
compute_decomposition
(
x_mix
,
mask_list
,
gabmul_list
,
...
,
ut_x_list
,
r
]
=
compute_decomposition
(
x_mix
,
mask_list
,
gabmul_list
,
...
,
tolerance_arrf
,
proba_arrf
);
tolerance_arrf
,
proba_arrf
);
%% mask
[
mask_area
,
mask_area_ratio
]
=
get_mask_area
(
mask
);
%% plot mask
figure
(
'name'
,
'mask'
);
figure
(
'name'
,
'mask'
);
plot_
spectrogram
(
mask
,
dgt_params
,
signal_params
,
dgt
);
plot_
mask
(
mask
,
dgt_params
.
hop
,
dgt_params
.
nbins
,
signal_params
.
fs
);
title
([
'mask : mask-area = '
,
num2str
(
mask_area
)]);
title
([
'mask : mask-area = '
,
num2str
(
mask_area
)]);
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
'mask.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'mask.pdf'
));
%% Plot eigenvalues
%% Plot eigenvalues
figure
;
figure
;
...
@@ -108,19 +140,15 @@ for win =1:length(win_list)
...
@@ -108,19 +140,15 @@ for win =1:length(win_list)
set
(
gca
,
'FontSize'
,
25
,
'fontName'
,
'Times'
);
set
(
gca
,
'FontSize'
,
25
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
'gabmul_eigenvalues.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'gabmul_eigenvalues.pdf'
));
%% find optimal lambda (best SDR)
%% Find optimal lambda (best SDR)
x_wideband
=
signals
.
wideband
;
x_wideband
=
signals
.
wideband
;
x_rec
=
@
(
lambda_coef
)
compute_estimate
(
lambda_coef
,
x_mix
,
s_vec_list
,
...
,
x_rec
=
@
(
lambda_coef
)
compute_estimate
(
lambda_coef
,
x_mix
,
s_vec_list
,
...
,
u_mat_list
,
ut_x_list
);
u_mat_list
,
ut_x_list
);
[
lambda_oracle
,
t_oracle
]
=
compute_lambda_oracle_sdr
(
n_areas
,
x_wideband
,
x_rec
);
[
lambda_oracle
,
t_oracle
]
=
compute_lambda_oracle_sdr
(
n_areas
,
x_wideband
,
x_rec
);
disp
(
"Running time to tune lambda (oracle): %f \n"
)
disp
(
t_oracle
);
fprintf
(
"Running time to tune lambda (oracle): %f \n"
,
t_oracle
);
%% Estimate energy and lambda
%% Estimate energy and lambda
...
@@ -133,143 +161,108 @@ for win =1:length(win_list)
...
@@ -133,143 +161,108 @@ for win =1:length(win_list)
disp
(
t_lambda_est
);
disp
(
t_lambda_est
);
%% Estimate lambda from true energy
e_wideband_true_energy
=
zeros
(
n_areas
,
1
);
x_wideband_tf_mat
=
dgt
(
gabmul_list
{
1
}(
signals
.
wideband
));
for
k_area
=
1
:
n_areas
mask_k
=
(
mask_labeled
==
k_area
);
x_wideband_tf_masked
=
mask_k
.*
x_wideband_tf_mat
;
e_wideband_true_energy
(
k_area
)
=
norm
(
x_wideband_tf_masked
,
'fro'
)
.^
2
;
end
e_wideband
=
e_wideband_true_energy
;
[
lambda_true_energy
,
t_true_energy
]
=
compute_lambda
(
x_mix
,
mask
,
dgt_params
,
...
,
signal_params
,
dgt
,
s_vec_list
,
u_mat_list
,
ut_x_list
,
...
,
gabmul_list
,
fig_dir
,
e_wideband
);
fprintf
(
"Running time to tune lambda (True):\n"
)
disp
(
t_true_energy
);
%% Results
%% Results
x_wideband
=
signals
.
wideband
;
x_wideband
=
signals
.
wideband
;
sdr_wideband
=
@
(
lambda_coef
)
sdr
(
x_wideband
,
x_rec
(
lambda_coef
));
sdr_wideband
=
@
(
lambda_coef
)
sdr
(
x_wideband
,
x_rec
(
lambda_coef
));
sdr_wideband_1area
=
@
(
lambda_coef
,
k_area
)
sdr_
engine_1area
(
lambda_coef
,
k_area
,
x_rec
,
x_wideband
,
n_areas
);
sdr_wideband_1area
=
@
(
lambda_coef
,
k_area
)
sdr_
1region
(
lambda_coef
,
k_area
,
x_rec
,
x_wideband
,
n_areas
);
is_wideband
=
@
(
lambda_coef
)
itakura_saito_dist_spectrum
(
x_wideband
,
x_rec
(
lambda_coef
));
is_wideband
=
@
(
lambda_coef
)
itakura_saito_dist_spectrum
(
x_wideband
,
x_rec
(
lambda_coef
));
is_wideband_1area
=
@
(
lambda_coef
,
k_area
)
is_spectrum_engine_1aera
(
x_wideband
,
k_area
,
lambda_coef
,
n_areas
,
x_rec
);
is_wideband_1area
=
@
(
lambda_coef
,
k_area
)
is_spectrum_1region
(
x_wideband
,
k_area
,
lambda_coef
,
n_areas
,
x_rec
);
%%
sdr wideband
%%
SDR for each area
l_range
=
10.
^
linspace
(
-
10
,
10
,
100
);
l_range
=
10.
^
linspace
(
-
10
,
10
,
100
);
sdr_engine1area_l
=
zeros
(
length
(
l_range
),
1
);
sdr_engine1area_l
=
zeros
(
length
(
l_range
),
1
);
figure
;
for
k_area
=
1
:
n_areas
for
k_area
=
1
:
n_areas
figure
;
for
k
=
1
:
length
(
l_range
)
for
k
=
1
:
length
(
l_range
)
sdr_engine1area_l
(
k
)
=
sdr_wideband_1area
(
l_range
(
k
),
k_area
);
sdr_engine1area_l
(
k
)
=
sdr_wideband_1area
(
l_range
(
k
),
k_area
);
end
end
txt
=
[
'SDR
sub-reg ='
num2str
(
k_area
)]
;
txt
=
'SDR
'
;
plot
(
l_range
,
sdr_engine1area_l
,
'DisplayName'
,
txt
)
plot
(
l_range
,
sdr_engine1area_l
,
'
LineWidth'
,
3
,
'
DisplayName'
,
txt
)
end
hold
on
;
hold
on
;
for
k_area
=
1
:
n_areas
txt1
=
[
'TFF-O '
,
num2str
(
k_area
)]
;
txt1
=
'TFF-O '
;
plot
(
lambda_oracle
(
k_area
),
sdr_wideband_1area
(
lambda_oracle
(
k_area
),
k_area
),
...
,
plot
(
lambda_oracle
(
k_area
),
sdr_wideband_1area
(
lambda_oracle
(
k_area
),
k_area
),
...
,
'*'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt1
);
'*'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt1
);
txt2
=
[
'TFF-P'
,
num2str
(
k_area
)]
;
txt2
=
'TFF-P'
;
plot
(
lambda_est
(
k_area
),
sdr_wideband_1area
(
lambda_est
(
k_area
),
k_area
),
...
,
plot
(
lambda_est
(
k_area
),
sdr_wideband_1area
(
lambda_est
(
k_area
),
k_area
),
...
,
'o'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt2
);
'o'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt2
);
txt3
=
[
'TFF-E'
,
num2str
(
k_area
)];
txt3
=
'Zero fill'
;
plot
(
lambda_true_energy
(
k_area
),
sdr_wideband_1area
(
lambda_true_energy
(
k_area
),
k_area
),
...
,
plot
(
1
,
sdr_wideband_1area
(
1
,
k_area
),
'o'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt3
);
'o'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt3
);
txt4
=
[
'Zero fill'
,
num2str
(
k_area
)];
plot
(
1
,
sdr_wideband_1area
(
1
,
k_area
),
'o'
,
'LineWidth'
,
3
,
'DisplayName'
,
txt4
);
end
legend
show
;
legend
show
;
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
ylabel
(
'SDR(dB)'
)
ylabel
(
'SDR(dB)'
)
title
([
'SDR sub-region:'
num2str
(
k_area
)])
set
(
gca
,
'XScale'
,
'log'
);
set
(
gca
,
'XScale'
,
'log'
);
grid
on
;
grid
on
;
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
'tuning_lambda.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
[
'tuning_lambda
_area_'
,
num2str
(
k_area
),
'
.pdf'
]
));
end
%% Itakura saito for each aera
%% Itakura saito
is_engine1area_l
=
zeros
(
length
(
l_range
),
1
);
is_engine1area_l
=
zeros
(
length
(
l_range
),
1
);
figure
;
for
k_area
=
1
:
n_areas
for
k_area
=
1
:
n_areas
figure
;
for
k
=
1
:
length
(
l_range
)
for
k
=
1
:
length
(
l_range
)
is_engine1area_l
(
k
)
=
is_wideband_1area
(
l_range
(
k
),
k_area
);
is_engine1area_l
(
k
)
=
is_wideband_1area
(
l_range
(
k
),
k_area
);
end
end
txt
=
[
'SDR sub-reg ='
num2str
(
k_area
)]
;
txt
=
'IS'
;
plot
(
l_range
,
is_engine1area_l
,
'LineWidth'
,
3
,
'DisplayName'
,
txt
)
plot
(
l_range
,
is_engine1area_l
,
'LineWidth'
,
3
,
'DisplayName'
,
txt
)
end
hold
on
;
hold
on
;
for
k_area
=
1
:
n_areas
plot
(
lambda_oracle
(
k_area
),
is_wideband_1area
(
lambda_oracle
(
k_area
),
k_area
),
'o'
,
'LineWidth'
,
3
)
plot
(
lambda_oracle
(
k_area
),
is_wideband_1area
(
lambda_oracle
(
k_area
),
k_area
),
'o'
,
'LineWidth'
,
3
)
plot
(
lambda_est
(
k_area
),
is_wideband_1area
(
lambda_est
(
k_area
),
k_area
),
'o'
)
plot
(
lambda_est
(
k_area
),
is_wideband_1area
(
lambda_est
(
k_area
),
k_area
),
'o'
)
plot
(
lambda_true_energy
(
k_area
),
is_wideband_1area
(
lambda_true_energy
(
k_area
),
k_area
),
'o'
,
'LineWidth'
,
3
)
plot
(
1
,
is_wideband_1area
(
1
,
k_area
),
'o'
,
'LineWidth'
,
3
)
plot
(
1
,
is_wideband_1area
(
1
,
k_area
),
'o'
,
'LineWidth'
,
3
)
end
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
ylabel
(
'IS (dB)'
)
ylabel
(
'IS (dB)'
)
set
(
gca
,
'XScale'
,
'log'
);
set
(
gca
,
'XScale'
,
'log'
);
title
([
'IS sub-region:'
num2str
(
k_area
)])
grid
()
grid
()
legend
(
'IS'
,
'TFF-O'
,
'TFF-P'
,
'TFF-E'
,
'Zero fill'
)
legend
(
'IS'
,
'TFF-O'
,
'TFF-P'
,
'Zero fill'
)
axis
tight
;
saveas
(
gcf
,
fullfile
(
fig_dir
,
'tuning_lambda_IS.pdf'
));
%% Itakura saito for each aera
figure
;
yyaxis
left
;
plot
(
l_range
,
sdr_engine1area_l
,
'-'
,
'LineWidth'
,
3
);
hold
on
;
grid
on
;
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
ylabel
(
'SDR (dB)'
)
set
(
gca
,
'XScale'
,
'log'
);
yyaxis
right
;
plot
(
l_range
,
is_engine1area_l
,
'-'
,
'LineWidth'
,
3
);
hold
on
;
axis
tight
;
axis
tight
;
legend
(
'SDR TFF-P'
,
'IS TFF-P'
,
'Location'
,
'northwest'
);
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
ylabel
(
'IS divergence'
)
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
[
'tuning_IS_'
,
num2str
(
k_area
),
'.pdf'
]));
end
%% plot both sdr and itakura saito in the same axis
saveas
(
gcf
,
fullfile
(
fig_dir
,
'tuning_lambda_SDR_IS.pdf'
));
sdr_engine1area_l
=
zeros
(
length
(
l_range
),
1
);
%%
is_engine1area_l
=
zeros
(
length
(
l_range
),
1
);
for
k_area
=
1
:
n_areas
figure
;
figure
;
for
k
=
1
:
length
(
l_range
)
sdr_engine1area_l
(
k
)
=
sdr_wideband_1area
(
l_range
(
k
),
k_area
);
is_engine1area_l
(
k
)
=
is_wideband_1area
(
l_range
(
k
),
k_area
);
end
txt
=
[
'SDR sub-reg ='
num2str
(
k_area
)];
yyaxis
left
;
yyaxis
left
;
plot
(
l_range
,
sdr_engine1area_l
,
'-'
,
'LineWidth'
,
3
);
hold
on
;
plot
(
l_range
,
sdr_engine1area_l
,
'-'
,
'LineWidth'
,
3
);
hold
on
;
plot
(
lambda_oracle
(
k_area
),
sdr_wideband_1area
(
lambda_oracle
(
k_area
),
k_area
),
...
,
'o'
,
'LineWidth'
,
3
)
plot
(
lambda_est
(
k_area
),
sdr_wideband_1area
(
lambda_est
(
k_area
),
k_area
),
...
,
'bo'
,
'LineWidth'
,
3
)
plot
(
1
,
sdr_wideband_1area
(
1
,
k_area
),
'mo'
,
'LineWidth'
,
3
);
grid
on
;
grid
on
;
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
ylabel
(
'SDR (dB)'
)
ylabel
(
'SDR (dB)'
)
...
@@ -279,21 +272,24 @@ for win =1:length(win_list)
...
@@ -279,21 +272,24 @@ for win =1:length(win_list)
yyaxis
right
;
yyaxis
right
;
plot
(
l_range
,
is_engine1area_l
,
'-'
,
'LineWidth'
,
3
);
hold
on
;
plot
(
l_range
,
is_engine1area_l
,
'-'
,
'LineWidth'
,
3
);
hold
on
;
plot
(
lambda_oracle
(
k_area
),
is_wideband_1area
(
lambda_oracle
(
k_area
),
k_area
),
...
,
'o'
,
'LineWidth'
,
3
)
plot
(
lambda_est
(
k_area
),
is_wideband_1area
(
lambda_est
(
k_area
),
k_area
),
'bo'
,
...
,
'LineWidth'
,
3
)
plot
(
1
,
is_wideband_1area
(
1
,
k_area
),
'mo'
,
'LineWidth'
,
3
)
axis
tight
;
legend
(
'SDR'
,
'TFF-O'
,
'TFF-P'
,
'Zero fill'
,
'Location'
,
'northwest'
);
legend
(
'SDR TFF-P'
,
'IS TFF-P'
,
'Location'
,
'northwest'
);
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
xlabel
(
'$\lambda$'
,
'Interpreter'
,
'latex'
)
ylabel
(
'IS divergence'
)
ylabel
(
'IS divergence'
)
title
([
'SDR-IS sub-reg:'
num2str
(
k_area
)])
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
'tuning_lambda_SDR_IS.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
[
'tuning_lambda_SDR_IS'
,
num2str
(
k_area
),
'.pdf'
]));
end
%% Reconstructed signals
%% Reconstructed signals
tf_mat_mix
=
compute_dgt
(
signals
.
mix
,
dgt
);
x_oracle
=
x_rec
(
lambda_oracle
);
x_oracle
=
x_rec
(
lambda_oracle
);
wav_write
(
'x_oracle.wav'
,
x_oracle
,
signal_params
.
fs
);
wav_write
(
'x_oracle.wav'
,
x_oracle
,
signal_params
.
fs
);
...
@@ -305,18 +301,17 @@ for win =1:length(win_list)
...
@@ -305,18 +301,17 @@ for win =1:length(win_list)
wav_write
(
'x_true_energy.wav'
,
x_true_energy
,
signal_params
.
fs
);
wav_write
(
'x_true_energy.wav'
,
x_true_energy
,
signal_params
.
fs
);
x_zero
=
solver_tfgm_zero
(
tf_mat_mix
,
mask
,
idgt
);
x_zero
=
zero_fill_solver
(
x_mix
,
mask
,
dgt
,
idgt
,
dgt_params
,
...
,
signal_params
,
fig_dir
);
wav_write
(
'x_zero_fill.wav'
,
x_zero
,
signal_params
.
fs
);
wav_write
(
'x_zero_fill.wav'
,
x_zero
,
signal_params
.
fs
);
x_interp
=
solver_tfgm_interp
(
tf_mat_mix
,
mask
,
idgt
);
x_interp
=
interpolation_solver
(
x_mix
,
mask
,
dgt
,
idgt
,
dgt_params
,
...
,
signal_params
,
fig_dir
);
wav_write
(
'x_interp.wav'
,
x_zero
,
signal_params
.
fs
);
wav_write
(
'x_interp.wav'
,
x_zero
,
signal_params
.
fs
);
%% Sdr
%% Sdr
sdr_oracle
=
sdr
(
x_wideband
,
x_oracle
);
sdr_oracle
=
sdr
(
x_wideband
,
x_oracle
);
sdr_est
=
sdr
(
x_wideband
,
x_est
);
sdr_est
=
sdr
(
x_wideband
,
x_est
);
sdr_true_energy
=
sdr
(
x_wideband
,
x_true_energy
);
sdr_true_energy
=
sdr
(
x_wideband
,
x_true_energy
);
...
@@ -335,7 +330,6 @@ for win =1:length(win_list)
...
@@ -335,7 +330,6 @@ for win =1:length(win_list)
%%
%%
fprintf
(
'Oracle lambda: %f\n'
,
lambda_oracle
);
fprintf
(
'Oracle lambda: %f\n'
,
lambda_oracle
);
fprintf
(
'SDR for oracle lambda: %f dB\n'
,
sdr_oracle
);
fprintf
(
'SDR for oracle lambda: %f dB\n'
,
sdr_oracle
);
...
@@ -351,7 +345,6 @@ for win =1:length(win_list)
...
@@ -351,7 +345,6 @@ for win =1:length(win_list)
fprintf
(
'Mix SDR: %f dB \n'
,
sdr_mix
);
fprintf
(
'Mix SDR: %f dB \n'
,
sdr_mix
);
fprintf
(
'Interp + random phases filling SDR: %e dB\n'
,
sdr_interp
);
fprintf
(
'Interp + random phases filling SDR: %e dB\n'
,
sdr_interp
);
%%
%%
figure
;
figure
;
...
@@ -384,10 +377,6 @@ for win =1:length(win_list)
...
@@ -384,10 +377,6 @@ for win =1:length(win_list)
axis
tight
;
axis
tight
;
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_TFF-O.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_TFF-O.pdf'
));
%%
figure
;
figure
;
plot_spectrogram
(
x_est
,
dgt_params
,
signal_params
,
dgt
)
plot_spectrogram
(
x_est
,
dgt_params
,
signal_params
,
dgt
)
title
([
'TFF-P - SDR= '
,
num2str
(
sdr_est
,
4
),
'dB '
,
'IS='
,
num2str
(
is_est
)])
title
([
'TFF-P - SDR= '
,
num2str
(
sdr_est
,
4
),
'dB '
,
'IS='
,
num2str
(
is_est
)])
...
@@ -395,32 +384,22 @@ for win =1:length(win_list)
...
@@ -395,32 +384,22 @@ for win =1:length(win_list)
axis
tight
;
axis
tight
;
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_TFF-P.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_TFF-P.pdf'
));
%%
figure
;
plot_spectrogram
(
x_true_energy
,
dgt_params
,
signal_params
,
dgt
)
title
([
'TFF-E SDR= '
,
num2str
(
sdr_true_energy
,
4
),
'dB '
,
'IS='
,
num2str
(
is_true_energy
)
])
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_TFF-E.pdf'
));
%%
figure
;
figure
;
plot_spectrogram
(
x_interp
,
dgt_params
,
signal_params
,
dgt
)
plot_spectrogram
(
x_interp
,
dgt_params
,
signal_params
,
dgt
)
title
([
'Interp SDR= '
,
num2str
(
sdr_interp
,
4
),
'dB '
,
'IS='
,
num2str
(
is_interp
)])
title
([
'Interp SDR= '
,
num2str
(
sdr_interp
,
4
),
'dB '
,
'IS='
,
num2str
(
is_interp
)])
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
set
(
gca
,
'FontSize'
,
20
,
'fontName'
,
'Times'
);
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_interp.pdf'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'spectrogram_interp.pdf'
));
%% save in csv
%% save in csv
fprintf
(
f
,
'%s %s %s %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f
%.3f
\n'
,
...
,
fprintf
(
f
,
'%s %s %s %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f \n'
,
...
,
wb_list
{
wb
},
loc_list
{
loc
},
win_list
{
win
},
win_len
,
t_oracle
,
t_true_energy
,
...
,
wideband_src
,
loc_source
,
win_type
,
win_len
,
t_oracle
,
...
,
t_est
,
t_arrf
,
t_evdn
,
t_ut_x
,
sdr_mix
,
sdr_interp
,
...
,
t_est
,
t_arrf
,
t_evdn
,
t_ut_x
,
sdr_mix
,
sdr_interp
,
...
,
sdr_zero
,
sdr_est
,
sdr_oracle
,
is_interp
,
is_mix
,
is_est
,
is_zero
,
is_oracle
);
sdr_zero
,
sdr_est
,
sdr_oracle
,
is_interp
,
is_mix
,
is_est
,
is_zero
,
is_oracle
);
end
end
end
end
end
end
This diff is collapsed.
Click to expand it.
matlab/tfgm/scripts/exp_gabmul_eigs_properties.m
+
5
−
0
View file @
cbc60b86
...
@@ -143,7 +143,12 @@ l = legend('Gauss','Hann',...,
...
@@ -143,7 +143,12 @@ l = legend('Gauss','Hann',...,
set
(
l
,
'interpreter'
,
'latex'
)
set
(
l
,
'interpreter'
,
'latex'
)
saveas
(
gcf
,
fullfile
(
fig_dir
,
'eigenvalues_gauss_hann.fig'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'eigenvalues_gauss_hann.fig'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'eigenvalues_gauss_hann.png'
));
saveas
(
gcf
,
fullfile
(
fig_dir
,
'eigenvalues_gauss_hann.png'
));
%% eigenvectors
%% eigenvectors
eigs_gauss
=
evdn_gauss
.
Gauss256
.
U
;
figure
;
figure
;
set
(
gcf
,
'position'
,[
1
,
1
1000
800
]);
set
(
gcf
,
'position'
,[
1
,
1
1000
800
]);
subplot
(
221
);
subplot
(
221
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment