Spectrogram - how to make it the default view upon opening?

This read-only archive contains discussions from the Adding Feature forum.
New feature request may be posted to the Adding Feature forum.
Technical support is available via the Help forum.
steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Spectrogram - how to make it the default view upon openi

Post by steve » Sat Jan 30, 2016 6:41 pm

Worez wrote: So if I convert CD-Audio track to MP3 160 kbps, then that file will have the cut-off line at around 16.5 hHz only in theory, because something may leak above it?

But Wikipedia entry on the MP3 format says that:
Because of the Nyquist–Shannon sampling theorem, frequency reproduction is always strictly less than half of the sampling frequency, and imperfect filters requires a larger margin for error (noise level versus sharpness of filter), so 8 kHz sampling rate limits the maximum frequency to 4 kHz, while 48 kHz maximum sampling rate limits an MP3 to 24 kHz sound reproduction.
[https://en.wikipedia.org/wiki/MP3#Bit_rate]

As I understand it, that article claims that it should be always even a little below 16.5 [and there is no something like leakeage above]
"Sample Rate" and "Bit Rate" are different things.

MP3s are usually described in terms of "bit rate". This is the number (or average number) of binary digits per second of audio. Because MP3 is a compressed format, this figure does not directly affect the available frequency range. However, standard encoder settings do limit the frequency response more for low bit rates than for high bit rates. Limiting the frequency range is one way that MP3 encoding can reduce the amount of data required to encode the audio. Rather than "wasting" bits encoding very high frequencies that are barely audible, MP3 encoding filters out very high frequencies (throws them away). The table here shows the recommended low-pass filter settings for the LAME encoding library: http://wiki.hydrogenaud.io/index.php?ti ... nformation Note that these are only the "recommended" settings - LAME provides options to customise the low-pass filtering.

"Sample Rate" refers to the uncompressed audio data. It is the number of "samples" per second for each audio channel. If you zoom in as far as possible on a waveform in Audacity, you will see dots that represent the individual audio samples. The "Nyquist" frequency relates to the sample rate. For any given sample rate, the absolute frequency limit is half the sample rate.

You could have two copies of the same audio, both with a "sample rate" of 44100 Hz, but compressed to MP3 with different "bit rates". The absolute frequency limit due to the sample rate is 22050 Hz (the Nyquist frequency), but the frequency range is limited further due to filtering by the MP3 encoder. Lower "bit rates" tend to be filtered more severely than high bit rates. Thus in Audacity you will see the upper frequency limit as 22050 Hz (the Nyquist frequency, which is an absolute limit), and you will also see that the sound intensity drops to virtually nothing at some frequency below the Nyquist frequency (about 16500 Hz in your example). This lower limit is due to the MP3 encoder low-pass filtering. It is this second "limit" that Audacity cannot predict.

is that any clearer?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Worez
Posts: 48
Joined: Thu Jan 28, 2016 11:57 pm
Operating System: Windows 7

Re: Spectrogram - how to make it the default view upon openi

Post by Worez » Sun Jan 31, 2016 5:14 pm

steve wrote: [...]
The table here shows the recommended low-pass filter settings for the LAME encoding library: http://wiki.hydrogenaud.io/index.php?ti ... nformation Note that these are only the "recommended" settings - LAME provides options to customise the low-pass filtering.
[...]
This will be off-topic

Should I change my RazorLame settings from
--alt-preset extreme
to
--alt-preset insane
to preserve as much information as possible [if for some reason I'm using MP3 and not FLAC]?


And now back to the topic:
steve wrote: You could have two copies of the same audio, both with a "sample rate" of 44100 Hz, but compressed to MP3 with different "bit rates". The absolute frequency limit due to the sample rate is 22050 Hz (the Nyquist frequency), but the frequency range is limited further due to filtering by the MP3 encoder. Lower "bit rates" tend to be filtered more severely than high bit rates. Thus in Audacity you will see the upper frequency limit as 22050 Hz (the Nyquist frequency, which is an absolute limit), and you will also see that the sound intensity drops to virtually nothing at some frequency below the Nyquist frequency (about 16500 Hz in your example). This lower limit is due to the MP3 encoder low-pass filtering. It is this second "limit" that Audacity cannot predict.

is that any clearer?
Yes, thank you very much

This tells me clearly, that in no way evaluation of MP3 could be done automatically based on the spectrogram; at least [with today's computing power] in a matter of seconds per one file

So if when listening to my music I think I hear some low quality MP3 and want to check it out, I will have to use [any] spectrogram with more looking / thinking than just a simple glance; especiall in those cases where there is no sudden and clear cut-off line [indicating the usage of low pass filter]. And only after taking a time to visually analyze the spectro I will be reasonably able to decide if a loss between for example figured out 16.5 kHz and possible 20-22 kHz is wort the effort to once again acquire the same track [this time as MP3 320 or even as FLAC if possible]



As for that computing power: can I somehow make the Audacity's spectrogram more accurate, by changing some settings. I can imagine that in 2-4 years I will have faster hardware and will be able to squize out more of it. I'm referring here to what was said here earlier:
Gale Andrews wrote: [...]
to meet that request do I assume Audacity would have to do what amounts to a behind-the-scenes Plot Spectrum analysis before it could display the spectrogram?

If so I think Worez would find the delay unacceptable. Plot Spectrum is limited to just over 10 million samples and even that takes a couple of seconds to display (using a HDD).

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Spectrogram - how to make it the default view upon openi

Post by Gale Andrews » Sun Jan 31, 2016 5:38 pm

Worez wrote:
steve wrote: [...]
The table here shows the recommended low-pass filter settings for the LAME encoding library: http://wiki.hydrogenaud.io/index.php?ti ... nformation Note that these are only the "recommended" settings - LAME provides options to customise the low-pass filtering.
[...]
This will be off-topic

Should I change my RazorLame settings from
--alt-preset extreme
to
--alt-preset insane
to preserve as much information as possible [if for some reason I'm using MP3 and not FLAC]?
If I recall correctly even the RazorLame front end supports command-line arguments so if necessary you would specify the lowpass and highpass options as per http://lame.cvs.sourceforge.net/viewvc/lame/lame/USAGE.
Worez wrote:can I somehow make the Audacity's spectrogram more accurate, by changing some settings.
As far as I know the settings are what you see (there are no settings you can add to audacity.cfg that are not already exposed in Preferences).

Larger window sizes will give you more low frequency resolution. They will give less temporal resolution and be slower to draw.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Worez
Posts: 48
Joined: Thu Jan 28, 2016 11:57 pm
Operating System: Windows 7

Re: Spectrogram - how to make it the default view upon openi

Post by Worez » Sun Jan 31, 2016 6:31 pm

Worez wrote: This will be off-topic

Should I change my RazorLame settings from
--alt-preset extreme
to
--alt-preset insane
to preserve as much information as possible [if for some reason I'm using MP3 and not FLAC]?
Gale Andrews wrote: If I recall correctly even the RazorLame front end supports command-line arguments so if necessary you would specify the lowpass and highpass options as per http://lame.cvs.sourceforge.net/viewvc/lame/lame/USAGE.

A have that "extreme" setting because of some discussion that took place something like 13-14 years ago on some audio user group. Back then I knew nothing back then about took great care in writing down what and how should I set in RazorLame. And it was established that one should just put "--alt-preset extreme" and check the "only use custom options"; which blocks out all other settings, including the highpass and lowpass filtering frequency. Since then only 2 or 3 times was brought to my attention the existence of this "insane" option

johny46
Posts: 2
Joined: Sat Feb 20, 2016 8:53 am
Operating System: Windows 7

Re: Spectrogram - how to make it the default view upon openi

Post by johny46 » Sat Feb 20, 2016 9:03 am

Worez wrote:G] turn off "save changes before closing" question, when there were no changes done
You could disable this warning altogether (that is, regardless of whether you've made any changes) using the AutoIt or Autohotkey scripting languages (both of which are completely free to use).
The basic idea would be to have a main loop that would wait until the dialog asking for confirmation is created and then automatically click the "No" button.

Worez
Posts: 48
Joined: Thu Jan 28, 2016 11:57 pm
Operating System: Windows 7

Re: Spectrogram - how to make it the default view upon openi

Post by Worez » Sat Mar 05, 2016 12:09 pm

johny46 wrote:
Worez wrote:G] turn off "save changes before closing" question, when there were no changes done
You could disable this warning altogether (that is, regardless of whether you've made any changes) using the AutoIt or Autohotkey scripting languages (both of which are completely free to use).
The basic idea would be to have a main loop that would wait until the dialog asking for confirmation is created and then automatically click the "No" button.
Unfortunately I have no knowledge about scripting. The last thing of that kind I wrote was on Atari. "GO TO 10" is all I remember after almost 30 years

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Spectrogram - how to make it the default view upon openi

Post by Gale Andrews » Sat Mar 05, 2016 1:00 pm

Worez wrote:
johny46 wrote:
Worez wrote:G] turn off "save changes before closing" question, when there were no changes done
You could disable this warning altogether (that is, regardless of whether you've made any changes) using the AutoIt or Autohotkey scripting languages (both of which are completely free to use).
The basic idea would be to have a main loop that would wait until the dialog asking for confirmation is created and then automatically click the "No" button.
Unfortunately I have no knowledge about scripting. The last thing of that kind I wrote was on Atari. "GO TO 10" is all I remember after almost 30 years
AutoHotKey has an active Ask For Help forum.

If you cannot work out how to tell AutoHotKey to wait for the "Save Changes?" dialogue and then click "No", ask there.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

waxcylinder
Forum Staff
Posts: 14684
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Spectrogram - how to make it the default view upon openi

Post by waxcylinder » Sat Apr 30, 2016 2:44 pm

Gale Andrews wrote:This looks most like a "Feature Request" now, so moved there.
I'm struggling to see what the Feature Request is, Gale :?

Peter
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Spectrogram - how to make it the default view upon openi

Post by Gale Andrews » Sat Apr 30, 2016 6:22 pm

waxcylinder wrote:
Gale Andrews wrote:This looks most like a "Feature Request" now, so moved there.
I'm struggling to see what the Feature Request is, Gale :?
The simple request that could be done easily would be a spectrogram "Maximum" setting that is % of the Nyquist frequency. So if the OP set that to 70%, then for a high bit rate MP3 at 44100 Hz (s)he would get the vertical scale such that it did not show empty space at the top where the MP3 encoding had removed the high frequencies.

The other request is for Audacity to fit the maximum of the vertical scale according to the maximum frequency that is in the actual audio. Though probably not "hard" to do, the hard part would be that users would have a long delay while Audacity scanned the entire audio to figure out what the the maximum frequency was.

I have captured these two ideas. So I think you can archive this now.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Spectrogram - how to make it the default view upon openi

Post by steve » Sat Apr 30, 2016 11:45 pm

Gale Andrews wrote:The other request is for Audacity to fit the maximum of the vertical scale according to the maximum frequency that is in the actual audio.
Technically, what does "actual audio" mean?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Locked