Commit 6622f7bf authored by Marina Kreme's avatar Marina Kreme
Browse files

delet unused file

parent 6e2283a0
Pipeline #5929 canceled with stage
function [signal_params, dgt_params, w,dgt,idgt, signals, alpha, seuil,...,
r, mask,dgt_mix]= get_cuicui_mix_icassp()
%% This function allows you to reproduce ICASSP dataset.
%% Signal parameters
%make_wav_pairs();
sig_len = 2^(13);
fs = 8000;
signal_params.fs = fs;
signal_params.sig_len = sig_len;
%% dgt parameters
approx_win_duration =0.02;
win_type ='hann';
win_len = 2^(round(log2(approx_win_duration*fs)));
dgt_params.hop = win_len/4 ;
dgt_params.nbins=4*win_len;
dgt_params.sig_len = sig_len;
dgt_params.win_type = win_type;
dgt_params.win_len = win_len;
%% window and DGT operator
L=dgtlength(dgt_params.sig_len, dgt_params.hop, dgt_params.nbins);
w = gabwin(dgt_params.win_type, dgt_params.hop, dgt_params.nbins, dgt_params.win_len);
dgt = @(x) dgtreal(x,w, dgt_params.hop, dgt_params.nbins, dgt_params.sig_len);
wd = {'dual', dgt_params.win_type};
idgt= @(x)idgtreal(x, wd, dgt_params.hop,dgt_params.nbins, dgt_params.sig_len);
compute_stft = @(x,w,dgt_params,L) dgtreal(x,w, dgt_params.hop, dgt_params.nbins,L);
%% signals and their mixtures
ind_wideband = 1;
ind_localized = 2;
deb = 0.2;
[x_engine, x_bird] = load_pairs(ind_wideband, ind_localized,...,
fs, sig_len, deb);
%%
x_target = x_engine;
x_perturbation = x_bird;
gamma=0.7;
x_target = x_target/max(abs(x_target));
x_perturbation = x_perturbation/max(abs(x_perturbation));
x_target = gamma*x_target;
x_perturbation = (1-gamma)*x_perturbation;
x_mix = x_target +x_perturbation;
signals.target = x_target;
signals.noise = x_perturbation;
signals.mix = x_mix;
%% Spectogramm of signals
dgt_Xref = compute_stft(signals.target,w, dgt_params,L);
dgt_Xper = compute_stft(signals.noise, w, dgt_params,L);
dgt_mix = dgt_Xref +dgt_Xper;
%% mask
alpha = 2; seuil =0.02; r = 3;
mask = and(abs(dgt_Xper) < alpha*abs(dgt_Xref),abs(dgt_Xper)<seuil);
se = strel('disk',r);
mask =imclose(mask,se);
figure; imagesc(mask);
%% plot figures
fig_dir ='figures_car_bird_icassp';
if ~exist(fig_dir,'dir')
mkdir(fig_dir);
end
addpath(fig_dir)
figure;
plot_spectrogram(mask, dgt_params, signal_params, dgt);
title('mask')
saveas(gcf,fullfile(fig_dir,'mask.png'));
figure;
plot_spectrogram(dgt_Xref, dgt_params, signal_params, dgt)
title('target signal')
saveas(gcf,fullfile(fig_dir,'engine.png'));
figure;
plot_spectrogram(dgt_Xper, dgt_params, signal_params, dgt)
title('perturbation signal')
saveas(gcf,fullfile(fig_dir,'bird.png'));
figure;
plot_spectrogram(dgt_mix, dgt_params, signal_params, dgt)
title('perturbation signal')
saveas(gcf,fullfile(fig_dir,'engine_bird.png'));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment