# Path: pambox/utils.py
# def dbspl(x, ac=False, offset=0.0, axis=-1):
# def setdbspl(x, lvl, ac=False, offset=0.0):
# def rms(x, ac=False, axis=-1):
# def hilbert(x, N=None, axis=-1):
# def next_pow_2(x):
# def fftfilt(b, x, n=None):
# def write_wav(fname, fs, x, normalize=False):
# def make_same_length(a, b, extend_first=True):
# def add_signals(a, b):
# def int2srt(x, y, srt_at=50.0):
# def psy_fn(x, mu=0., sigma=1.):
# def noctave_center_freq(lowf, highf, width=3):
# def impz(b, a=1):
# def mfreqz(b, a=1, fs=22050.0):
# def read_wav_as_float(path):
#         N = x.shape[axis]
#             N = 2 ** arange(ceil(log2(N_b)), 27)
#     L = int(N_fft - N_b + 1)
#     B = fft(b, N_fft)
#         B = np.tile(B, (x.shape[0], 1))


import glob
import logging
import os
import random
import numpy as np
import scipy.io.wavfile
from six.moves import zip, range
from pambox import utils
        ssn = ssn[..., :n_output]
        for _ in range(repetitions):
            random.shuffle(files)
            start = np.random.randint(max_jitter)
            ssn += np.hstack(files)[..., start:start + n_output]
        ssn /= np.sqrt(repetitions)
        return ssn

    def create_filtered_ssn(self, files=None, duration=5):
        """Create speech-shaped noise based on the average long-term spectrum
        of the speech material.

        Parameters
        ----------
        files : list, optional
            List of files to concatenate. Each file should be an `ndarray`.
            If `files` is None, all the files from the speech material
            will be used. They are loaded with the method `load_files()`.
        duration : float, optional
            Duration of the noise, in seconds. The default is 5 seconds.

        Returns
        -------
        ssn : ndarray
        """
        if files is None:
            files = tuple(self.load_files())

        # Find maximum sentence length
        max_len = reduce(lambda x, y: max(x, y.shape[-1]), files, 0)

# Path: pambox/utils.py
# def dbspl(x, ac=False, offset=0.0, axis=-1):
# def setdbspl(x, lvl, ac=False, offset=0.0):
# def rms(x, ac=False, axis=-1):
# def hilbert(x, N=None, axis=-1):
# def next_pow_2(x):
# def fftfilt(b, x, n=None):
# def write_wav(fname, fs, x, normalize=False):
# def make_same_length(a, b, extend_first=True):
# def add_signals(a, b):
# def int2srt(x, y, srt_at=50.0):
# def psy_fn(x, mu=0., sigma=1.):
# def noctave_center_freq(lowf, highf, width=3):
# def impz(b, a=1):
# def mfreqz(b, a=1, fs=22050.0):
# def read_wav_as_float(path):
#         N = x.shape[axis]
#             N = 2 ** arange(ceil(log2(N_b)), 27)
#     L = int(N_fft - N_b + 1)
#     B = fft(b, N_fft)
#         B = np.tile(B, (x.shape[0], 1))


# Path: pambox/speech/material.py
import glob
import logging
import os
import random
import numpy as np
import scipy.io.wavfile
from six.moves import zip, range
from pambox import utils

        ssn = ssn[..., :n_output]
        for _ in range(repetitions):
            random.shuffle(files)
            start = np.random.randint(max_jitter)
            ssn += np.hstack(files)[..., start:start + n_output]
        ssn /= np.sqrt(repetitions)
        return ssn

    def create_filtered_ssn(self, files=None, duration=5):
        """Create speech-shaped noise based on the average long-term spectrum
        of the speech material.

        Parameters
        ----------
        files : list, optional
            List of files to concatenate. Each file should be an `ndarray`.
            If `files` is None, all the files from the speech material
            will be used. They are loaded with the method `load_files()`.
        duration : float, optional
            Duration of the noise, in seconds. The default is 5 seconds.

        Returns
        -------
        ssn : ndarray
        """
        if files is None:
            files = tuple(self.load_files())

        # Find maximum sentence length
        max_len = reduce(lambda x, y: max(x, y.shape[-1]), files, 0)

        n_fft = utils.next_pow_2(max_len)