Demo for tffpy.tf_fading.estimate_energy_in_maskΒΆ

A simple demonstration for the estimation of energy in time-frequency regions.

In [1]:
%load_ext autoreload
%autoreload 2

%matplotlib inline
In [2]:
%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {
    return false;
}
In [3]:
import numpy as np
import matplotlib as mpl
mpl.rcParams['figure.figsize'] = [15.0, 7.0]

from tffpy.datasets import get_mix
from tffpy.tf_fading import estimate_energy_in_mask
In [4]:
fig_dir = 'fig_energy_estimation'
x_mix, dgt_params, signal_params, mask, x_loc, x_wb = \
            get_mix(loc_source='bird',
                    wideband_src='car',
                    crop=None,
                    win_dur=256/8000,
                    win_type='gauss',
                    hop_ratio=1/4,
                    n_bins_ratio=4,
                    n_iter_closing=3,
                    n_iter_opening=3,
                    closing_first=True,
                    delta_mix_db=0,
                    delta_loc_db=40,
                    wb_to_loc_ratio_db=8,
                    or_mask=True,
                    fig_dir=fig_dir)
../_images/_notebooks_mask_energy_estimation_4_0.png
../_images/_notebooks_mask_energy_estimation_4_1.png
../_images/_notebooks_mask_energy_estimation_4_2.png
../_images/_notebooks_mask_energy_estimation_4_3.png
../_images/_notebooks_mask_energy_estimation_4_4.png
../_images/_notebooks_mask_energy_estimation_4_5.png
../_images/_notebooks_mask_energy_estimation_4_6.png
../_images/_notebooks_mask_energy_estimation_4_7.png
In [5]:
estimate_energy_in_mask(x_mix=x_mix, mask=mask, dgt_params=dgt_params, signal_params=signal_params,
                        fig_dir=fig_dir, prefix=None)
Out[5]:
array([0.01701245])
../_images/_notebooks_mask_energy_estimation_5_1.png
../_images/_notebooks_mask_energy_estimation_5_2.png
../_images/_notebooks_mask_energy_estimation_5_3.png
../_images/_notebooks_mask_energy_estimation_5_4.png
../_images/_notebooks_mask_energy_estimation_5_5.png