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

[feature request] option to visualize on logarithmic scale #15

Open
josephdong1000 opened this issue Apr 8, 2022 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@josephdong1000
Copy link

josephdong1000 commented Apr 8, 2022

It'd also be cool to have a toggle/setting that flips between logarithmic and linear axis scales, since right now I think the low frequencies are being squished together.

For reference, here's what an audio spectrum with a logarithmic scale looks like:
image
, versus a linear scale like
image

, which is what the visualizer looks like right now.

@noriah noriah added the enhancement New feature or request label Apr 9, 2022
@noriah
Copy link
Owner

noriah commented Apr 9, 2022

I actually want to look into this. I had originally tried to do something logarithmic, but I am not too well versed in the magic of audio analysis. I had done a logarithmic scale before, but the output was very sparse. I believe I need to fill out the missing bars with some smoothing algorithm that will follow the existing bars.

If you check out the code, it was supposed to be an attempt at some sort of non-linear distribution, but it ends up just being linear with a lot of wasted work.

This is definitely something I will be working on.

@josephdong1000
Copy link
Author

I think it should just be a matter of transforming the linear datapoints with a log function, but you would also have to decrease the spacing of samples for lower frequencies. I haven't taken a look at the code tho, and I don't really know how to program in go lol

Something I found that could help with the sampling frequency issue: https://stackoverflow.com/questions/32320028/convert-linear-audio-frequency-distribution-to-logarithmic-perceptual-distributi

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

No branches or pull requests

2 participants