test_tf_fading.py 1.03 KB
Newer Older
valentin.emiya's avatar
valentin.emiya committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import unittest

from tffpy.datasets import get_mix
from tffpy.tf_fading import estimate_energy_in_mask


class TestEstimateEnergyInMask(unittest.TestCase):
    def test_estimate_energy_in_mask(self):
        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)

        estimated_energy = estimate_energy_in_mask(
            x_mix=x_mix, mask=mask, dgt_params=dgt_params,
            signal_params=signal_params, fig_dir=fig_dir, prefix=None)