Bug: default sample format ignored for imports

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: Bug: default sample format ignored for imports

Post by steve » Tue Sep 22, 2015 7:27 pm

Gale Andrews wrote:Don't all 32-bit float to 16-bit downconversions have the choice of adding harmonic distortion (if not dithered) or using dither?
Yes, downconverting has quantize errors which create harmonic distortion.
Any text book on audio production will say that dither should be applied once only, after all the processing is complete and the final mixdown has been made. What they don't say is what to do if the application insists on downconverting after every process - that's something that is just "not done".

There are certainly some cases where the harmonic distortion can be shown to get worse if dither is not applied each time, but I don't know if that is always the case. What I can say with certainty is that downconversions after each process will always reduce the sound quality and the deterioration is cumulative and irreversible.
Gale Andrews wrote:Of course one benefit of your scheme is that we don't need the incremental dither noise added with effect processing if we first upconvert 16-bit track data to 32-bit.
We don't actually need to "first upconvert". If we have integer format audio, then each sample is represented by a 16 (or 24) bit integer. When we process the audio, we apply mathematical calculations with 32-bit float precision. The result of this will always be floating point numbers (the new sample values). For example, if we multiply "integer 3" by "floating point 2.0", the result is "floating point 6.0".

THE benefit of my proposed scheme is that once the audio is imported / recorded, we never have to convert the format until we export. All other benefits derive from this.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: Bug: default sample format ignored for imports

Post by Gale Andrews » Tue Sep 22, 2015 9:08 pm

steve wrote:
Gale Andrews wrote:Of course one benefit of your scheme is that we don't need the incremental dither noise added with effect processing if we first upconvert 16-bit track data to 32-bit.
We don't actually need to "first upconvert". If we have integer format audio, then each sample is represented by a 16 (or 24) bit integer. When we process the audio, we apply mathematical calculations with 32-bit float precision. The result of this will always be floating point numbers (the new sample values). For example, if we multiply "integer 3" by "floating point 2.0", the result is "floating point 6.0".

THE benefit of my proposed scheme is that once the audio is imported / recorded, we never have to convert the format until we export. All other benefits derive from this.
OK, so the processing is doing the de facto upconversion, no? Because if in our example we were to show the sample format stored in track 1, then after Amplify, it would change from 16-bit to 32-bit.
Is that not "converting the format before export"?

If instead of amplifying, I was to explicitly convert the 16-bit data dragged into track 1 to 32-bit float using the track dropdown menu, are those calculations different (or even potentially lossy in fringe cases), compared to performing an Amplify of 0 dB?


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: Bug: default sample format ignored for imports

Post by steve » Tue Sep 22, 2015 10:25 pm

Gale Andrews wrote:OK, so the processing is doing the de facto upconversion, no?
Yes, but it is not a case of "first" convert "and then" process (2 steps). It is just "process", and "process" returns 32-bit float values (1 step)
What we do now for 16-bit tracks is: "first" process, "and then" convert to 16-bit (2 steps). That second steps is destructive (lossy) and imo totally unnecessary. It also requires a lot of extra code and associated risk of bugs.
Gale Andrews wrote:If instead of amplifying, I was to explicitly convert the 16-bit data dragged into track 1 to 32-bit float using the track dropdown menu, are those calculations different (or even potentially lossy in fringe cases), compared to performing an Amplify of 0 dB?
Converting from 16-bit to 32-bit float is totally lossless.It does however takes a certain amount of time and CPU cycles. The time taken to convert from 16-bit to 32-bit float using the track dropdown menu is about the same as amplifying (test on long tracks).

Converting from 32-bit float to 16-bit is slower and more CPU intensive if dithered (default). It is also lossy. On a slow machine with long tracks, the extra processing time could be very significant. Processing 16-bit tracks in my tests typically take two to three time longer to process than 32-bit float tracks.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: Bug: default sample format ignored for imports

Post by waxcylinder » Mon Jan 04, 2016 5:31 pm

OK so is ther a FR in here or even a bug in here? What do I do with this thread?

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

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

Re: Bug: default sample format ignored for imports

Post by steve » Mon Jan 04, 2016 9:43 pm

I think it needs a wiki proposal, though I don't feel very motivated to write one as it is not a "glamorous" proposal and it is extremely unlikely that it will ever get beyond the proposal stage. Realistically I think that the best we can do is to encourage users to always convert imported files to 32-bit float format when they are not converted automatically.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: Bug: default sample format ignored for imports

Post by Gale Andrews » Tue Jan 05, 2016 12:05 pm

steve wrote:I think it needs a wiki proposal, though I don't feel very motivated to write one as it is not a "glamorous" proposal and it is extremely unlikely that it will ever get beyond the proposal stage. Realistically I think that the best we can do is to encourage users to always convert imported files to 32-bit float format when they are not converted automatically.
So we never added the bug report "Default Sample Format ignored for imports" did we? I think it is an enhancement, and actually I am dubious about logging it for the reasons Steve states.

I have now noted these additional requests.
  • Don't convert data formats unless/until necessary. When returning the 32-bit processed data to the track we should NOT convert back down to integer format. (3 votes)
    • No preference for this behaviour (1 vote)
    • There should be a preference, retaining "Default Sample Format" (1 vote).
I think we could 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: Bug: default sample format ignored for imports

Post by steve » Tue Jan 05, 2016 1:02 pm

steve wrote:I think it needs a wiki proposal, though I don't feel very motivated to write one ...
but I'm motivated enough to log a bug report.
Personally I think this should be a P2 issue, but currently logged as P4.
http://bugzilla.audacityteam.org/show_bug.cgi?id=1294
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: Bug: default sample format ignored for imports

Post by Gale Andrews » Tue Jan 05, 2016 2:58 pm

steve wrote:
steve wrote:I think it needs a wiki proposal, though I don't feel very motivated to write one ...
but I'm motivated enough to log a bug report.
Personally I think this should be a P2 issue, but currently logged as P4.
http://bugzilla.audacityteam.org/show_bug.cgi?id=1294
I think P4 is accurate given (on Windows) there is not a problem with OGG (or with all FFmpeg cases) disregarding Default Sample Rate. I pointed that out in my response to your bug report. I can live with P3 if you really want to promote it, as stated in my reply.


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

Locked