Enhancements to Frequency Analysis

1:
It’s very convenient (and cleaver, IMO) that the Cursor & Coordinate readouts are still updated when a Label or even some application other than Audacity has focus. Another useful case would be when an effect’s UI has focus. I’m thinking in particular of Single Band Parametric EQ, which I use often to identify the offending spectral line among a pincushion of spikes. Is it feasible to keep the Cursor & Coordinate updating active while an effect is selected? It would suffice to be able to switch focus between the effect’s UI and the Spectrum plot without closing the effect, since this would eliminate the need to keep re-selecting the effect from the menu.

2:
An option to set the bottom of the plot lower than -90 dB. Occasionally I can hear a frequency in the background but it doesn’t show up in the Spectrum plot. I change the window, lower the resolution and fiddle with the display size on the screen to try to get the line to show up, but it never does. Today it was 480 Hz (I check power line harmonics first). Another time it was a familiar sound (modulated) and I knew where it was coming from, but the source can vary from 1063-1097 Hz. It’s definitely not because I have “golden ears” (golden aged, maybe, but the tinnitus is unmodulated). Someone else requested weighting options for the Spectrum display. That might also be useful in these cases, since frequencies to which I’m less sensitive are quite prominent in the Spectrum plot.

I am not a Plot Spectrum expert, but I don’t know how to update it except by using the Replot button. And the data is not even changed until you run the effect. Are you asking for real-time effects and analysis? If so that’s work we don’t have the resources for at the moment, and not all the developers would see it as a good return on time spent.

This is currently done by reducing the “Meter/Waveform dB range” in the Interface Preferences. The Manual did not say this but I now added it.


Gale

That’s for Spectrum mode in the Track display. I’m posting about Analyze->Plot Spectrum.

No, I’m not asking for real-time display of effect preview or anything like that. I do use Replot occasionally when tweaking an effect’s parameter settings, along with undo. When I have what I want, I undo the effect, expand the region and use Ctrl-R to apply the effect as tweaked to the whole intended region.

What I’m asking for is to have the numerical cursor coordinate displays responsive to the mouse cursor in the Plot window while an effect’s GUI is open on the screen. I use Single Band Parametric much as one might use the Channel EQ on a mixing desk to “tune in” the offending frequency with boost, then cut it once I’ve precisely located it. In Audacity, I generally do the cutting with Notch if it’s a single frequency. Being able to switch the focus between the Effect and Plot windows without closing the Effect would substantially expedite using Single Band Parametric to identify which spectral line I need to attenuate. I could move the cursor in the Plot window to the next suspect peak, read the frequency and try it in S.B.P. without having to reopen S.B.P. from the Effects Menu.

I was aware what you were talking about, which was why I said “I am not a Plot Spectrum expert”.

“Meter/Waveform dB range” has no effect whatsoever on the Spectrogram displays accessed in the Track Drop-Down Menu. It does affect the Waveform (dB) display accessed in the same way. If you reduce the Meter/Waveform dB range below the default of -60 dB,then you should be able to see lower amplitudes in Plot Spectrum (than you would otherwise). See http://manual.audacityteam.org/man/Interface_Preferences#Display .

That obviously cannot be done as now, because the effect dialogues are modal, so block off access to the other windows. The effect dialogues are modal because we do not have real-time effects.

I would suggest capturing an image of the Plot Spectrum window which would let you zoom it in an image editor.

You could also ask for the Export feature of Plot Spectrum to be improved so that it identified the peaks at whatever setting you had at time of export.



Gale

Sometimes changing the “Size” parameter can make spikes show up that otherwise don’t.
If you normally work with a very large size parameter, try dropping it down to say 1024 or 2048.

That’s what I meant by “lowering the resolution”. Switching to the Blackman-Harris window also broadens the peaks so more of them show up in pixel columns. On my Vista machine, I can adjust the horizontal size of the plot window and it’s refreshed as I’m dragging the edge. On my XP laptop it doesn’t refresh until I release the mouse button. Peaks that show up in a single pixel column vary in height, sometimes from oblivion to -85 or so. There’s room for improvement here IMO - a peak completely between pixel columns should show up in the adjacent columns. Maybe this is a Windows issue that would be a real headache to work around.

Sorry, I’d completely missed the point you were making there.

I noticed a quirk in the Spectrogram display. The plot and the scale are out of alignment until you expand the scale.

Test:
1-Generate 10s 1kHz sine 0.1 amplitude.
2-Select Spectrogram (lin or log, doesn’t matter) in the TCP. The line shows up around 350 Hz!
3-Expand the vertical scale (click in the scale). The line jumps to 1000 Hz.

I tried this on both XP and Vista, same result.

What settings do you have in “Edit > Preferences > Spectrograms”
Is this with Audacity 2.0.0?

Yes, running Audacity 2.0.0 on both machines.

On Vista machine:

Window Size = 2048
Window Type = Hanning

Min Frequency: 0
Max Frequency: 8000
Gain: 20
Range: 80
Frequency gain: 0

Show using grayscale is Unchecked.

On the XP laptop, I was experimenting and had Window Size set to max. It’s normally 512 so the poor ole CPU can keep up with r/t. This setting didn’t affect issue here. I also changed Gain and Range, not sure how I left them. Frequency gain is kind of a mystery to me. If it’s anything but 0 the low frequencies disappear.

OK, I can reproduce the problem with “Spectrogram (log f)”
I can’t reproduce the problem with the linear version of Spectrogram.




With most “normal” audio, very high frequencies tend to be lower amplitude than lower frequencies.
This setting makes the spectrum more sensitive to high frequencies.
Example, pink noise decreases in amplitude at a rate of 10 dB per decade (3 dB/octave).
If you look at the linear Spectrogram for low level pink noise (say 0.05 amplitude) you will see the Spectrogram is much more red at the bottom.
Change the frequency gain to 10 dB per decade and the Spectrogram will be a more even colour.

Not everyone finds it intuitive that the Meter/Waveform (dB) range affects the minimum Plot Spectrum amplitude. Would you like to vote for any of the Feature Requests about this:
Missing features - Audacity Support ?



Gale

This is a Windows setting. Refresh on drag also works for me on Ubuntu 12.04 or OS X 10.7.3 (default settings).

On XP, go to the Control Panel > Display Properties > Appearance > Effects: Show window contents while dragging.

On Vista / 7, go to the Control Panel > Advanced System Settings: Performance > Visual Effects: Show window contents while dragging.

Screenshots may help. Are those separate or the same issue? I see a spike on a grid line overlaying the line.

And is this an issue only when horizontal dragging? I see the displayed height of a spike changing when you horizontal drag - is it meant to? The cursor readout of the peak doesn’t usually change on drag in the case of a simple tone (even if the displayed height changes) but the peak readout does also change on drag with “complex” music.


Gale

I agree with Steve - On Win 7, Ubuntu 12.04 and OS X 10.7.3 I cannot reproduce the bug in linear Spectrogram, only in log f.



Gale

Thanks! :smiley: That helps a lot.

My mistake. :blush: Just tried it again on XP laptop and it only happens with log scale.

I think they’re separate issues. When I can hear 480 Hz but can’t see it on the plot even with “size” below 4096 and using the Blackman-Harris window, I don’t think the spike is hiding between pixel columns. That’s a problem mainly above 1 kHz although you can see the effects even at lower frequencies.

When I drag an edge (resizing the plot window), with a complex spectrogram the cursor stays in about the same place on the screen while the coordinate plane stretches/shrinks behind it, thus both frequency and amplitude readouts change. With a single tone, it only finds the one peak and so follows the plot at least for a little ways, but not very far. If you watch the “cursor” (rather than the “peak”) coordinates, you’ll see them changing even with a sinewave. I think the cursor should stay at a fixed frequency while the plot is being resized, but that’s not a major issue at least for me.

I opened a bug for it http://bugzilla.audacityteam.org/show_bug.cgi?id=525 . Thanks for reporting it.



I understand the amplitude of the plot will change when using different sizes. Steve may know more about whether horizontal drag should change the peak heights but I suppose yes. There does seem to be a problem with the displayed height of the thinnest peaks not matching the peak in the readout. This is very easily seen if horizontally dragging a tone because of the jumps in the displayed height of the peak are very obvious.

I can see that the cursor obliterates a thin spike when over it, which is not so bad if you can trust the readout (which I assume we can). Do you really think the peak should appear either side of the cursor when the cursor obliterates it? Are there better solutions?


Gale

I like these from the Plot Spectrum heading (I’m putting each in quotes, but not always copying everything):

“Zoomable/pannable frequency axis (4 votes)”

“More distinctive cursor line (2 votes) bolder, or different colour to grid lines”

“Multiple spectra window: (6 votes) Plot multiple spectra for different tracks/regions in the same project… Currently different spectra must be in different projects.”

“Text box input for lowest visible level (4 votes)”

(single-vote item):
“I like the display of the frequency at the cursor point as a musical pitch-class/octave. Could you add a cents qualifier to the musical pitch discription. For example if the cursor is located at 443 Hz, that would be the pitch A4, but slightly sharper, so it would be nice to have the cursor display for that frequency read: A4+12, since it would be 12 cents sharp of A4 in equal temperament at A4 = 440 Hz. If the frequency were 437, then the cursor display could read A4-12, which would stand for A4 minus 12 cents.”

[Other analytical/statistical ability]

[Spectrograms]

“Erase Tool to remove pieces of spectrum: (4 votes)
e.g. removing harmonics or ‘mouth noise’ from vocals (saliva clicks, …)”

I would add Use Case: Removing a brief sound with varying pitch (e.g., a baby’s cry).

“Crosshair as in Plot Spectrum (2 votes) which enables on-screen measurement of the frequency and dB level.”

There are several ideas on the page and linked pages that would be off-topic here which I’d like to vote for, and one I’d like to add onto. I read the instructions but can’t find the “edit” links. Is editing allowed by just anybody? Is there a wizard to help control the format?

-DickN

I wouldn’t want the spike to change shape when the cursor is over it. I’m accustomed to having it hide behind the cursor, but if the cursor were a different color (an improvement anyway since in a screen shot it looks just like a grid line) and had some transparency the spike and the cursor could be superimposed and both still be visible. (see my previous post - someone already requested “more distinctive cursor line”)

  • DickN

Thanks, DickN. I added your votes and comments.

I’ll have to give you a Wiki account if you would like to edit the page. Or you can PM me with what you want to vote for and append to.

Only the human ones that can sort out all the nested lists on that page.



Gale

I note that for frequencies above around 5 KHz (for 44,100 SPS), switching to Linear frequency axis somewhat ameliorates these effects.

  • DickN

I moved this here from the FR section

Peter.