Commit b3fe7ee4 authored by Marina Kreme's avatar Marina Kreme
Browse files

refactor

parent a08c0210
Pipeline #5950 passed with stage
in 4 minutes and 53 seconds
function x_zero= solver_tfgm_zero(X, mask, idgt)
%% x_zero= solver_tfgm_zero(X, mask, idgt)
% Thid function reconstruct the signal after filling the masked regions by zeros.
% Inputs:
% - X: time-frequency matrix
% - mask: binary mask
% - idgt: Inverse of Gabor transform operator
% Outputs:
% -x_interp: estimated signal
%
%
% Author: Marina KREME
%%
X(mask==1)=0;
x_zero = compute_idgt(X, idgt);
end
\ No newline at end of file
function x_est= zero_fill_solver(x, mask, dgt, idgt, dgt_params,...,
signal_params, fig_dir)
%% x_est= zero_fill_solver(x, mask, dgt, idgt, dgt_params,...,
% signal_params, fig_dir)
% Thid function reconstruct the signal after filling the masked regions by zeros.
% Inputs:
% - x (nd array): mix signals
% - mask: time-frequency mask
% - idgt,dgt (handle): DGT and IDGT . see utils/get_stft_operators.m
% - dgt_params (struct) : DGT parameters
% - signal_params (struct) . :signals parameters
% - fig_dir : folder where figures are stored
% Outputs:
% -x_est (nd array): estimated signal
%
%
% Author: Marina KREME
%%
x_tf = dgt(x);
x_tf(mask==1)=0;
x_est = idgt(x_tf);
%%
figure
plot_spectrogram(x_tf, dgt_params,signal_params, dgt);
title('TF matrix filled by zeros in mask')
saveas(gcf,fullfile(fig_dir,'tf_filled_zeros.pdf'));
figure
plot_spectrogram(x_est, dgt_params,signal_params, dgt);
title('Reconstructed signal by zero fill')
saveas(gcf,fullfile(fig_dir,'zero_fill_est.pdf'));
end
\ No newline at end of file
Markdown is supported
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