Skip to content

Commit

Permalink
add amplitude peak, mean, median to extracted values
Browse files Browse the repository at this point in the history
  • Loading branch information
LoannPeurey committed Jun 4, 2024
1 parent f20a097 commit 8c72ae8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ChildProject/pipelines/derivations.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ def get_pitch(audio_time_series, sampling_rate, func=None):

pitch_type = "f0" if not callable(func) else func.__name__

amplitude_abs = np.abs(audio_time_series)

return {"raw_pitch_{}".format(pitch_type): f0,
"mean_pitch_{}".format(pitch_type): mean_pitch,
"median_pitch_{}".format(pitch_type): median_pitch,
"p5_pitch_{}".format(pitch_type): p5_pitch,
"p95_pitch_{}".format(pitch_type): p95_pitch,
"pitch_range_{}".format(pitch_type): p95_pitch - p5_pitch}
"pitch_range_{}".format(pitch_type): p95_pitch - p5_pitch,
"mean_amplitude": amplitude_abs.mean(),
"peak_amplitude": amplitude_abs.max(),
"median_amplitude": np.median(amplitude_abs),
}

def acoustics(project,
metadata: dict,
Expand Down

0 comments on commit 8c72ae8

Please sign in to comment.