buggy Import RAW Data

Help for Audacity 2.x.x on GNU/Linux.

ImageThis forum is for Audacity 2.x.x on GNU/Linux and Unix-like operating systems.
Please state which version of Linux you are using, the exact three-section version number of Audacity from Help > About Audacity... and whether you installed your distribution's release or daily version of Audacity or compiled Audacity from source code.

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.

buggy Import RAW Data

Permanent link to this post Posted by terrance_h » Fri Apr 28, 2017 12:48 pm

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 462 times


attachments:
sin.raw: a signed 16-bit big-endian linear sine wave
Last edited by Gale Andrews on Fri Apr 28, 2017 4:56 pm, edited 1 time in total.
Reason: placed image inline so that it fits Forum layout
terrance_h
 
Posts: 7
Joined: Fri Mar 10, 2017 6:50 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by terrance_h » Fri Apr 28, 2017 1:01 pm

unable to upload raw file, using this xxd dump instead
Attachments
sin.txt
(83.01 KiB) Downloaded 16 times
terrance_h
 
Posts: 7
Joined: Fri Mar 10, 2017 6:50 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by steve » Fri Apr 28, 2017 1:08 pm

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 13 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 456 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 456 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by steve » Fri Apr 28, 2017 1:19 pm

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?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by steve » Fri Apr 28, 2017 1:37 pm

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
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by terrance_h » Sat Apr 29, 2017 9:23 am

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
terrance_h
 
Posts: 7
Joined: Fri Mar 10, 2017 6:50 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by terrance_h » Sat Apr 29, 2017 9:29 am

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 445 times
terrance_h
 
Posts: 7
Joined: Fri Mar 10, 2017 6:50 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by terrance_h » Sat Apr 29, 2017 9:33 am

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.
terrance_h
 
Posts: 7
Joined: Fri Mar 10, 2017 6:50 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by terrance_h » Sat Apr 29, 2017 9:38 am

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 16-bit_RawDataTest.wav is no longer available


And this is the (correct) waveform as it appears on my machine after importing as RAW:

The attachment 16-bit_RawDataTest.wav 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.
Attachments
sin.raw.notrealwav.wav
(19.53 KiB) Downloaded 15 times
terrance_h
 
Posts: 7
Joined: Fri Mar 10, 2017 6:50 am
Operating System: Linux *buntu

Re: buggy Import RAW Data

Permanent link to this post Posted by steve » Sat Apr 29, 2017 10:07 am

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 440 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Next

Return to GNU/Linux and Unix-like



Who is online

Users browsing this forum: No registered users and 2 guests