performance
performance
- pyampact.performance.calculate_vibrato(note_vals, sr)[source]
Calculate the vibrato depth and rate from a note’s frequency signal.
- Parameters:
note_vals (np.ndarray) – The time-domain signal values of the note, typically a 1D array representing the amplitude of the sound wave over time.
sr (int) – The sampling rate of the signal in Hertz (samples per second).
- Returns:
vibrato_depth (float) – The depth of the vibrato, calculated as twice the amplitude of the dominant frequency component.
vibrato_rate (float) – The rate of the vibrato, in Hertz (Hz), derived from the position of the dominant frequency in the Fast Fourier Transform (FFT).
- pyampact.performance.estimate_perceptual_parameters(f0_vals, pwr_vals, M, SR, hop, gt_flag)[source]
Estimates a range of performance parameters from the inputted fundamental frequency (f0_vales), power (pwr_vals), and spectrum estimates (M)
- Parameters:
f0_vals (np.ndarray) – A vector of fundamental frequency estimates.
pwr_vals (np.ndarray) – A vector of power values corresponding to the fundamental frequency estimates.
M (np.ndarray) – The spectral estimates from which the perceptual parameters will be derived.
SR (float) – The sample rate used to generate the fundamental frequency estimates.
hop (float) – The hop size used in the analysis, expressed in seconds.
gt_flag (bool) – A flag indicating whether to use ground truth information for the estimation.
- Returns:
pp1 (float) – The perceived pitch calculated using the entire vector of f0 estimates.
pp2 (float) – The perceived pitch calculated using the central 80% of f0 estimates.
- pyampact.performance.perceived_pitch(f0s, sr, gamma=100000)[source]
Calculate the perceived pitch of a note based on Gockel, H., B.J.C. Moore,and R.P. Carlyon. 2001. Influence of rate of change of frequency on the overall pitch of frequency-modulated Tones. Journal of the Acoustical Society of America. 109(2):701?12.
- Parameters:
f0s (np.ndarray) – Vector of fundamental frequency estimates, typically a 1D array representing frequency values over time.
sr (int) – The sampling rate of the f0 estimates in Hertz (Hz).
gamma (float, optional) – A parameter that sets the relative weighting of quickly changing versus slowly changing portions of notes. A high gamma value (e.g., 1000000) gives more weight to slowly changing portions. Default is 100000.
- Returns:
pp1 (float) – The perceived pitch using the entire vector of f0 estimates.
pp2 (float) – The perceived pitch using the central 80% of f0 estimates.