Hacker News new | past | comments | ask | show | jobs | submit login
Everything You Should Know About Sound (2016) (waitbutwhy.com)
171 points by simonebrunozzi on July 21, 2019 | hide | past | favorite | 39 comments



We often measure loudness using a unit called the decibel (named after Alexander Graham Bell).

Not really. Decibels themselves are unitless: we just have to use them because the magnitude of sound pressure levels varies across a real large range so it’s very useful to have a compressive scale.

Pedantry ahoy!

1. The unit of loudness is the phon. Loudness is not independent of frequency: https://en.wikipedia.org/wiki/Phon

2. sound intensity is measured as a sound pressure level (SPL https://en.wikipedia.org/wiki/Sound_pressure) in dB: re 20muPa in air, 1 muPa in water. It is a frequency independent measure, though there are perceptual weighting scales (a- and b-weightings are common) to normalize things for occupational exposure limits.

Sound intensity and sound loudness are related but not at all the same. Loudness is a percept, intensity is a physical measure of a system.

I can play a 100 kHz tone at extremely high sound pressure levels and you will never hear it. It’s not loud, to a human. It’s probably quite loud if you’re a bat.


Pedantry ahoy! part II:

Sound intensity is a measure of power (power through a unit area), and is useful for determining the distribution of sound emissions (directivity) from a source.

Sound pressure level, is, well, a measure sound pressure. Sound pressure is related to sound intensity providing you know the directivity and distance to the source.

This is a nitpick of s nitpick, and SPL is often used interchangeably with the word intensity in lay documents. But if you're reading an acoustic journal article or text book and see the word intensity, just be aware that they are likely not discussing pressure level.


Thanks for the clarification. Learned something new today =)

What I've always wondered though: can loud sounds outside the frequency range that is audible to us cause hearing damage?

So, say we have a 120dB 60kHz audio source, would that be dangerous for our hearing? Would we be able to sense it (although not hear it)


"It is known that exposure to noise of a certain frequency does not induce a higher TS at that frequency, but rather at 0.5 to 2 octaves above that frequency, depending on the species"[1] ("auditory threshold shift (TS)").

[1] https://www.frontiersin.org/articles/10.3389/fnagi.2015.0000...

A meta observation: When the internet was new, and then the web, there was a puzzle of how society might adapt to information becoming more easily accessible than it had been. Bomb making instructions was a commonly used example. Society responded narrowly, by for instance outlawing such instructions. There's an entwined puzzle around understanding information. If science education someday fails less pervasively, how might society adapt? It's perhaps not a near-term challenge, but maybe something to think about.


Bomb making intructions are not illegal however.


From my understanding too damage the hearing, the sound would have to resonate part of the ear enough to cause damage and if any part resinated, we would hear it. You may get cases in which two inaudible frequencies could produce a harmonic that we could hear, though unsure of any examples in this instance.

You may well find though that some frequencies, which not audible by the human ear, may have some effect upon another part of the body. Though I do hope we don't end up having to carry bats in canary cages everytime we go down to the shops.

But another way to look at this is - if there was some way sound could be used to harm somebody in any way, then it would have been weaponized. With that in mind - https://en.wikipedia.org/wiki/Sonic_weapon


See also: harmonic distortion.


60kHz isn't really an audio source, at that frequency it would (or used to be, anyway) be classified as an RF source.

Marconi operated in frequencies even lower, 14-30kHz, at many thousands of watts from Alexanderson alternators[0]. Dogs were not happy near these stations.

https://en.wikipedia.org/wiki/Alexanderson_alternator

edit: added link, lowered frequency range.


> 60kHz isn't really an audio source, at that frequency it would (or used to be, anyway) be classified as an RF source.

It would not be classified as an RF source. Frequency does not redefine the medium. Sounds waves above 20KHz are usually referred to as ultrasound, but it is still sound. More specifically, it is still a compression wave in matter.

EM waves are a completely different medium. I presume you are conflating the two through the existence of this machine, the mechanical nature of it's source of oscillation no doubt created compression waves in the air of the same frequency as a side effect (Pretty sure Dogs don't have RF receivers). Whereas now we use solid state oscillators, and so your dog doesn't care about your various RF devices.


I conflate the two because I was temporarily nuts. Doh!

Of course ultrasound exists, and can exist in air up to the GHz range (not for very far).

Anyway, sorry for misinfo and thanks for the correction.


No worries. It's probably not helped by the fact that RF starts at around 20 KHz in EM at the same frequency where human hearing range ends in sound waves. So it's fairly easy to read a bunch of statements about frequency ranges and then mix up mediums, especially when EM contains a bunch of seemingly very different things, light, RF, xrays etc.


Also a number of different specifications for how it is measured.

https://auphonic.com/blog/2012/08/02/loudness-measurement-an...


> I can play a 100 kHz tone at extremely high sound pressure levels and you will never hear it

You won't hear it, but it will hurt like hell when your proteins start to coagulate.


Maybe somebody has a recommendation on a similar article, but on programming sound? Somehow there's much less material on working with sound (especially low-level details about low-latency realtime sound effects) than on working with images.


Programming sound is hard. Real-time stuff is almost always coded in C or C++ because it needs to be performant and latency is always a consideration. One dropped sample can be heard and you can't afford to delay because things need to feel responsive if they are real-time. There are lots of interesting projects out there but there is also a wealth of creative coding in the area, especially in environments like Max/MSP, PureData who are creating algorithms from scratch inside and possibly porting them out to other code bases. One good project is [1] which is aimed at making C++ coding for audio easier and more accessible. The focus is quite wide and aims at webaudio, VST, faust code etc.

[1] https://github.com/iPlug2/iPlug2


I've figured as much about performance, somehow while working with video I rarely reach for C++ lately, the firm realtime nature of sound makes performance harder than video even though the bitrate is orders of magnitude lower. Thanks for the link, will be looking at that and PortAudio.


Sound programming is basically IO+DSP.

IO depends on your target environment. Targets include Webaudio, VSTs, mobile, and frameworks like PortAudio.

Some environments include some packaged DSP algos. E.g. webaudio and Apple's audio frameworks both have useful "modules" you can hook together. Sound dev languages like Csound, SuperCollider, and PD are almost nothing but stock modules with some options to roll your own. Other environments like VSTs need custom DSP development, usually in C++.

Custom DSP is difficult and specialised, although you can get some way into it copy-pasting popular algos in a cookbook way without necessarily understanding how they work.

For the real thing you have to understand discrete time domain representations of various mathematical abstractions that describe signal generation (oscillators, sample players) and processing (filters, distortion, time-based effects like reverb.)

Trivial models can be fairly simple but sound very sterile. Non-trivial models sound more musical but are much harder to design. As an example, here's a complete course in digital filter design.

https://ccrma.stanford.edu/~jos/filters/

There's a similar amount to learn about reverb design, complex oscillator models, and Fourier analysis and synthesis. Even basic sampling theory isn't completely trivial.


The founder, and sole developer of Mutable Instruments (a well known modular audio/synth maker) wrote about her recommendations on how to get started in audio programming here [0]. Much recommended for the cited books, and general/business advice on making a hardware audio product.

[0] https://forum.mutable-instruments.net/t/new-to-coding-where-...


The reply like this is what I was hoping for! BTW, the actual forum thread (linked at your link) seems to exist only in the Google cache at [0], or am I missing something?

[0] https://webcache.googleusercontent.com/search?q=cache:dJGP5n...


I saw that too after posting! Thanks for posting the link to the Google Cache. The book recommendations and suggested progression are really great — Mutable / Émilie is awesome in all kinds of ways..!


I would look at some of the repro arcade emulation code bases and game sound programming as those area's will cover many aspects of your requirements.

Alas no great guides/articles I can recommend, though http://www.portaudio.com/ is spoken highly of interface wise and may be worth exploring as some platform independence.


The next time you’re talking to someone, I want you to stop and think about what’s happening. Your brain has a thought. It translates that thought into a pattern of pressure waves. Then your lungs send air out of your body, but as you do that, you vibrate your vocal chords in just the right way and you move your mouth and tongue into just the right shapes that by the time the air leaves you, it’s embedded with a pattern of high- and low-pressure areas. The code in that air then spreads out to all the air in the vicinity, a little bit of which ends up in your friend’s ear, where it passes by their eardrum. When it does, it vibrates their eardrum in such a way as to pass on not only the code, but exactly where in the room it came from and the particular tone of voice it came with. The eardrum’s vibrations are transmitted through three tiny bones and into a little sac of fluid, which then transmits the information into electrical impulses and sends them up the auditory nerve and into the brain, where the information is decoded. And all of that happens in an eighth of a second, without any effort from either of you.

Something quite intruiging - to me - about sound (and in particular music and speech) is that it is spread across time. At any one instant of frozen time, nothing in particular is happening with a sound - this is different to vision, where if you imagine freezing time, you get a still image. So the way sound is processed before it reaches the level of consciousness must need some kind of time buffer. So when, say, you are appreciating a drum pattern in a piece of music, your brain is processing the last few seconds of sound, noticing and highlighting the patterns and then presenting it to your consciousness as a kindof rhythmic artifact that you can appreciate and anticipate while it is still happening.


A frozen image is still an integration over time. If you could really freeze an image from a very small instant of time approaching zero, it wouldn't look like you expect. Light oscillates just like sound.

Anyway you can take a "still image" of sound, you can apply a Fourier transform.


If you freeze video, you get an image. If you freeze sound, you get an "image" on the speaker. It "stays" where it is. (At the voltage potential it is.) We put HPFs on subwoofers so they don't stay offset like that.

The same way vision in human sight makes very little sense without things being able to move (integration over time), hearing in the human sense seems to be the same. Recording the change in pressure over time of the surrounding air, instead of photons hitting you. But I am pretty certain that "vision" that works in "single blips" with no refresh is just as pointless as a paused audio recording for survival of an animal.


Why would you put a high pass filter on a subwoofer?


To eliminate DC Offset (i.e. 0Hz).


The brain requires change/pattern for anything to reach consciousness. A "frozen" image is still oscillating light on your photoreceptors. Your brain is always incorporating some kind of memory or recent change with every experience you have...sound isn't special.


The oscillations of the light you see is on the tetrahertz scale, and goes nowhere close to being perceived as changing by your brain. Your rods and cones don't directly measure the electric or magnetic field vectors, they interact chemically with individual photons.


You completely missed the point. The oscillation of incoming photons is what allows the photoreceptors to send distinguishable patterns to the brain. You can say that the oscillation "starts" in the light waves or in the chemical reactions. It doesn't matter - the point was that vision requires change just like audition.


Indeed, but we can consider even shorter chunks of time than the last few seconds... Frequency itself is fundamentally dependent on time, e.g. The lowest 'A(0)' note on a piano vibrating at 27.5Hz = "cycles-per-second", up through "Concert Pitch" tuning reference 'A(4)' at 440Hz, and doubling in speed and pitch each octave upwards.

I'm often similarly intrigued / amazed / bemused that without time, we'd have no concept of sound.


The Jeffress model (lateral delay lines) mostly addresses some of this—specifically azimuth localization.

The precortical processing in the auditory system is, in general, quite intricate; we’re finding out new tricks every day. Vision is too, of course — and is like two orders slower!


I don't think that there is much difference with vision compared to sound. If you would truly froze time (not like they do in movies) you similarly wouldn't see anything.


> each increase of 10 dB doubles the loudness.

I understand a 10 db increase to represent an increase by a factor of 10, and that an increase of log(2) = (~3) db was a doubling.


That's power, not necessarily loudness.

Loudness has to do with perception, which also has a lot to do with content. For most people (a fairly wide margin here) music sounds about twice as loud when it's +10dB.


yep, he vaguely mentions this in footnote 6


I enjoyed this part: "Researching for this post and learning about what sound is gave me a new perspective on the tree falling in the forest with nobody there to hear it question. I now think that no, it doesn’t make a sound. It makes an air pressure wave and that’s it."


Do I get this correct? In the case of a sound so loud that is leaving vacuum behind, there should be another wave on the opposite direction that fils up the vacuum, when the original wave gets very weak. Does this second wave make a sound and/or destroy things?


It's uncanny how similar sound and radio waves are in terms of propagation, despite being entirely different types of energy.

That said, there isn't a lot of visual diagrams on radio wave propagation. If you happen to know of some great diagrams, please share.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: