Page 1 of 2

buggy Import RAW Data

Posted: Fri Apr 28, 2017 12:48 pm
by terrance_h
Audacity 2.1.3
Ubuntu 16.04 amd64

This also affects windows version.

Importing 16bit signed raw results strange waveform, seems like non linear a-law or u-law. Also most of the raw formats imports result unexpectedly.
Screenshot_2017-04-28_20-38-08.png
Screenshot_2017-04-28_20-38-08.png (85.56 KiB) Viewed 1196 times
attachments:
sin.raw: a signed 16-bit big-endian linear sine wave

Re: buggy Import RAW Data

Posted: Fri Apr 28, 2017 1:01 pm
by terrance_h
unable to upload raw file, using this xxd dump instead

Re: buggy Import RAW Data

Posted: Fri Apr 28, 2017 1:08 pm
by steve
Note that Audacity attempts to guess the raw data format, but it's no more than an educated guess. It is not possible to make this guess 100% accurate, which is why audio files usually contain header information.

Please test importing this file as RAW data (you can change the file extension if you wish - I've just named it as a WAV file so that I can upload it to the forum).
16-bit_RawDataTest.wav
(344.53 KiB) Downloaded 86 times
The settings should be like this (these are automatically selected on my Xubuntu 16.04 machine):
fullwindow-Import Raw Data-000.png
fullwindow-Import Raw Data-000.png (34.93 KiB) Viewed 1190 times
And this is the (correct) waveform as it appears on my machine after importing as RAW:
firsttrack000.png
firsttrack000.png (9.44 KiB) Viewed 1190 times

Re: buggy Import RAW Data

Posted: Fri Apr 28, 2017 1:19 pm
by steve
terrance_h wrote:Importing 16bit signed raw results strange waveform
Not surprising, because "sin.txt" is not 16-bit signed PCM.
Where did that file come from?

Re: buggy Import RAW Data

Posted: Fri Apr 28, 2017 1:37 pm
by steve
Here's the first 100 bytes as signed 16-bit big endian:
(it does not look like a sine wave to me)

Code: Select all

0   30 30  12336
2   30 30  12336
4   30 30  12336
6   30 30  12336
8   3A 20  14880
10  65 36  25910
12  30 30  12336
14  20 65  8293
16  39 30  14640
18  30 20  12320
20  65 39  25913
22  30 30  12336
24  20 65  8293
26  62 30  25136
28  30 20  12320
30  65 65  25957
32  30 30  12336
34  20 65  8293
36  66 30  26160
38  30 20  12320
40  66 30  26160
42  30 30  12336
44  20 66  8294
46  33 30  13104
48  30 20  12320
50  20 2E  8238

Re: buggy Import RAW Data

Posted: Sat Apr 29, 2017 9:23 am
by terrance_h
steve wrote:
terrance_h wrote:Importing 16bit signed raw results strange waveform
Not surprising, because "sin.txt" is not 16-bit signed PCM.
Where did that file come from?
i cannot upload the raw, the txt is its xxd dump

Re: buggy Import RAW Data

Posted: Sat Apr 29, 2017 9:29 am
by terrance_h
you can "xxd -r " to restore the raw.

the correct waveform is like this (using matplotlib)
Screenshot_2017-04-29_17-27-01.png
Screenshot_2017-04-29_17-27-01.png (60.52 KiB) Viewed 1179 times

Re: buggy Import RAW Data

Posted: Sat Apr 29, 2017 9:33 am
by terrance_h
steve wrote:Note that Audacity attempts to guess the raw data format, but it's no more than an educated guess. It is not possible to make this guess 100% accurate, which is why audio files usually contain header information.

Please test importing this file as RAW data (you can change the file extension if you wish - I've just named it as a WAV file so that I can upload it to the forum).
16-bit_RawDataTest.wav
The settings should be like this (these are automatically selected on my Xubuntu 16.04 machine):
fullwindow-Import Raw Data-000.png
And this is the (correct) waveform as it appears on my machine after importing as RAW:
firsttrack000.png
Thanks! That explains it.

But this is exactly the issue. we need the "Import RAW Data" for raw files have no valid headers. or we can just "open" them.

Re: buggy Import RAW Data

Posted: Sat Apr 29, 2017 9:38 am
by terrance_h
steve wrote:Note that Audacity attempts to guess the raw data format, but it's no more than an educated guess. It is not possible to make this guess 100% accurate, which is why audio files usually contain header information.

Please test importing this file as RAW data (you can change the file extension if you wish - I've just named it as a WAV file so that I can upload it to the forum).
The attachment 16-bit_RawDataTest.wav is no longer available
The settings should be like this (these are automatically selected on my Xubuntu 16.04 machine):
The attachment fullwindow-Import Raw Data-000.png is no longer available
And this is the (correct) waveform as it appears on my machine after importing as RAW:
The attachment firsttrack000.png is no longer available
the attachment is my RAW, extracted from an oscilloscope.

Sometimes I use audacity as a scientific tool, viewing and processing waveform.

Re: buggy Import RAW Data

Posted: Sat Apr 29, 2017 10:07 am
by steve
terrance_h wrote:sin.raw.notrealwav.wav
On my machine, that is detected by Audacity as signed 8-bit, little endian, 2 channel (stereo), which produces this waveform:
firsttrack001.png
firsttrack001.png (19.88 KiB) Viewed 1174 times