Пример #1
0
def test_randomadditivemix(signal1, signal2, ratio, percentage_silence,
                           expected_signal):
    mixed_signal = F.additive_mix(signal1, signal2, ratio)
    assert np.array_equal(mixed_signal, expected_signal)
    augmentation_data_set = [[signal2]]
    t = transforms.RandomAdditiveMix(dataset=augmentation_data_set,
                                     ratios=[ratio],
                                     percentage_silence=percentage_silence)
    assert np.array_equal(t(signal1), expected_signal)
    t = transforms.RandomAdditiveMix(dataset=augmentation_data_set)
    transform = t(signal1)
    functional = F.additive_mix(signal1, signal2, t.ratio)
    assert np.array_equal(transform, functional)
Пример #2
0
def test_additivemix(input1, input2, ratio, percentage_silence,
                     expected_output):
    output = F.additive_mix(input1, input2, ratio)
    assert np.array_equal(output, expected_output)