Attached is a RAW, unsigned 8 bit file with 256 values from 0-255.
I’ve noticed the following in Audacity 2.4.1:
exporting the file after import does not result in original data. I know there are limitations to a floating point representation but I think this should not be an issue with 8 bit resolution!?
also: “export” and “export selected” of the same data differ in output
sample selection and editing is not as precise as I would have expected; while double-clicking the track’s samples results in 256 samples selected, if I move the cursor to the last sample, it shows “255 samples”. This heavily depends on the zoom factor, if the selection is extended more than half of a “sample slot width”, it correctly shows “256 samples”. Same goes for editing: it seems it’s possible to cut partial “white space” at the start and end of a track. This also causes an incorrect sample count: Deleting the first sample, selecting the track still results in “256 samples”. Export results in 256 bytes!
I’ve looked into this as the sample data obtained from a few very short waveforms (100 samples) was not as expected. byte.txt (256 Bytes)
Audacity works internally in 32-bit float format, so when exporting as 8-bit, the data is downsampled from 32-bit float to 8-bit.
As is standard practice when reducing the bits per sample, the output has “dither” applied. This is generally a good thing for audio, but not good for “scientific” measurement / experiments.
Dither may be turned off in Audacity Preferences in the “Quality” tab. (https://manual.audacityteam.org/man/quality_preferences.html)
Maximum zoom, start of track (first sample 0x00 is in bottom left corner, only a quarter of the circle is visible)
position cursor close to sample, so that position toolbar says “0 samples”
drag-select or SHIFT+HOME to select. selection is visible only in timeline.
DEL to remove selection. selection and sample point disappears, track moves left accordingly. a small left-arrow appears at bottom left corner of track (?).
selecting the whole track results in “256 samples”
Export with dither turned off results in file with original data (length 256).