diff --git a/matlab/tfgm/experiments/compute_error_operator_norm.m b/matlab/tfgm/experiments/compute_error_operator_norm.m deleted file mode 100644 index 38fa51266f2102b46a0cc0295d5efd2e829591f9..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/compute_error_operator_norm.m +++ /dev/null @@ -1,25 +0,0 @@ -function [eigs_norm, arrfevdn_norm, rrfevdn_norm]= compute_error_operator_norm(file_name, n_exp) - -eigs_norm = zeros(length(file_name), n_exp); -arrfevdn_norm = zeros(length(file_name), n_exp); -rrfevdn_norm = zeros(length(file_name), n_exp); - -for k=1:n_exp - - rep_dir = ['exp',num2str(k)]; - - for l =1: 3%length(file_name) - data_folder = dir(fullfile(rep_dir,'*.mat')); - file = [data_folder(l).folder,filesep, file_name{l}]; - - upload_file = load(file); - eigs_norm(l,k) = error_operator_norm(upload_file.mul, upload_file.svd_result_eigs); - arrfevdn_norm(l,k) = error_operator_norm(upload_file.mul, upload_file.svd_result_nystrom_Qadaptative); - rrfevdn_norm(l,k) = error_operator_norm(upload_file.mul, upload_file.svd_result_nystrom); - - end -end - - - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/estimated_rank.m b/matlab/tfgm/experiments/estimated_rank.m deleted file mode 100644 index c383ae00b2321ff06089ab402ed8e24734f56258..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/estimated_rank.m +++ /dev/null @@ -1,20 +0,0 @@ -function q_with = estimated_rank(file_name, n_exp) - - -q_with = zeros(length(file_name), n_exp); - - -for k=1:n_exp - rep_dir = ['exp',num2str(k)]; - - for l =1:length(file_name) - data_folder = dir(fullfile(rep_dir,'*.mat')); - file = [data_folder(l).folder,filesep, file_name{l}]; - upload_file = load(file); - q_with(l,k) = size(upload_file.svd_result_eigs.D,1); - - - end -end - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/exp_gabmul_eig_running_times.m b/matlab/tfgm/experiments/exp_gabmul_eig_running_times.m deleted file mode 100644 index 2d6ae083f7b82380e7ce69390b2304077ab23d9d..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/exp_gabmul_eig_running_times.m +++ /dev/null @@ -1,72 +0,0 @@ -clc; clear; close all; - - -%% -setting='full'; -exp = get_experiment(setting); - -%% -param = exp.data_params; -t_lim = [exp.problem_params.t_val{1}, exp.problem_params.t_val{2}]; -f_lim = [exp.problem_params.f_val{1}, exp.problem_params.f_val{2}]; -win_type = exp.problem_params.win_type; - -t_arrf = zeros(length(param) ,1); -t_rrf = zeros(length(param) ,1); -t_arrfevdn = zeros(length(param) ,1); -t_rrfevdn = zeros(length(param) ,1); -t_eigs = zeros(length(param) ,1); -%% - -n_runs = 1;%0; - -fprintf('je ferai au total %.1f runs\n\n',n_runs); -%% -for l=1:n_runs - -fprintf("C'est partie pour le %.1f run\n\n",l); - -%% -tic; -for k = 1:1%length(param) - k=5; - - fprintf('je suis a la %.1f ieme iteration patiente\n',k); - param_pow = param{k}; - problem_data = get_problem_data(param_pow,t_lim, f_lim, win_type); - - - -tolerance = exp.solver_params.tolerance; -r = exp.solver_params.r; -mask = problem_data.mask; -dgt_params = problem_data.dgt_params; -signal_params = problem_data.signal_params; - -[gab_mul, direct_stft, adjoint_stft, q_mat_arrf, arrf_time,...., - q_mat_rrf, rrf_time, svd_res_arrf,arrfevdn_time, svd_res_rrf,...., - rrfevdn_time, svd_res_eigs, eigs_time, eigs_norm, arrfevdn_norm, ..., - rrfevdn_norm,q_with] =solver(tolerance, r, mask, dgt_params, signal_params); - - -t_arrf(k) = arrf_time; -t_rrf(k) = rrf_time; -t_arrfevdn(k) = arrfevdn_time; -t_rrfevdn(k) = rrfevdn_time; -t_eigs(k) = eigs_time; - -filename = ['gabmul_eig_dgtvar_', num2str(signal_params.sig_len),'.mat']; - -mkdir(['exp_gabmul_eig_running_times_',num2str(l)]); -warning('off', 'MATLAB:MKDIR:DirectoryExists'); -path_name = ['exp_gabmul_eig_running_times_',num2str(l)]; - -save(fullfile(path_name,filename),'setting','exp','problem_data', 'q_mat_arrf',...., - 'arrf_time', 'q_mat_rrf', 'rrf_time', 'svd_res_arrf','arrfevdn_time',..., - 'svd_res_rrf', 'rrfevdn_time', 'svd_res_eigs', 'eigs_time',..., - 'eigs_norm','arrfevdn_norm','rrfevdn_norm','q_with','t_arrf','t_rrf','t_arrfevdn',..., - 't_rrfevdn','t_eigs'); -end -toc; -end -%% \ No newline at end of file diff --git a/matlab/tfgm/experiments/get_experiment.m b/matlab/tfgm/experiments/get_experiment.m deleted file mode 100644 index dbee5307abd08de5d962be005efd7860697b9b13..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/get_experiment.m +++ /dev/null @@ -1,42 +0,0 @@ -function exp = get_experiment(setting) -%create experiment parameter - - -switch setting - case 'full' - - param_pow = {0, 1, 2, 3, 4}; - data_params = param_pow; - - case 'light' - - param_pow = {0,1,2}; - data_params = param_pow; - otherwise - - error('Unknown setting: ') - -end - -t_min = 0.3; t_max = 0.5; f_min = 0.1; f_max =0.2; -t_val = {t_min, t_max}; -f_val={f_min, f_max}; - -problem_params.win_type = 'hann'; - -problem_params.t_val = t_val; -problem_params.f_val = f_val; - -tolerance = 1e-6; -r = 15; - -solver_params.tolerance = tolerance; -solver_params.r = r; - - -exp.data_params=data_params; -exp.problem_params=problem_params; -exp.solver_params=solver_params; -end - - diff --git a/matlab/tfgm/experiments/get_mask_area.m b/matlab/tfgm/experiments/get_mask_area.m deleted file mode 100644 index f3701b9c08aafee0eb2eb566a6a43c144cd97d7e..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/get_mask_area.m +++ /dev/null @@ -1,10 +0,0 @@ -function [mask_area, varargout] = get_mask_area(mask) -%compute mask area - -mask_area = sum(mask(:)); -mask_area_ratio = mask_area/ (size(mask,1)*size(mask,2)); - varargout{1} = mask_area_ratio; - -end - - diff --git a/matlab/tfgm/experiments/get_problem_data.m b/matlab/tfgm/experiments/get_problem_data.m deleted file mode 100644 index a3619c341f8c7b38f889a6c2b51e48e79fd8917d..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/get_problem_data.m +++ /dev/null @@ -1,23 +0,0 @@ -function problem_data = get_problem_data(param_pow,t_lim, f_lim, win_type) - -% generate problem data for tf filtering - - -sig_len = 256*4^param_pow; -win_len = 8*2^param_pow; -hop = 2*2^param_pow; -nbins = 32*2^param_pow; -fs=1; - -approx_win_len = win_len; - -dgt_params = generate_dgt_parameters(win_type, approx_win_len, hop, nbins, sig_len); -signal_params = generate_signal_parameters(fs, sig_len); -mask = generate_rectangular_mask(nbins, hop, sig_len, t_lim, f_lim); - -problem_data.dgt_params= dgt_params; -problem_data.signal_params = signal_params; -problem_data.hop = hop; -problem_data.mask = mask; - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/get_ratio_of_eigs_running_times.m b/matlab/tfgm/experiments/get_ratio_of_eigs_running_times.m deleted file mode 100644 index 083dd632565c4cb4caec91dc88b0fc5eccc51c34..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/get_ratio_of_eigs_running_times.m +++ /dev/null @@ -1,16 +0,0 @@ -function [ratio_arrf_time_over_eigs,ratio_rrf_time_over_eigs,..., - ratio_evdnarrf_over_eigs,ratio_evdnrrf_over_eigs]= get_ratio_of_eigs_running_times(arrf_time, rrf_time, evdnarrf_time, evdnrrf_time,eigs_time) - - - - - -ratio_arrf_time_over_eigs = arrf_time./eigs_time; -ratio_rrf_time_over_eigs = rrf_time./eigs_time; -ratio_evdnarrf_over_eigs = evdnarrf_time./eigs_time; -ratio_evdnrrf_over_eigs = evdnrrf_time./eigs_time ; - - - - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/perf_measures.m b/matlab/tfgm/experiments/perf_measures.m deleted file mode 100644 index eddb65ba7f3a70fec4beb1d4780542a517a69020..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/perf_measures.m +++ /dev/null @@ -1,65 +0,0 @@ -function [arrf_time, rrf_time, eigs_time, evdnrrf_time, evdnarrf_time,..., - arrf_time_mean, rrf_time_mean, evdnrrf_time_mean, evdnarrf_time_mean,..., - evdarrrf_mean, evdrrf_mean,eigs_mean, arrf_time_std, rrf_time_std,..., - evdnrrf_time_std, evdnarrf_time_std, evdarrrf_std, ...., - evdrrf_std, eigs_std] = perf_measures(file_name, n_exp) - - - -arrf_time=[]; -rrf_time = []; -eigs_time = []; -evdnrrf_time = []; -evdnarrf_time = []; - - -for k=1:n_exp - -upload_file = load(fullfile((['exp',num2str(k)]),file_name{5})); - -arrf_time = [arrf_time, upload_file.time_adaptative_Q]; -arrf_time = squeeze(arrf_time); - - -rrf_time = [rrf_time, upload_file.time_randomized_Q]; -rrf_time = squeeze(rrf_time); - -eigs_time = [eigs_time, upload_file.time_EVD_eigs]; -eigs_time = squeeze(eigs_time); - -evdnrrf_time = [evdnrrf_time, upload_file.time_EVD_nystrom]; -evdnrrf_time = squeeze(evdnrrf_time); - -evdnarrf_time = [evdnarrf_time, upload_file.time_EVD_nystrom_Qadapt]; -evdnarrf_time = squeeze(evdnarrf_time); - - -end - -% mean - -arrf_time_mean = mean(arrf_time,2); % temps moyen adaptative randomized range finder -rrf_time_mean = mean(rrf_time,2); % temps moyen randomized range finder -evdnrrf_time_mean = mean(evdnrrf_time,2); -evdnarrf_time_mean = mean(evdnarrf_time,2); - -evdarrrf_mean = mean(arrf_time+ evdnarrf_time,2); % arrf + evd/nystrom -evdrrf_mean = mean(rrf_time+ evdnrrf_time,2); % rrf +evd/nystom -eigs_mean = mean(eigs_time,2); % temps moyen eigs - -%std - - -arrf_time_std = std(arrf_time, 0,2); % temps moyen adaptative randomized range finder -rrf_time_std = std(rrf_time, 0, 2); % temps moyen randomized range finder -evdnrrf_time_std = std(evdnrrf_time,0, 2); -evdnarrf_time_std = std(evdnarrf_time, 0, 2); - -evdarrrf_std = std(arrf_time+ evdnarrf_time, 0,2); % arrf + evd/nystrom -evdrrf_std = std(rrf_time+ evdnrrf_time, 0, 2); % rrf +evd/nystom -eigs_std = std(eigs_time,0, 2); % temps moyen eigs - - - - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/plot_results.m b/matlab/tfgm/experiments/plot_results.m deleted file mode 100644 index d07c70299ae499fed939fc118fe2d8d21ee140e7..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/plot_results.m +++ /dev/null @@ -1,230 +0,0 @@ -function plot_results() - -%% - -pwd; -pathname ='GabMulEigRunTimeExperiment'; -if ~exist('GabMulEigRunTimeExperiment','dir') - mkdir('GabMulEigRunTimeExperiment'); -end -addpath('GabMulEigRunTimeExperiment') - -%% -% fichier .mat -file_name = {'time_halko_vs_eigs256.mat', 'time_halko_vs_eigs1024.mat',..., - 'time_halko_vs_eigs4096.mat', 'time_halko_vs_eigs16384.mat',...., - 'time_halko_vs_eigs65536.mat'}; -%% -mask_area_list = zeros(length(file_name),1); -mask_area_ratio_list = zeros(length(file_name),1); -sig_len_list = zeros(length(file_name),1); - -for k =1:1 - rep_dir = ['exp',num2str(k)]; - - for l=1:length(file_name) - - figure(l) - data_folder = dir(fullfile(rep_dir,'*.mat')); - file = [data_folder(l).folder,filesep, file_name{l}]; - - upload_file = load(file); - - sig_len_list(l) = upload_file.signal_params.sig_len; - - % figure mask - plot_mask(upload_file.mask, upload_file.dgt_params.hop, upload_file.dgt_params.nbins, upload_file.fs); - axis tight; - saveas(gcf,fullfile(pathname,['mask_',num2str(upload_file.signal_params.sig_len),'.png'])); - - - % figure window - - plot_win(upload_file.dgt_params.win, upload_file.fs, upload_file.signal_params.sig_len, upload_file.dgt_params.win_type); - axis tight; - saveas(gcf,fullfile(pathname,['win_',num2str(upload_file.signal_params.sig_len),'.png'])); - - - % mask area - mask = 1- upload_file.mask; - - [mask_area, mask_area_ratio] = get_mask_area(mask); - mask_area_list(l) = mask_area; - mask_area_ratio_list(l) = mask_area_ratio; - end - -end -%% -% mask area -figure; -plot(sig_len_list, mask_area_list,'LineWidth',2.5); -grid() -set(gca,'YScale','log','XScale','log'); -xlabel('Signal length') -ylabel('# time-frequency coefficients') -title('Mask area') -set(gca, 'FontSize', 15, 'fontName','Times'); -saveas(gcf,fullfile(pathname, 'mask_area.pdf')); - -% mask area ratio - -figure; -plot(sig_len_list, mask_area_ratio_list,'LineWidth',2.5) -grid() -set(gca,'XScale','log'); - -xlabel('Signal length') -ylabel('%') -title('Mask area ratio') -set(gca, 'FontSize', 15, 'fontName','Times'); -saveas(gcf,fullfile(pathname, 'mask_area_ratio.pdf')); - - - - -%% Computation time, mean and std -n_exp = 10; -[arrf_time, rrf_time, eigs_time, evdnrrf_time, evdnarrf_time,..., - arrf_time_mean, rrf_time_mean, evdnrrf_time_mean, evdnarrf_time_mean,..., - evdarrrf_mean, evdrrf_mean,eigs_mean, arrf_time_std, rrf_time_std,..., - evdnrrf_time_std, evdnarrf_time_std, evdarrrf_std, ...., - evdrrf_std, eigs_std] = perf_measures(file_name,n_exp); - - -%% figure; -% comparaisons temps de calcul des 3 algos - -figure; -errorbar(sig_len_list, evdarrrf_mean, evdarrrf_std,'b-*','LineWidth',2.5); hold on; -errorbar(sig_len_list, eigs_mean, eigs_std, 'r-*','LineWidth',2.5); -errorbar(sig_len_list, evdrrf_mean, evdrrf_std,'m-*','LineWidth',2.5 ); -xlabel('signal length'); -ylabel('Computation time (s)') -legend('Adaptative Range Finder + EVD/Nystr�m', 'eigs','Fixed Range Finder + EVD/Nystr�m',..., - 'Location','northwest') -set(gca, 'FontSize', 15, 'fontName','Times'); -set(gca,'YScale','log','XScale','log'); -grid('on'); -axis tight; -saveas(gcf,fullfile(pathname,['running_times','.png'])); -%% -% comparaisons temps de calcul de tous les algos -figure; - -errorbar(sig_len_list, arrf_time_mean, arrf_time_std,'LineWidth',2.5); hold on; -errorbar(sig_len_list, rrf_time_mean, rrf_time_std,'LineWidth',2.5); -errorbar(sig_len_list, eigs_mean, eigs_std, 'LineWidth',2.5); -errorbar(sig_len_list, evdnarrf_time_mean, evdnarrf_time_std, 'LineWidth',2.5); -errorbar(sig_len_list, evdnrrf_time_mean, evdnrrf_time_std, 'LineWidth',2.5); - -legend('Adaptative Range Finder','Fixed Range Finder','eigs',..., - 'EVD/Nystr�m(ARRF)','EVD/Nystr�m(RRF)','Location','northwest') -set(gca, 'FontSize', 15, 'fontName','Times'); -set(gca,'YScale','log','XScale','log'); -grid('on'); -axis tight; -xlabel('Signal length') -ylabel('Running time (s)') -saveas(gcf,fullfile(pathname,['running_times_by_step','.png'])); - -%% Step by step: ratio of eigs running times (pas juste a revoir) -% ratio - - -[ratio_arrf_time_over_eigs,ratio_rrf_time_over_eigs,..., - ratio_evdnarrf_over_eigs,ratio_evdnrrf_over_eigs]= get_ratio_of_eigs_running_times(arrf_time, rrf_time, evdnarrf_time, evdnrrf_time,eigs_time); - - - -%mean ratio -ratio_arrf_time_over_eigs_mean = mean(ratio_arrf_time_over_eigs,2)*100; -ratio_rrf_time_over_eigs_mean = mean(ratio_rrf_time_over_eigs,2)*100; -ratio_evdnarrf_over_eigs_mean = mean(ratio_evdnarrf_over_eigs, 2)*100; -ratio_evdnrrf_over_eigs_mean = mean(ratio_evdnrrf_over_eigs, 2)*100; - - -% std - -ratio_arrf_time_over_eigs_std = std(ratio_arrf_time_over_eigs,0,2)*100; -ratio_rrf_time_over_eigs_std = std(ratio_rrf_time_over_eigs,0,2)*100; -ratio_evdnarrf_over_eigs_std = std(ratio_evdnarrf_over_eigs, 0,2)*100; -ratio_evdnrrf_over_eigs_std = std(ratio_evdnrrf_over_eigs, 0,2)*100; - - -figure; -errorbar(sig_len_list, ratio_arrf_time_over_eigs_mean, ratio_arrf_time_over_eigs_std,'LineWidth',2.5); hold on; -errorbar(sig_len_list, ratio_rrf_time_over_eigs_mean, ratio_rrf_time_over_eigs_std,'LineWidth',2.5); -errorbar(sig_len_list, ratio_evdnarrf_over_eigs_mean, ratio_evdnarrf_over_eigs_std, 'LineWidth',2.5); -errorbar(sig_len_list, ratio_evdnrrf_over_eigs_mean, ratio_evdnrrf_over_eigs_std, 'LineWidth',2.5); - -legend('Adaptative Range Finder','Fixed Range Finder',..., - 'EVD/Nystr�m(ARRF)','EVD/Nystr�m(RRF)','Location','northwest') -set(gca, 'FontSize', 15, 'fontName','Times'); -set(gca,'XScale','log'); -grid('on'); -axis tight; -xlabel('Signal length') -ylabel('Ratio of eigs running time (%)') -saveas(gcf,fullfile(pathname,['running_times_ratio_by_step','.png'])); - -%% error operator norm (erreur a revoir) - -[eigs_norm, arrfevdn_norm, rrfevdn_norm]= compute_error_operator_norm(file_name, n_exp); -eigs_norm_mean = mean(eigs_norm,2); -arrfevdn_norm_mean = mean(arrfevdn_norm,2); -rrfevdn_norm_mean = mean(rrfevdn_norm, 2); - - -eigs_norm_std = std(eigs_norm,0,2); -arrfevdn_norm_std = std(arrfevdn_norm, 0, 2); -rrfevdn_norm_std = std(rrfevdn_norm, 0, 2); - -figure; -errorbar(sig_len_list, eigs_norm_mean , eigs_norm_std,'LineWidth',2.5); hold on; -errorbar(sig_len_list, arrfevdn_norm_mean, arrfevdn_norm_std,'LineWidth',2.5); -errorbar(sig_len_list, rrfevdn_norm_mean, rrfevdn_norm_std, 'LineWidth',2.5); - -legend('eigs','Adaptative Range Finder + EVD/Nystr�m(ARRF)',..., - 'Fixed Range Finder + EVD/Nystr�m(RRF)','Location','northwest') -set(gca, 'FontSize', 15, 'fontName','Times'); -set(gca,'YScale','log','XScale','log'); -grid('on'); -axis tight; -xlabel('Signal length') -ylabel('Operator estimation error') -saveas(gcf,fullfile(pathname, 'operator_error.pdf')); - -%% Estimated rank - -q_with = estimated_rank(file_name, n_exp); -q_with_mean = mean(q_with, 2); -q_with_std = std(q_with, 0, 2); - -figure; -errorbar(sig_len_list, q_with_mean, q_with_std,'LineWidth',2) -set(gca, 'FontSize', 15, 'fontName','Times'); -set(gca, 'YScale','log','XScale','log') -xlabel('Signal length') -ylabel('Estimated rank') -grid('on'); -legend('Estimated rank','Location','northwest'); -saveas(gcf,fullfile(pathname,'rank_estimation.pdf')); - - -%% Estimated rank / sig length -rank_ratio = q_with./sig_len_list; -rank_ratio_mean = mean(rank_ratio,2)*100; -rank_ratio_std = std(rank_ratio_mean,0,2)*100; - -figure; -errorbar(sig_len_list, rank_ratio_mean, rank_ratio_std,'LineWidth',2) -set(gca, 'FontSize', 15, 'fontName','Times'); -set(gca,'XScale','log') -xlabel('Signal length') -ylabel('Estimated rank / signal length') -grid('on'); -legend('Estimated rank'); -saveas(gcf,fullfile(pathname,'rank_estimation_over_siglen.pdf')); - - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/solver.m b/matlab/tfgm/experiments/solver.m deleted file mode 100644 index 98e0894c91037af90ff06f1060408f43284232fd..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/solver.m +++ /dev/null @@ -1,43 +0,0 @@ -function [gab_mul, direct_stft, adjoint_stft, q_mat_arrf, arrf_time,...., - q_mat_rrf, rrf_time, svd_res_arrf,arrfevdn_time, svd_res_rrf,...., - rrfevdn_time, svd_res_eigs, eigs_time, eigs_norm, arrfevdn_norm, ..., - rrfevdn_norm,q_with] =solver(tolerance, r, mask, dgt_params, signal_params) - -[direct_stft, adjoint_stft] = get_stft_operators(dgt_params, signal_params); -gab_mul = gen_gabmul_operator(direct_stft, adjoint_stft, mask); - - -tic; -q_mat_arrf = adaptative_randomized_range_finder(gab_mul ,signal_params.sig_len, tolerance, r); -arrf_time = toc; - - -tic; -q_mat_rrf = randomized_range_finder(gab_mul, signal_params.sig_len, size(q_mat_arrf,2)); -rrf_time = toc; - - -tic; -svd_res_arrf = EVD_nystrom(gab_mul, q_mat_arrf); -arrfevdn_time= toc; - -tic; -svd_res_rrf = EVD_nystrom(gab_mul, q_mat_rrf); -rrfevdn_time= toc; - - -tic; -svd_res_eigs = EVD_eigs(gab_mul, signal_params.sig_len, size(q_mat_arrf,2) ); -eigs_time = toc; - - - -eigs_norm = error_operator_norm(gab_mul, svd_res_eigs); -arrfevdn_norm = error_operator_norm(gab_mul, svd_res_arrf); -rrfevdn_norm = error_operator_norm(gab_mul, svd_res_rrf); - - -q_with = size(q_mat_arrf,2); - - -end \ No newline at end of file diff --git a/matlab/tfgm/experiments/step_mask.m b/matlab/tfgm/experiments/step_mask.m deleted file mode 100644 index df1cd14b19370a935bc097e29c92d6a229a2ac7d..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/step_mask.m +++ /dev/null @@ -1,84 +0,0 @@ -clc ; clear; close all; -%% - -pwd; -pathname ='figures_JSTSP'; -if ~exist('figures_JSTSP','dir') - mkdir('figures_JSTSP'); -end -addpath('figures_JSTSP') - -%% -ind_loc = 5; -ind_wd = 3; -deb_ind_loc = 0; -deb_ind_wd=0; -resampling_fs = 8000; -sig_len = 16384; -%% - - -param_gauss = get_win_gauss_param(); - - -win_len = param_gauss.win_len; -win_type = param_gauss.win_type; -alpha = param_gauss.alpha; -seuil = param_gauss.seuil; -radius = param_gauss.radius; - -%% -sig_loc = load_localized_signal(ind_loc, resampling_fs, sig_len, deb_ind_loc); -sig_wd = load_wideband_signal(ind_wd, resampling_fs, sig_len, deb_ind_wd); - -signals = generate_mix_signal(sig_wd, sig_loc); - -fs = resampling_fs; -sig_len = length(sig_loc); -signal_params = generate_signal_parameters(fs, sig_len); - -%% dgt -dgt_params = generate_dgt_parameters(win_type, win_len); -dgt_params.hop = 32; % -dgt_params.nbins = 512;% -[dgt, idgt] = get_stft_operators(dgt_params, signal_params); - - - tf_mat_wb = compute_dgt(signals.target, dgt ); - tf_mat_loc = compute_dgt(signals.noise, dgt ); - - -%% Etape 1 -figure; -subplot(131) -set(gcf,'position',[1, 1, 1000 400]); -mask = and(abs(tf_mat_wb)<alpha*abs(tf_mat_loc), abs(tf_mat_loc)>seuil); -%figure('name','mask'); -plot_spectrogram(mask, dgt_params,signal_params, dgt ); -axis square; -set(gca, 'FontSize', 20, 'fontName','Times'); -%saveas(gcf,fullfile(pathname, 'mask_cuicui_gauss_1.png')); - - -%Etape 2 - -se = strel('disk',radius); - -mask = imclose(mask,se); -%figure('name','mask'); -subplot(132) -plot_spectrogram(mask, dgt_params,signal_params, dgt ); -set(gca, 'FontSize', 20, 'fontName','Times'); -axis square; -%saveas(gcf,fullfile(pathname, 'mask_cuicui_gauss_2.png')); - - -subplot(133) -mask = imopen(mask,se); -%figure('name','mask'); -plot_spectrogram(mask, dgt_params,signal_params, dgt ); -set(gca, 'FontSize', 20, 'fontName','Times'); -axis square; -%saveas(gcf,fullfile(pathname, 'mask_cuicui_gauss_3.png')); -saveas(gcf,fullfile(pathname, 'mask_step.png')); - diff --git a/matlab/tfgm/experiments/test_gen_gabmul_operator.m b/matlab/tfgm/experiments/test_gen_gabmul_operator.m deleted file mode 100644 index b3db5fa33e76f7d581ad5c34dd59b63d89ca954d..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/test_gen_gabmul_operator.m +++ /dev/null @@ -1,27 +0,0 @@ -clc; clear; close all; -%% -setting='full'; -exp = get_experiment(setting); -param = exp.data_params; -t_lim = [exp.problem_params.t_val{1}, exp.problem_params.t_val{2}]; -f_lim = [exp.problem_params.f_val{1}, exp.problem_params.f_val{2}]; -win_type = exp.problem_params.win_type; - -%% -param_pow = param{4}; - problem_data = get_problem_data(param_pow,t_lim, f_lim, win_type); - - %% - dgt_params = problem_data.dgt_params; -signal_params = problem_data.signal_params; -mask = problem_data.mask; -[direct_stft, adjoint_stft] = get_stft_operators(dgt_params, signal_params); -gab_mul = gen_gabmul_operator(direct_stft, adjoint_stft, mask); - -%% -figure; imagesc(mask) -x = randn(signal_params.sig_len,1); -A = gab_mul(x); -figure; plot(x); -figure; plot(A); -figure; sgram(A,'dynrange',90) diff --git a/matlab/tfgm/experiments/test_get_problem_data.m b/matlab/tfgm/experiments/test_get_problem_data.m deleted file mode 100644 index eb97a828cd04200b11ee15c0326f53cd37e0ca2a..0000000000000000000000000000000000000000 --- a/matlab/tfgm/experiments/test_get_problem_data.m +++ /dev/null @@ -1,22 +0,0 @@ -clc; close all; - -%% -setting='full'; -exp = get_experiment(setting); - -%% -param = exp.data_params; -t_lim = [exp.problem_params.t_val{1}, exp.problem_params.t_val{2}]; -f_lim = [exp.problem_params.f_val{1}, exp.problem_params.f_val{2}]; -win_type = exp.problem_params.win_type; - -%% -figure; -for k = 1:length(param) - param_pow = param{k}; - problem_data = get_problem_data(param_pow,t_lim, f_lim, win_type); - - figure(k); - plot_mask(problem_data.mask, problem_data.hop, problem_data.dgt_params.nbins, problem_data.signal_params.fs) - -end \ No newline at end of file