Repository navigation
Open
Labels
Acoustic featureIssues related to the feature module, acoustic features and feature extractionENH: enhancementNew feature or request
Description
This is a meta issue to track thoughts about the API of the feature extraction module and related issues.
Thoughts:
- make it functional to the extent possible -- avoid classes, standard scientific Python
- provide named feature sets; we can provide these through functions, e.g.
vocalpy.features.sat.similarity_featuresorvocalpy.features.warbleR.spectro_analysis - but at some point we're going to have re-duplication of features
- which is where it might make sense to use classes to represent named sets of features; we'd have a "functional" module that's the implementation of the features, then
- we might need to find a way to distinguish between frame-level features and segment-level features
- SAT-style analyses basically extract each acoustic parameter per-frame
- but I think warbleR takes a Raven selection table and then extracts scalar parameters per segment?
- Or looking at it more, maybe warbleR is just taking whatever seewave gives them. More generally, I think it might be useful to have the ability to do both frame-level and segment-level feature extraction, with some way to specify how you do the reduction--I'm thinking of the pytorch
reductionargument, but it could also be a callable so you sayreduction=my_reduce_funcand get e.g. the pitch at 20 ms or whatever you want
- nice to have: follow logic of librosa API: accept either audio (
y, in our caseAudio) or spectral representation (S, in our case aSpectrogram), and if audio then apply appropriate spectral transforms to get whatever representation we need to extract the features
Related issues, to fix for closing this one
Metadata
Metadata
Assignees
Labels
Acoustic featureIssues related to the feature module, acoustic features and feature extractionENH: enhancementNew feature or request
Activity
ralphpeterson commentedon Jan 3, 2024
Chiming in here to document some discussion points David and I had over email.
1.) The general sentiment I get from folks is that warbleR has the most "complete" feature set out there, so a port over to vocalpy would be great. A few recent cool papers use the library (Rivera et al. 2023, Jourjine et al. 2023).
2a.) Re: frame vs. segment. I typically compute features in librosa using frames, then take the mean or median of all frames downstream of that. In an ideal world, I think that the user would be able to toggle between the two, perhaps by indicating "frames" or "segment" as a function argument.
2b.) I really like the simplicity of dropping in raw audio as input to feature functions in librosa — not sure if that's how the feature functions work in vocalpy, but I agree with your suggestion that using a similar logic to librosa would be a nice to have.
NickleDave commentedon Jan 4, 2024
Thank you @ralphpeterson, really appreciate the input.
I can think of plenty of more than a few other papers that use the warbleR features too -- being able to access these features all in one place from Python would really help
For 2a and 2b, I need to experiment a little to figure out what the API will look like.
I also need to discuss a little with @yardencsGitHub but I have a feeling we will need to be extracting features for other things we're working on, so I am bumping this up the to-do list