simplecochlea.utils.utils_cochlea.erbscale(fs, fmin_hz, fmax_hz, n_filters, q_ear=9.26449, bw_min=24.7, bw_mult=1)[source]¶The erbscale gives an approximation of the bandwidth of the filters in human hearing.
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_cochlea.erbspace(fmin_hz, fmax_hz, N, q_ear=9.26449, bw_min=24.7)[source]¶Gives the center frequencies of N auditory filters between fmin_hz and fmax_hz using the ERB scale.
| Parameters: |
|
|---|
simplecochlea.utils.utils_cochlea.find_equal_areas_limits(poly_coeff, n_areas, xmin, xmax)[source]¶Given a polynomial function defined by its polynomial coefficients poly_coeff, compute the limits of n_areas between the x-coordinate xmin and xmax, so that all these areas are equal. In other words, it divides the area under the curve defined by the polynomial function into n equal areas.
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_cochlea.linearscale(fs, fmin_hz, fmax_hz, n_filters)[source]¶Design n_filters band-pass filters ranging from fmin_hz to fmax with a central frequencies increases linearly and with a fixed bandwidth defined such that the overlap of the frequency responses of adjacent filters is equal to half the bandwidth.
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_cochlea.musicscale(fs, fmin_hz, fmax_hz, n_filters, poly_coeff=[], bw_mult=10)[source]¶Experimental - Try to compute equal-power band in a mean spectrum of music segments - Do not use
simplecochlea.utils.utils_cochlea.normalize_vector(x)[source]¶Normalize vector x between -1 and 1
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_cochlea.plot_input_output(input_sig, output_sig, fs, input_sig_label, output_sig_label, same_colobar=0)[source]¶simplecochlea.utils.utils_cochlea.t_spikes_to_spikerate(t_spikes, fs, n_pnts, kernel_duration=0.015)[source]¶Compute a mean firing rate over time using a gaussian kernel from the spike times. The kernel duration is set by the kernel_duration parameter.
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_freqanalysis.find_peaks(x, thresh_from_baseline, min_dist=1)[source]¶Algorithm for detecting peaks above the baseline. A peak should be thresh_from_baseline above the baseline to be detected.
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_freqanalysis.find_spectrum_peaks(x, fs, fmin=[], fmax=[], nfft=4092, thresh_db_from_baseline=6, do_plot=False)[source]¶Find the peaks in the Power Spectral Density of signal x between fmin and fmax. A peak is detected if its amplitude is over the threshold defined by thresh_db_from_baseline.
| Parameters: |
|
|---|---|
| Returns: |
|
simplecochlea.utils.utils_freqanalysis.get_spectral_features(x, fs, fmin=[], fmax=[], nfft=2048, do_plot=False, logscale=True)[source]¶| Parameters: |
|
|---|---|
| Returns: |
|