Raw import-export

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
ThomAudio
Posts: 6
Joined: Wed Nov 05, 2014 6:29 am
Operating System: Please select

Raw import-export

Post by ThomAudio » Wed Nov 05, 2014 6:47 am

Question. Using audacity 2.0.6 on Windows 7 Pro, installed from .exe installer.

I do a raw import on some PCM audio data (16-bit signed 8 kHz), then immediately re-export in same format (raw). The resultant file is substantially the same but does not exactly match the original, almost all samples differ by 1 or more LSBs. I was expecting a bit-for-bit copy. Same effect if I export as WAV and examine sample by sample. What am I missing?

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

Re: Raw import-export

Post by Gale Andrews » Wed Nov 05, 2014 9:41 am

ThomAudio wrote:Question. Using audacity 2.0.6 on Windows 7 Pro, installed from .exe installer.

I do a raw import on some PCM audio data (16-bit signed 8 kHz), then immediately re-export in same format (raw). The resultant file is substantially the same but does not exactly match the original, almost all samples differ by 1 or more LSBs. I was expecting a bit-for-bit copy. Same effect if I export as WAV and examine sample by sample. What am I missing?
Did you import it raw as 32-bit float then dither it down for export? See Quality Preferences.

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

Moder_20
Posts: 6
Joined: Wed Nov 05, 2014 12:47 pm
Operating System: Please select

Re: Raw import-export

Post by Moder_20 » Wed Nov 05, 2014 12:52 pm

Ye i have the same problem.
@UP ye imported it as 32 bit float

ThomAudio
Posts: 6
Joined: Wed Nov 05, 2014 6:29 am
Operating System: Please select

Re: Raw import-export

Post by ThomAudio » Wed Nov 05, 2014 3:24 pm

Yup it is the dither, although this is a bit of an unwelcome surprise. Turning it off gives the desired effect. Thanks.

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

Re: Raw import-export

Post by steve » Wed Nov 05, 2014 5:22 pm

ThomAudio wrote:I do a raw import on some PCM audio data (16-bit signed 8 kHz), then immediately re-export in same format (raw).
So you're saying that if you do something for which there is absolutely no purpose, the result is not what you expected. :D

There is a very good reason for applying dither - for processed audio it eliminated harmonic distortion caused by quantize errors, thereby improving the sound quality and extending the dynamic range.

A detailed account is described in the Audacity wiki: http://wiki.audacityteam.org/wiki/Dither

There is also a section about dither in this excellent video: http://xiph.org/video/vid2.shtml
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ThomAudio
Posts: 6
Joined: Wed Nov 05, 2014 6:29 am
Operating System: Please select

Re: Raw import-export

Post by ThomAudio » Wed Nov 05, 2014 7:39 pm

steve wrote:
ThomAudio wrote:I do a raw import on some PCM audio data (16-bit signed 8 kHz), then immediately re-export in same format (raw).
So you're saying that if you do something for which there is absolutely no purpose, the result is not what you expected. :D

There is a very good reason for applying dither - for processed audio it eliminated harmonic distortion caused by quantize errors, thereby improving the sound quality and extending the dynamic range.

A detailed account is described in the Audacity wiki: http://wiki.audacityteam.org/wiki/Dither

There is also a section about dither in this excellent video: http://xiph.org/video/vid2.shtml
The "something for which there is absolutely no purpose" was the most concise example I could think of that illustrated the behavior I didn't understand, not the actual use. And I have good reasons for not wanting dither. "Quality" is not an issue and in fact this sound is not for human ears at all. I'm helping a group of students with a project involving audio input processing on a robotics platform and suggested audacity for basic manipulation (cut, trim, etc) while they are in the early stages of writing code. So anything that makes their data not look like the actual input is bad thing and I have to tell them to double-check their work in light of this, although I don't expect it matters much.

From the very guide you linked:
Here's the exception to the rule: If you have recorded in 16-bit and are only doing simple editing (cut, delete, paste, trim...) and not doing any processing (amplify, equalize, frequency filter....) then for highest accuracy dither can be set to "none". In this case, because there are no 32-bit operations prior to export there is no benefit to using dither.
Which is in fact my situation here. My surprise is not that dither exists, just that it was happening behind my back.

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

Re: Raw import-export

Post by steve » Wed Nov 05, 2014 8:15 pm

ThomAudio wrote:The "something for which there is absolutely no purpose" was the most concise example I could think of that illustrated the behavior I didn't understand, not the actual use.
I was only teasing ;)
The example you gave is indeed the clearest imaginable.
ThomAudio wrote:I'm helping a group of students with a project involving audio input processing on a robotics platform and suggested audacity for basic manipulation (cut, trim, etc) while they are in the early stages of writing code.
Sounds interesting. We hear of all sorts of unusual uses for Audacity in addition to audio use.
ThomAudio wrote:My surprise is not that dither exists, just that it was happening behind my back.
Personally I'd prefer that the dither option was more readily accessible, for example in the Export dialog, though if we did that I expect that a lot of users would, through not understanding what it does, turn it off when it would be better on. Unfortunately it is not easy to add controls to the Export dialog and no consensus that doing so is a good idea, but at least there is an option, even if not the easiest thing to find.
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: Raw import-export

Post by Gale Andrews » Thu Nov 06, 2014 10:50 am

ThomAudio wrote:My surprise is not that dither exists, just that it was happening behind my back.
If you had 32-bit float Default Sample Format set when you imported the 16-bit file, the dither noise would be expected in the 16-bit export.

If you had 16-bit Default Sample Format set when you imported the 16-bit file, the dither noise is a bug: http://bugzilla.audacityteam.org/show_bug.cgi?id=22.


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

Post Reply