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

Some sort of sloping? #3

Open
mx opened this issue Dec 27, 2022 · 2 comments
Open

Some sort of sloping? #3

mx opened this issue Dec 27, 2022 · 2 comments

Comments

@mx
Copy link

mx commented Dec 27, 2022

Apologies if this is a dumb question. Is there some sort of sloping applied with this spectrum analyzer? Or is it an inherent property of the Constant Q Transform? Or perhaps I'm just holding it wrong, as it were?

To test the analyzer, I ran a white noise source through it. I saw a pretty distinct dB slope downwards from the highest octave to the lowest octave. I found that pretty puzzling, because white noise ought to have a constant magnitude over time rather than a slope. I confirmed that the noise source was white using two other spectrum analyzers (just FFT based, not CQT). I looked through the source code and couldn't find at first glance anything that would be responsible for this sloping. Am I just "holding it wrong" as they say, possibly not understanding the full properties of the CQT? Or is this an issue with cqt-analyzer?

@mx
Copy link
Author

mx commented Dec 27, 2022

Looking at it with spaced sine waves, everything looks appropriately constant. The low frequencies do take much longer to appear and be stable/constant in the analyzer though. I wonder if it has something to do with the time resolution at the lower frequencies.

@jmerkt
Copy link
Owner

jmerkt commented Jan 5, 2023

Hello and thanks for the input!

The slope with white noise you are observing, to my knowledge, is a property of the Constant Q Transform (CQT).
Looking at the CQT as a collection of logarithmic spaced band-passes, the bandwidth of the these filters increases with frequency. Hence, with rising frequency, they integrate over a bigger absolute frequency range, creating the observed slope.
With sine tones, it behaves differently, because these only contain one distinct frequency and don't sum with increasing bandwidth.

The FFT has a constant bandwidth across all frequency bins and therefore doesn't show the slope.

Future versions of the plugin could contain a parameter to actually apply a slope and observe equal power for white noise, but then its a trade-off observing single sine tones with equal magnitude independent of frequency. Maybe there is a clever way to handle this, but I have to think about it.

As you already guessed, the time resolution at low frequencies is lower, because we need a higher frequency resolution there and sadly can't have both at the same time.

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