Question about how digital sound playback works

Message boards : Cafe SETI : Question about how digital sound playback works
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile Bob DeWoody
Avatar

Send message
Joined: 9 May 10
Posts: 3387
Credit: 4,182,900
RAC: 10
United States
Message 1871785 - Posted: 8 Jun 2017, 19:12:16 UTC

I may have asked this question here before but if I did the replies didn't really answer my question. OK, to start with I understand how analog sound is transmitted and received and sent to speakers. I am also pretty clear on how digital images work. But given the almost infinite variations in sound from speech to a symphony orchestra playing I don't understand how a playback device understands what the binary code it picks up represents in sound. Is there a universal protocol on how to translate each bit of code to it's appropriate sound? Would a device built by someone with no knowledge of what is currently in use be able to make sense of normal digital sound data? Is a codex built into all digital sound media or do all playback devices have the translation key built in requiring all manufacturers to follow a strict protocol?

I have read page after page of verbiage encountered after typing my question online but to the best of my understanding none of it is relevant.
Bob DeWoody

My motto: Never do today what you can put off until tomorrow as it may not be required. This no longer applies in light of current events.
ID: 1871785 · Report as offensive
Profile janneseti
Avatar

Send message
Joined: 14 Oct 09
Posts: 14106
Credit: 655,366
RAC: 0
Sweden
Message 1871787 - Posted: 8 Jun 2017, 19:48:57 UTC - in response to Message 1871785.  
Last modified: 8 Jun 2017, 20:08:18 UTC

Digital sound doesn't differ so much from analog sound.
But with raw data it is the quantization of the amplitude of the signal, in practice, how many different "sound volume levels" can be distinguished. With 16-bit resolution, it becomes 2 ^ 16 = 65536 different levels and 24-bit thus gives 16.7M.
If you consider the audio signal as a stair, the sampling frequency controls the length of each step and the quantization controls the height of the steps. At high resolution (eg 24 bit), there are many steps and a slight difference in height between them, thus making the staircase "softer". The same applies to the appearance of the beep, higher resolution gives a smoother and more realistic representation of the sound.

Now there are also compressors like mp3 but in practice it works the same.
I know how the MPEG2 protocol works but that it perhaps over the top.

And of course SETI use the same principal in reverse:)
Fourier transforms.
https://en.wikipedia.org/wiki/Fourier_transform
ID: 1871787 · Report as offensive
Profile betreger Project Donor
Avatar

Send message
Joined: 29 Jun 99
Posts: 11361
Credit: 29,581,041
RAC: 66
United States
Message 1871792 - Posted: 8 Jun 2017, 20:14:16 UTC - in response to Message 1871787.  
Last modified: 8 Jun 2017, 20:26:30 UTC

And the graph clearly shows why digital music sounds bad compared to a quality analog recording.
ID: 1871792 · Report as offensive
Profile janneseti
Avatar

Send message
Joined: 14 Oct 09
Posts: 14106
Credit: 655,366
RAC: 0
Sweden
Message 1871796 - Posted: 8 Jun 2017, 20:28:39 UTC - in response to Message 1871792.  

And the graph clearly shows why digital music sounds bad compared to a quality analogue recording.

I wouldn't say bad but the difference is audible.
The sound becomes more "glitchy".
ID: 1871796 · Report as offensive
Profile Carlos
Volunteer tester
Avatar

Send message
Joined: 9 Jun 99
Posts: 29833
Credit: 57,275,487
RAC: 157
United States
Message 1871800 - Posted: 8 Jun 2017, 20:51:01 UTC
Last modified: 8 Jun 2017, 20:51:56 UTC

Keep in mind that the graph is simple representation. In real life sound is made up of multiple frequencies. That is why a "C" played by a flute is not the same sound as a "C" played by a piano. This graph shows how multiple frequencies parallel each other. It also shows how MP3 compress the signal. They cut out data from sounds that the human ear (in theory) cannot hear.



Many people in fact can hear overtones. Which is another reason that MP3 files don't sound as rich.
ID: 1871800 · Report as offensive
Profile janneseti
Avatar

Send message
Joined: 14 Oct 09
Posts: 14106
Credit: 655,366
RAC: 0
Sweden
Message 1871803 - Posted: 8 Jun 2017, 21:18:32 UTC - in response to Message 1871800.  

Many people in fact can hear overtones. Which is another reason that MP3 files don't sound as rich.

Yes. And MP3 add overtones. Bad overtones(:
ID: 1871803 · Report as offensive
Profile Bob DeWoody
Avatar

Send message
Joined: 9 May 10
Posts: 3387
Credit: 4,182,900
RAC: 10
United States
Message 1871876 - Posted: 9 Jun 2017, 4:55:50 UTC

But you still haven't addressed the question. How do combinations of 1s and 0s get translated into sounds?
Bob DeWoody

My motto: Never do today what you can put off until tomorrow as it may not be required. This no longer applies in light of current events.
ID: 1871876 · Report as offensive
rob smith Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer moderator
Volunteer tester

Send message
Joined: 7 Mar 03
Posts: 22202
Credit: 416,307,556
RAC: 380
United Kingdom
Message 1871877 - Posted: 9 Jun 2017, 5:13:26 UTC

At the recording end the sound is sliced into very short time slices. The amplitude of each slice is measured, and this measurement is translated into a digital representation (a string of "0"s and "1"s), and a checksum (or check bit) is calculated. The two are combined into a single message, which can be stored or transmitted as required.
At the playback end each message is unpacked, the digital representation is checked against its checksum, and if OK is translated into an analogue value.
Obviously the record and playback have to be operating at the same frequency, and have to use the same sequence of bits - (check sum type and format, data size, data-bit sequence...)

There are other methods available, but are less common.
Bob Smith
Member of Seti PIPPS (Pluto is a Planet Protest Society)
Somewhere in the (un)known Universe?
ID: 1871877 · Report as offensive
W-K 666 Project Donor
Volunteer tester

Send message
Joined: 18 May 99
Posts: 19062
Credit: 40,757,560
RAC: 67
United Kingdom
Message 1871886 - Posted: 9 Jun 2017, 6:42:28 UTC
Last modified: 9 Jun 2017, 6:49:01 UTC

This might help. https://en.wikipedia.org/wiki/Sampling_(signal_processing)


Signal sampling representation. The continuous signal is represented with a green colored line while the discrete samples are indicated by the blue vertical lines.

If you are worried about sound quality and distortion, then don't. The speakers and the room they are in will produce the most distortion.
If you have a partner who objects to speaker size or position and you are not allowed a sufficient sized cave, the only answer is divorce.
ID: 1871886 · Report as offensive
Profile Bob DeWoody
Avatar

Send message
Joined: 9 May 10
Posts: 3387
Credit: 4,182,900
RAC: 10
United States
Message 1872134 - Posted: 10 Jun 2017, 5:30:06 UTC

So., the three characters at the end of the filename after the (.) determine the format used to translate the digital string to an analog wave format. And each format has it's unique protocols to create the proper tones.
Bob DeWoody

My motto: Never do today what you can put off until tomorrow as it may not be required. This no longer applies in light of current events.
ID: 1872134 · Report as offensive
Profile janneseti
Avatar

Send message
Joined: 14 Oct 09
Posts: 14106
Credit: 655,366
RAC: 0
Sweden
Message 1872137 - Posted: 10 Jun 2017, 6:03:08 UTC - in response to Message 1872134.  
Last modified: 10 Jun 2017, 6:23:56 UTC

So., the three characters at the end of the filename after the (.) determine the format used to translate the digital string to an analog wave format. And each format has it's unique protocols to create the proper tones.

No. The end of the filename after the (.) is only a hint to the OS how to interpret the content.
And this interpretation is only an idea of Microsoft.
No other Operation Systems.
UNIX and now LINUX and OS X have a header with metadata instead in the beginning of the file so it can open the right application to read it.
I don't think it works for sound files though.
http://blog.dubspot.com/understanding-audio-interfaces/
There are MANY protocols for sound files.
Examples:
MP3, OGG, Wave.
MP4 and MPEG2 that also include video.
ID: 1872137 · Report as offensive
W-K 666 Project Donor
Volunteer tester

Send message
Joined: 18 May 99
Posts: 19062
Credit: 40,757,560
RAC: 67
United Kingdom
Message 1872173 - Posted: 10 Jun 2017, 10:59:12 UTC - in response to Message 1872134.  

So., the three characters at the end of the filename after the (.) determine the format used to translate the digital string to an analog wave format. And each format has it's unique protocols to create the proper tones.

Or you something like VLC that can read just about everything and is available for most OS's.
ID: 1872173 · Report as offensive
Grant (SSSF)
Volunteer tester

Send message
Joined: 19 Aug 99
Posts: 13736
Credit: 208,696,464
RAC: 304
Australia
Message 1872176 - Posted: 10 Jun 2017, 11:01:35 UTC - in response to Message 1871796.  

And the graph clearly shows why digital music sounds bad compared to a quality analogue recording.

I wouldn't say bad but the difference is audible.
The sound becomes more "glitchy".

Only with low resolution , or high levels of lossy compression.
Grant
Darwin NT
ID: 1872176 · Report as offensive
Profile janneseti
Avatar

Send message
Joined: 14 Oct 09
Posts: 14106
Credit: 655,366
RAC: 0
Sweden
Message 1872204 - Posted: 10 Jun 2017, 13:14:02 UTC - in response to Message 1872173.  

So., the three characters at the end of the filename after the (.) determine the format used to translate the digital string to an analog wave format. And each format has it's unique protocols to create the proper tones.

Or you something like VLC that can read just about everything and is available for most OS's.

Yes.
I think VLC can read every sound file without problem.
ID: 1872204 · Report as offensive
rob smith Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer moderator
Volunteer tester

Send message
Joined: 7 Mar 03
Posts: 22202
Credit: 416,307,556
RAC: 380
United Kingdom
Message 1872255 - Posted: 10 Jun 2017, 16:24:54 UTC

Well, not quite every sound file - it will not read some of the rather eccentric ones produced by professional recording equipment which have very high sample rates and very high bits/sample. But for general use it is great.
Bob Smith
Member of Seti PIPPS (Pluto is a Planet Protest Society)
Somewhere in the (un)known Universe?
ID: 1872255 · Report as offensive
Admiral Gloval
Avatar

Send message
Joined: 31 Mar 13
Posts: 20269
Credit: 5,308,449
RAC: 0
United States
Message 1872354 - Posted: 11 Jun 2017, 2:21:03 UTC

How digital audio works.
I hope this explains your question.

ID: 1872354 · Report as offensive
Profile janneseti
Avatar

Send message
Joined: 14 Oct 09
Posts: 14106
Credit: 655,366
RAC: 0
Sweden
Message 1872357 - Posted: 11 Jun 2017, 2:37:54 UTC
Last modified: 11 Jun 2017, 2:56:05 UTC

How HQ digital sound sounds like.
The Pink Floyd 24bit/96kHz sounds like this in 16bit 44.1kHz downsampled to Internet.
https://www.youtube.com/watch?v=TYJbLpMepsU
If you use an editor like VI you can see whats stored in the file.
Not so exciting because you will only see numbers.
A lot of them representing the amplitude in every sampled timeframe.

I forgot FLAC.
https://tracks.technics.com/GB/artists/447
High-definition audio in lossless FLAC format - rediscover Music in 16-bit and 24-bit quality,
ID: 1872357 · Report as offensive
Admiral Gloval
Avatar

Send message
Joined: 31 Mar 13
Posts: 20269
Credit: 5,308,449
RAC: 0
United States
Message 1872414 - Posted: 11 Jun 2017, 14:22:22 UTC

I use Goldwave for my sound editing. It can use these formats.

Supported audio file formats, including WAV, MP3, Windows Media Audio, Ogg, FLAC, AIFF, AU, Monkey's Audio, VOX, mat, snd, and voc.

ID: 1872414 · Report as offensive

Message boards : Cafe SETI : Question about how digital sound playback works


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.