Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power spectrum for spectral descriptors #1144

Open
jamesb93 opened this issue Jan 14, 2022 · 4 comments
Open

Power spectrum for spectral descriptors #1144

jamesb93 opened this issue Jan 14, 2022 · 4 comments
Labels

Comments

@jamesb93
Copy link
Contributor

Can we use the power spectrum for spectral "shape" descriptors such as centroid, flatness etc? I think this would be really useful in tuning how perceptually relevant the outputs of the algos are and in our research (https://flucoma.org) we've found it has a really strong bearing on whether or not the values map onto the sound. I would be happy to do a PR if the maintainers think this would be a good addition.

@hughrawlinson
Copy link
Member

I think this would be a good addition. I'm not sure how best to go about it. I'm not worried about a breaking change, as we're working on a new interface anyway in #931 and we can just include it as part of that. But, that's a big chunk of work and I wouldn't want to block this on that. What are your thoughts on how you would expect this functionality to be surfaced to you as a user?

@jamesb93
Copy link
Contributor Author

In another lifetime I might imagine an interface whereby you supply the ampSectrum or powerSpectrum as inputs but I think it would make more sense to pass a Map() of parameters:

const params = new Map(
    ['power' : true]
)

or something comparabale like a straight up JSON object. I've actually been using entirely the OOTB defaults for all Meyda stuff, apart from wiggling the buffer size to get lower minimum frequencies and such, so I'm not too versed in how you actually pass parameters as it stands now.

@hughrawlinson
Copy link
Member

Cool. I'll consider that for the new interface. If you would like to use these soon (I think that interface won't be ready for at least a few months), one thing you could do is to open a PR duplicating the existing feature extractors, naming them with a powerSpectrum prefix, like powerSpectrumCentroid, and have them use the power spectrum rather than the amplitude spectrum. I could release that as a minor version increment, and you'd be able to use it. How would you feel about doing a PR for something like that?

@jamesb93
Copy link
Contributor Author

I personally need the PR so I'd be happy to supply it! Give me this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants