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)
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])