-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Hello!
I ran a quiet sine wave through the implementation and I believe it overflowed, I received the output:
loudness 2473.459531146733
import numpy as np
import pyloudnorm
frequency = 997
sample_rate = 1000
block_size = 0.4
# NOTE: Generate sine wave
# https://stackoverflow.com/questions/22566692/python-how-to-plot-graph-sine-wave/34442729
signal = np.arange(sample_rate * block_size, dtype=np.float32)
signal = np.sin(2 * np.pi * frequency * (signal / sample_rate)).astype(np.float32)
signal = signal / 100000
meter = pyloudnorm.Meter(rate=sample_rate, block_size=block_size, filter_class="DeMan")
print("loudness", meter.integrated_loudness(signal))I think it would be best to adjust the computation so that this does not overflow and return negative infinity like other quiet signals.
Metadata
Metadata
Assignees
Labels
No labels