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

BandStopFilter is not useful for environmental sounds at high sample rates #159

Open
mariusfaiss opened this issue Nov 1, 2022 · 1 comment

Comments

@mariusfaiss
Copy link

I am working with environmental recordings of insect sounds at 44.1 kHz that have little frequency content below 2.5 kHz and go up into the ultrasonic range. For my use-case, I would like to apply filters evenly over the entire spectrum without the center frequency affecting the filter bandwidth. If I set the upper and lower bandwidth limits to the same value, the resulting filters should be the same width, regardless of where their center frequencies are. BandStopFilter does not allow for this (as far as I can tell) and also produces errors in self._lowpasses when generating filters at higher center frequencies (ValueError: A cutoff above 0.5 does not make sense). It also seems like filters are more likely to be generated in lower frequency ranges than higher ones.

It would be nice if filter bandwidth could be decoupled from the center frequency, e.g. randomized between an upper and lower bandwidth in Hertz. And if center frequencies could be generated evenly over the entire spectrum. These could be implemented as options since it seems like the current functionality is more aimed towards use with human-centric sounds, perhaps on a mel-frequency scale. But having the option to evenly affect larger spectra would allow use with non-human and environmental sounds.

@iver56
Copy link
Collaborator

iver56 commented Nov 1, 2022

Thanks for the feedback, Marius 👍 This looks useful, but I cannot make any promises about when such options can/will be added. For now, I think your best option is to make a fork (or copy code) and shape it to your needs (for example sampling linearly instead of in mel space)

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

No branches or pull requests

2 participants