Skip to content

Releases: audeering/audmath

Release v1.4.1

18 Jun 12:41
36d8803
Compare
Choose a tag to compare
  • Added: support for numpy 2.0
  • Removed: support for Python 3.8

Release v1.4.0

05 Oct 12:42
c6dbdd0
Compare
Choose a tag to compare
  • Added: audmath.similarity()%0A* Added: support for Python 3.12

Release v1.3.0

10 Jul 10:41
7143d3d
Compare
Choose a tag to compare
  • Added: audmath.samples()
  • Removed: support for Python 3.7

Release v1.2.1

07 Feb 11:00
8ab0e08
Compare
Choose a tag to compare
'^ *'  # space
'('  # 1st group: value
'[\\-\\+]?[0-9]*[.]?[0-9]*'
')'
' *'  # space
'('  # 2nd group: unit
'[a-zA-Zμ]*'
')'
' *$'  # space
    duration: typing.Optional[
        typing.Union[float, int, str, np.timedelta64]
    ],
        and ``sampling_rate`` is always ignored.
        If duration is
        ``None``,
        :obj:`numpy.nan`,
        :obj:`pandas.NA`,
        :obj:`pandas.NaT`,
        ``''``,
        ``'None'``,
        ``'NaN'``,
        ``'NaT'``,
        or any other lower/mixed case version of those strings
        :obj:`numpy.nan` is returned.
        If duration is
        :obj:`numpy.inf`,
        ``'Inf'``
        or any other lower/mixed case version of that string
        :obj:`numpy.inf` is returned,
        and ``-``:obj:`numpy.inf` for the negative case
    >>> duration_in_seconds('Inf')
    inf
    >>> duration_in_seconds(None)
    nan
    # none/-inf/inf duration
    if duration.lower() in ['', 'none', 'nan', 'nat']:
        return np.NaN
    elif duration.lower() == '-inf':
        return -np.inf
    elif duration.lower() == 'inf' or duration.lower() == '+inf':
        return np.inf
    match = re.match(VALUE_UNIT_PATTERN, duration)
    if not value or value == '+':
    elif value == '-':
        value = -1.0
# handle nan/none durations
elif (
        duration is None
        or duration.__class__.__name__ == 'NaTType'
        or duration.__class__.__name__ == 'NAType'
        or np.isnan(duration)
):
    return np.NaN
    (None, None, np.NaN),
    (None, 1000, np.NaN),
    ('', None, np.NaN),
    ('', 1000, np.NaN),
    ('none', None, np.NaN),
    ('none', 1000, np.NaN),
    ('None', None, np.NaN),
    ('None', 1000, np.NaN),
    ('nan', None, np.NaN),
    ('nan', 1000, np.NaN),
    ('NaN', None, np.NaN),
    ('NaN', 1000, np.NaN),
    ('nat', None, np.NaN),
    ('nat', 1000, np.NaN),
    ('NaT', None, np.NaN),
    ('NaT', 1000, np.NaN),
    (np.NaN, None, np.NaN),
    (np.NaN, 1000, np.NaN),
    (pd.NaT, None, np.NaN),
    (pd.NaT, 1000, np.NaN),
    (pd.NA, None, np.NaN),
    (pd.NA, 1000, np.NaN),
    (np.timedelta64('NaT', 's'), None, np.NaN),
    (np.timedelta64('NaT', 's'), 1000, np.NaN),
    ('inf', None, np.inf),
    ('inf', 1000, np.inf),
    ('Inf', None, np.inf),
    ('Inf', 1000, np.inf),
    (np.inf, None, np.inf),
    (np.inf, 1000, np.inf),
    (np.Inf, None, np.inf),
    (np.Inf, 1000, np.inf),
    ('+inf', None, np.inf),
    ('+inf', 1000, np.inf),
    ('+Inf', None, np.inf),
    ('+Inf', 1000, np.inf),
    (+2, None, 2.0),
    (+2, 1000, 0.002),
    (+2.0, None, 2.0),
    (+2.0, 1000, 0.002),
    ('+s', None, 1.0),
    ('+s', 1000, 1.0),
    (' +s', None, 1.0),
    (' +s', 1000, 1.0),
    ('+2s', None, 2.0),
    ('+2s', 1000, 2.0),
    ('+2s ', None, 2.0),
    ('+2s ', 1000, 2.0),
    (' +2s', None, 2.0),
    (' +2s', 1000, 2.0),
    ('+2 s', None, 2.0),
    ('+2 s', 1000, 2.0),
    ('+2  s', None, 2.0),
    ('+2  s', 1000, 2.0),
    ('+2000ms', None, 2.0),
    ('+2000ms', 1000, 2.0),
    ('+2000.0ms', None, 2.0),
    ('+2000.0ms', 1000, 2.0),
    ('+2000 ms', None, 2.0),
    ('+2000 ms', 1000, 2.0),
    ('+2000.0 ms', None, 2.0),
    ('+2000.0 ms', 1000, 2.0),
    ('+2000', None, 2000.0),
    ('+2000', 1000, 2.0),
    ('+2000 ', None, 2000.0),
    ('+2000 ', 1000, 2.0),
    ('+2000.0', None, 2000.0),
    ('+2000.0', 1000, 2.0),
    ('+2000.1', None, 2000.1),
    ('+2000.1', 1000, 2.0000999999999998),
    ('+0.5', None, 0.5),
    ('+0.5', 2, 0.25),
    ('+3', 1.5, 2.0),
    (np.timedelta64(+2, 's'), None, 2.0),
    (np.timedelta64(+2, 's'), 1000, 2.0),
    (np.timedelta64(+2000, 'ms'), None, 2.0),
    (np.timedelta64(+2000, 'ms'), 1000, 2.0),
    (pd.to_timedelta(+2, 's'), None, 2.0),
    (pd.to_timedelta(+2, 's'), 1000, 2.0),
    (pd.to_timedelta(+2000, 'ms'), None, 2.0),
    (pd.to_timedelta(+2000, 'ms'), 1000, 2.0),
    ('-inf', None, -np.inf),
    ('-inf', 1000, -np.inf),
    ('-Inf', None, -np.inf),
    ('-Inf', 1000, -np.inf),
    (-2, None, -2.0),
    (-2, 1000, -0.002),
    (-2.0, None, -2.0),
    (-2.0, 1000, -0.002),
    ('-s', None, -1.0),
    ('-s', 1000, -1.0),
    (' -s', None, -1.0),
    (' -s', 1000, -1.0),
    ('-2s', None, -2.0),
    ('-2s', 1000, -2.0),
    ('-2s ', None, -2.0),
    ('-2s ', 1000, -2.0),
    (' -2s', None, -2.0),
    (' -2s', 1000, -2.0),
    ('-2 s', None, -2.0),
    ('-2 s', 1000, -2.0),
    ('-2  s', None, -2.0),
    ('-2  s', 1000, -2.0),
    ('-2000ms', None, -2.0),
    ('-2000ms', 1000, -2.0),
    ('-2000.0ms', None, -2.0),
    ('-2000.0ms', 1000, -2.0),
    ('-2000 ms', None, -2.0),
    ('-2000 ms', 1000, -2.0),
    ('-2000.0 ms', None, -2.0),
    ('-2000.0 ms', 1000, -2.0),
    ('-2000', None, -2000.0),
    ('-2000', 1000, -2.0),
    ('-2000 ', None, -2000.0),
    ('-2000 ', 1000, -2.0),
    ('-2000.0', None, -2000.0),
    ('-2000.0', 1000, -2.0),
    ('-2000.1', None, -2000.1),
    ('-2000.1', 1000, -2.0000999999999998),
    ('-0.5', None, -0.5),
    ('-0.5', 2, -0.25),
    ('-3', 1.5, -2.0),
    (np.timedelta64(-2, 's'), None, -2.0),
    (np.timedelta64(-2, 's'), 1000, -2.0),
    (np.timedelta64(-2000, 'ms'), None, -2.0),
    (np.timedelta64(-2000, 'ms'), 1000, -2.0),
    (pd.to_timedelta(-2, 's'), None, -2.0),
    (pd.to_timedelta(-2, 's'), 1000, -2.0),
    (pd.to_timedelta(-2000, 'ms'), None, -2.0),
    (pd.to_timedelta(-2000, 'ms'), 1000, -2.0),
duration_in_seconds = audmath.duration_in_seconds(duration, sampling_rate)
if np.isnan(expected):
    assert np.isnan(duration_in_seconds)
else:
    assert duration_in_seconds == expected

Release v1.2.0

01 Feb 11:07
b4ad413
Compare
Choose a tag to compare
  • Added: audmath.duration_in_seconds()
    to convert any duration value to seconds

Release v1.1.1

20 Dec 13:58
85e8dfe
Compare
Choose a tag to compare
  • Added: support for Python 3.11
  • Changed: split API documentation into sub-pages
    for each function

Release v1.1.0

02 Dec 08:41
480e345
Compare
Choose a tag to compare
  • Added: audmath.rms()
    to calculate root mean square of signal
  • Added: audmath.db()
    to convert from amplitude to decibel
  • Added: audmath.invert_db()
    to convert from decibel to amplitude
  • Added: audmath.window()
    to provide different kind
    of (half-)windows
  • Added: support for Python 3.10

Release v1.0.0

03 Jan 14:37
Compare
Choose a tag to compare
  • Added: Python 3.9 support
  • Removed: Python 3.6 support

Release v0.9.4

25 Oct 11:14
Compare
Choose a tag to compare
  • Fixed: bottom margin in API table

Release v0.9.3

25 Oct 09:58
Compare
Choose a tag to compare
  • Changed: use new sphinx-audeering-theme