Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverb and clipping/peak normalization #136

Open
pseeth opened this issue Sep 28, 2020 · 0 comments
Open

Reverb and clipping/peak normalization #136

pseeth opened this issue Sep 28, 2020 · 0 comments

Comments

@pseeth
Copy link
Collaborator

pseeth commented Sep 28, 2020

SoX reverb doesn't play well with clipped signals, but we currently don't have a unit test for this. We should add one.

Here's a script using nussl and SoxBindings to show the issue (run in a notebook):

import soxbindings as sox
import copy
data = nussl.AudioSignal(
    nussl.efz_utils.download_audio_file('marimba_timbre.mp3')
)
data.peak_normalize()
original = copy.deepcopy(data)
print('Original')
original.embed_audio()
clip = original * 10.0
print('Clipping (WARNING: Volume)')
clip.embed_audio()
tfm = sox.Transformer()
tfm.reverb(100)
out = tfm.build_array(
    input_array=clip.audio_data.T,
    sample_rate_in=clip.sample_rate
)
out = clip.make_copy_with_audio_data(out.T)
print('Clipping + reverb')
out.embed_audio()
out.peak_normalize()
print('Peak normalized clipping + reverb')
out.embed_audio()
tfm = sox.Transformer()
tfm.reverb(100)
out = tfm.build_array(
    input_array=original.audio_data.T,
    sample_rate_in=original.sample_rate
)
out = original.make_copy_with_audio_data(out.T)
print('Original + reverb')
out.embed_audio()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant