-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Linear display of Spectrum analyzer seems to show too small values #5089
Comments
Hi, I wasn't able to make much sense out of all the articles talking about decibels in relation to audio. Some simply care only about voltage / signal amplitude and use the amplitude ratio (twice as much is 6 dB), others talk about it in relation to driving some audio output where the end result depends on the power delivered to speakers and therefore use the power ratio, and yet others argue that it does not matter, because human hearing treats sound pressure levels more along the lines of "twice as much is 10 dB"... I wasn't able to find three sources that would be comprehensible and agree with the other two. So I basically gave up, picked one way that seemed reasonable (and useful in terms of grid resolution), and used that. If there is a good reason to change it -- why not, it probably doesn't make that much difference. |
Hi @he29-net, I have to admit that I am also still a bit confused with regards to which type of conversion (10 vs. 20) should be used in which (practical) situation. 😄 My theoretical understanding so far is that you can use the conversion with a factor of 20 whenever you compute with values that are squared during the computation. So if you have something that computes as I have just gathered an overview of how some other analyzers behave. To do so I have used Audacity to create a sine signal at 440 Hz with peak values of 1 and -1 and checked how this signal displays in various signal analyzers (most of them in their default state except for SPAN where I have set the slope to 0). Here are the results:
Using a 20 conversion for the linear scale might be a bit more practical as it makes more use of the available space. With the 10 conversion the users would mostly set a rather flat spectrum. Great work on the new analyzer by the way! 👍 |
Using The only thing we can change is, essentially, whether "twice as much" is defined as 3 dB or as 6 dB. Or, in other words, whether the Y axis labels on Audible range go from 10 to -50 or from 20 to -100. The displayed spectrum itself should remain exactly the same (after the ranges are adjusted), it's only the logarithmic labels that will be affected. |
I feel like 10 to -50 is much more common in other audio applications that 20 to -100. Perhaps a "zoom"/"scale" feature would be useful for the linear mode? |
Well, there already is a zoom / scale feature, it's the range selector. The problem is just that the ranges are optimized for the logarithmic display, which will be used most of the time. I could add a new range with -3 dB upper bound, so the linear scale would go from 0.5 to 0, making everything twice as big. But then there would be a new range, say -3 to -50 dB, when there already is a 0 to -50 dB range -- most users not using linear scale would be probably confused as for why is it there. Or there could be a different set of ranges for linear and logarithmic scales, which would be even worse -- when I switch ling / log, I expect the displayed content to be consistent with what I saw before, not to jump around on its own accord. To make the linear scale more useful, I'm thinking of moving the upper bound of Noise range from -20 dB to -10 dB, which would make it (0.1 to 0) in the linear space, instead of current (0.01 to 0). That is, values would appear 10 times bigger compared to the default. At the same time, I would probably rename it to Silent, to be consistent with the new name for current Default. But at the end of the day, using any linear range, most of the values will probably still be either too small or grow outside of the graph. It is just the nature of the linear scale -- the fact it is hard to read is why it is almost never used. |
Also, to explain why I went with a fixed set of ranges instead of a slider or a knob -- simply to make everything more consistent. When you switch to a range you already used for a while, you immediately know what to expect, you don't even have to look at the Y scale most of the time. If you load 10 projects in sequence and the range of each is set to two different arbitrary points, you have no clear frame of reference. Each time, you need to examine the Y axis and figure out what would you expect to see for such a range. |
Personally I'd have the slider over the dropdown menus. If you want to keep the menus, why not have a different set of ranges when the display is in linear mode (i.e. "Extended" covers a different range in linear vs logarithmic, etc) |
You could always have both, right? So you could select preset ranges via
combobox for comparative purposes, but also adjust the range when desired.
Alternatively if the ranges could be set via keyboard input, you could
simply manually set the same range in both analyzers when doing comparisons.
…On Thu, Jul 25, 2019, 17:55 Noah Brecht ***@***.***> wrote:
Personally I'd have the slider over the dropdown menus. If you want to
keep the menus, why not have a different set of ranges when the display is
in linear mode (i.e. "Extended" covers a different range in linear vs
logarithmic, etc)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5089?email_source=notifications&email_token=ACEBLGWPBHLYR63MKIC56M3QBHEFTA5CNFSM4IF3VF62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2Z5DMI#issuecomment-515101105>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACEBLGTLZ5QQYFJW6MK7VT3QBHEFTANCNFSM4IF3VF6Q>
.
|
I therefore propose to drop the option of the linear scale completely. I guess it's just there because the previous implementation of the analyzer had it and I assume that no one knows anymore why it had it. 😄 I have also checked the four analyzers mentioned above again and none of them has the option to switch to a linear scale. The linear scale is not helpful because it does not match the sensitivity of the human ear. A linear drop in the logarithmic scale, e.g. from -6 to -12 dB, corresponds to an exponential drop in the linear scale and this is the reason why the graph quickly vanishes and you cannot see anything anymore. |
That's a good point, that could work quite well. Although it also leads to another problem -- where to put the sliders or knobs? The controls section is already quite crowded and it will take even more space for "advanced settings" button in a future upgrade.. There is some space between the combo boxes, compared to the "LED switches" on the left, which are already squished harder than intended by their design. With just a little bit of extra space, a simple line-like slider thingy could fit under each combo box, and have two points corresponding to the minimum and maximum. I quite like that idea, but it will probably require a custom control widget, so it's definitely not a quick fix.
I don't see a good reason for dropping it. The indicator icon will stay there anyway, even if only to be consistent with the X axis -- and I can already see the bug reports coming, saying that the "linear Y switch does not work". The linear scale may be not useful for mixing, but it may still find some use for technical reasons or for education. |
The reasons that in my opinion would favour dropping the linear scale are:
If the GUI does not indicate that it's possible to switch to a linear scale then there shouldn't be any bug reports. If we keep it then there might also be bug reports like "I cannot see the high frequencies when the linear scale is active." And I also already ran into the problem that I thought that the linear scale is broken because all I saw was a black screen because the scale was set too high." However, I think you are already aware of that problem (#5090). I also don't see any big educational value and removing it would be somewhat along the line of the KISS principle. |
@michaelgregorius If you think removing the linear scale option contributes to KISS, we may as well remove all the switches and settings above and just force the user to use "the one true chosen configuration". :)) It may be not helpful for mixing, but you can still use it to check whether your signal is clipping (since you can be sure linear 1.0 is always the limit; with dB scale, you do not know for certain what the author used as reference) and to figure out which dB conversion is used ( Also, you can use it for a quick log<-> linear conversion -- just set a cursor location and switch linear / log. And there may be other use cases I'm not currently aware of -- why should we limit what the user can and cannot do? Seeing that the signal looks really small on linear scale is by itself an educational experience, it tells you without words why is the dB scale used in the first place. People may wonder "why I don't see high frequencies", but that should result in Google searches, not in bug reports -- when I push a button and nothing obvious happens, I assume I don't know what exactly the button does, not that it does not work. |
So, while I was looking around before opening a new issue regarding various units and ranges constants (probably tomorrow), I noticed that while the linear scale matches the selected dB units, it does not work quite in the way as I originally intended. Specifically, sine wave that goes from -1.0 to 1.0 is nearly clipping, so it should measure as being at 0 dBFS or 1.0 linear. But it is half the size (-3 dB log., 0.5 linear). So in a way, the title of this issue is still valid, it would probably make more sense having everything doubled. The issue is not in the dB conversion formula, but probably in the interpretation of FFTW results or in normalization. I actually never realized that units called dBFS are a thing, and that it is what LMMS uses. Having a name for the "1.0 reference" certainly helps to clear some of my "dB confusion". :) So, in the next Analyzer update, I will change it so that -1.0 to 1.0 sine wave measures 0 dB, since it makes more sense and matches most spectrum analyzers tested by @michaelgregorius earlier in this thread. That's in addition to the change in the upper limit of the Audible scale, so after that, the linear values should be reasonably visible at all ranges except Extended (which is just ridiculously large, it should be probably renamed to Placebo). |
This issue was fixed (or improved, since values looking small in linear scale is just property of the scale that can't be "fixed") in #5160. The linear scale had a small problem (now fixed) that essentially caused the values to be 50 % of what they were intended to be, so the update should improve the visibility a bit. |
Does that mean this can be closed now? |
Probably. I did not suggest either way as I expected @michaelgregorius to comment on whether the solution / updated version is satisfactory or not. |
How to reproduce:
The linear display seems to show too small values compared to the logarithmic display. Here's an example.
Logarithmic display:

Linear display:

The logarithmic display has its peak at -9 dB but the linear display only at around 0.12. Assuming the the conversion from linear
lin
to logarithmicdb
isdb = 20*log(lin)
then for a value of -9 dB we should get a value of around 0.35 becauselin = 10^(db/20)
. For the specific example this means thatlin = 10^(-9/20) = 10^(-0.45)
.The text was updated successfully, but these errors were encountered: