Package lib :: Module voice_misc
[frames] | no frames]

Module voice_misc

source code

Classes
  cont_kernel_c
An instance of this class produces a window with a specified number of nodes.
Functions
 
window(n, k, norm=2)
Make a window of length n with k nodes.
source code
 
test_cont_kernel() source code
 
cont_kernel(n, k, norm=2, kernel=<function window at 0x42add70>)
Make a window with width n, except that it changes continuously when n is a floating point number.
source code
 
xexp(a)
exp(a), except protected from underflows.
source code
 
start_end(t, dt, window, len_d)
Find start and end points for a window.
source code
 
near_win_size(near=None, tol=None, min=None, max=None, real=False)
Find a window size near the specified size where the FFT algorithm is fastest.
source code
 
frommid_generator(s, e)
Generate numbers in [s,e] starting at the midpoint.
source code
 
near_win_size_real(near=None, tol=None, min=None, max=None) source code
 
test_win_size() source code
 
test_print_win() source code
 
bandpass_first_order(d, cutoff_hp, cutoff_lp)
A combinatio of a first-order high-pass filter and a low-pass filter.
source code
 
test_hpf() source code
 
fft_freq(n, d=1.0)
Returns an array of indices whose frequencies are between f0 and f1 after you've called fft().
source code
 
fft_indices(f0, f1, n, d=1.0)
Returns an array of indices whose frequencies are between f0 and f1 after you've called real_fft().
source code
numpy.ndarray
real_fft_freq(n, d=1.0)
Returns the frequencies associated with an index, after you've called real_fft().
source code
 
real_fft_indices(f0, f1, n, d=1.0)
Returns the indices whose frequencies are between f0 and f1 after you've called real_fft().
source code
 
dataprep_flat_real(data, dt, edgewidth, pad=None) source code
 
dataprep_flat(data, dt, edgewidth, pad=None) source code
 
dataprep_flat_generic(data, dt, edgewidth, pad, isreal)
Pad the data, subtract the average, and round the edges of the window.
source code
 
dataprep2_flat_generic(data, dt, edgewidth, pad, isreal)
Pad the data, subtract the average, and round the edges of the window.
source code
 
lowpass_sym_butterworth(d, cutoff_freq, order=4)
A time-symmetric filter with a magnitude response that is the same as the Butterworth filter.
source code
 
lowpass_sym_Gaussian(d, cutoff_freq)
A time-symmetric filter with a Gaussian impulse response.
source code
 
lowpass_sym_gaussian(d, cutoff_freq)
A time-symmetric filter with a Gaussian impulse response.
source code
 
hipass_sym_butterworth(d, cutoff_freq, order=4)
A time-symmetric filter with a magnitude response that is the same as the Butterworth filter.
source code
 
test_lpb() source code
 
test_hpb() source code
 
pink_noise(n)
Create pink noise where the power spectral density goes as 1/f (except right at f=0).
source code
Variables
  __package__ = 'lib'

Imports: math, numpy, ortho_poly, die, gpkmisc, GT, hipass_first_order, lopass_first_order


Function Details

window(n, k, norm=2)

source code 

Make a window of length n with k nodes. The window is normalized so that numpy.sum(w**norm)==1.

cont_kernel(n, k, norm=2, kernel=<function window at 0x42add70>)

source code 

Make a window with width n, except that it changes continuously when n is a floating point number. The resulting window is always an odd length.

start_end(t, dt, window, len_d)

source code 

Find start and end points for a window.

Parameters:
  • t (float) - desired window center (seconds).
  • window (int) - window width (in samples).
  • dt (float) - sampling interval (seconds).
  • len_d (int @return (starting sample, end) where end=sample beyond the last @rtype (int, int)) - length of data array (samples).

bandpass_first_order(d, cutoff_hp, cutoff_lp)

source code 

A combinatio of a first-order high-pass filter and a low-pass filter. Cutoff freq is measured in cycles per point.

fft_freq(n, d=1.0)

source code 

Returns an array of indices whose frequencies are between f0 and f1 after you've called fft(). This will produce negative values where appropriate.

real_fft_freq(n, d=1.0)

source code 

Returns the frequencies associated with an index, after you've called real_fft().

Parameters:
  • d (float) - The time interval between samples.
  • n (int) - the size of the transformed array (i.e. frequency domain, complex)
Returns: numpy.ndarray
the frequency associated with each element in a Fourier Transform

lowpass_sym_butterworth(d, cutoff_freq, order=4)

source code 

A time-symmetric filter with a magnitude response that is the same as the Butterworth filter. Cutoff freq is measured in cycles per point.

lowpass_sym_Gaussian(d, cutoff_freq)

source code 

A time-symmetric filter with a Gaussian impulse response. Cutoff freq is measured in cycles per point.

lowpass_sym_gaussian(d, cutoff_freq)

source code 

A time-symmetric filter with a Gaussian impulse response. Cutoff freq is measured in cycles per point.

hipass_sym_butterworth(d, cutoff_freq, order=4)

source code 

A time-symmetric filter with a magnitude response that is the same as the Butterworth filter. Cutoff freq is measured in cycles per point.