Sound
ciechanow.ski
ciechanow.ski
Any one of these pages would be a feat, an achievement to be proud of, but as a collection, it forms one of the greatest educational resources of its type that I have known.
These things can give you more intuition about a subject in 45 minutes than a textbook might be able to in 3 months, because it's interesting and not dry.
I wish I had more time to rant about this right now, but I haven't, so: Kudos. Another amazing job.
He says this is his weekend hobby. I really wish he could work on these things full-time. The world needs more people like him.
Absolutely blown away. As someone with a "design for learning" degree which I've found to be rather useless, I'd gladly have traded by dozens of thousands of dollars for a chance to learn with this guy. The technical sophistication combined with the incredibly didactic and clear flow of his work is truly insane.
I agree with parent comment. This man should be given funding to do this for the rest of his life.
Hmm, is it me or does the 440Hz sound seem higher pitched than it should? I'm not a musician at all but the 330Hz sounds closer to what I'd expect.
And the part about sound bouncing in the room is basically "acoustic room design 101" and beautifully illustrates how shape and dampening of the room can massively change how it sounds
What if there was a market that incentivized the creation of top-quality educational content like this? Create it for one topic, usable forever.
The markets we have are perversions. They are captured; regulated and deregulated in all the wrong places.
It is possible that small changes in how money or capital works could enable far better markets.
It is called demurrage currency or negative interest rates...
Hint: If money itself no longer accumulates without consent then capital can only accumulate with consent.
The tech is there, the resources are there. The will is there, if you ask the right questions. But powerful interests like things the way they are, and are willing to kill millions to keep things that way.
They way he is able to explain complex subjects by starting from first principles, gently adding more and more layers, with beautiful, custom-made figures and animations is truly, literally, awesome.
I strongly recommend supporting the author via his Patreon if you enjoy his blog posts.
> I myself don't even own any traditional watches, so the topic was very new to me. Thankfully, it was easy to understand the gist of how mechanical watches work just from watching some YouTube videos and I decided to give the topic a go.
If you subscribe -- you should subscribe!! -- you can read his "making of" posts which are also fascinating. I don't think he's a domain expert in anything he's written about, he just does a ton of research and only produces a few articles per year.
FWIW the The Scientist and Engineer's Guide doesn't actually cover a lot on sound. It starts in a particular DSP way with frequency domain definitions and convolution - and I actually think Steven's background is in medial imaging, though I could be mistaken.
[1] https://www.analog.com/en/education/education-library/scient... [2] https://www.analog.com/media/en/technical-documentation/dsp-...
It’s an uncomfortable reminder of how essential reputation and credibility are in the machinery of science.
”The paper contained the controversial claim that any continuous periodic signal could be represented as the sum of properly chosen sinusoidal waves. Among the reviewers were two of history's most famous mathematicians, Joseph Louis Lagrange (1736-1813), and Pierre Simon de Laplace (1749-1827). While Laplace and the other reviewers voted to publish the paper, Lagrange adamantly protested. For nearly 50 years, Lagrange had insisted that such an approach could not be used to represent signals with corners, i.e., discontinuous slopes, such as in square waves. The Institut de France bowed to the prestige of Lagrange, and rejected Fourier's work. It was only after Lagrange died that the paper was finally published, some 15 years later.“
from chapter 8 http://www.dspguide.com/ch8/1.htm
Isn't that true though? You can only approximate it, right?
Also, it's fine to cut off the infinite series of sinusoidal waves because all physical systems cut off around a given frequency, for example human hearing around ~20kHz.
For example, every DFT/FFT explanation seems to start with complex numbers. I wish there was a resource that was programming focused, starting with "Step 1: Process this artificially created periodic signal by multiplying it by sine waves of frequencies from from 1 to N. There are our bins! Step 2: OK, for real world signals we need phase, so now let's talk about complex numbers."
I've been studying math for a while trying to build up the prerequisites for writing audio DSP code. I have this sneaking suspicion that at the end what I want to achieve won't be as hard as DSP resources imply. At least there will be parts that I could have done with hardly any theory at all. But because of the way these resources are written, I have to consume massive amounts of theory first.
(For background, I've worked as a mastering engineer and have done a fair amount of audio production, so I know intimately what the tools ought to do.)
https://observablehq.com/collection/@skybrian/digital-signal...
Maybe the latter part could be prepped by resynthesising the time-domain signal by summing the sines, and seeing that it doesn't match the original. And it can't, not least because all of the sines start at 0. But if you have cosines as well, it can. Then refer to the geometrical relationship between sine/cosine and phase.
A preliminary to the earlier part might be to multiply a single long sinusoid by another one, and see what happens when their frequencies do or don't match. (But there is a whole well here about what it means for frequencies to "match", which in the discrete world has to do with how long the relevant part of the signal is.)
Especially the fourier cube [2], the complex exponential [3], the digital filter designer [4] and the signal generator [5] might be helpful.
Additionally the matrix multiplier [6] has an option for complex numbers that highlights the perspective that complex numbers can be seen as just a subset of 2x2 matrices.
[1]: https://tools.laszlokorte.de/ [2]: https://static.laszlokorte.de/fourier/ [3]: https://static.laszlokorte.de/complex-exponential/ [4]: https://static.laszlokorte.de/signal-transform/ [5]: https://static.laszlokorte.de/signal-generator/ [6]: https://static.laszlokorte.de/matrix-multiplication/
The Smith book is definitely for you; also check out Rick Lyons's books. Bo Pirkle and Julius O. Smith are good for audio-specific theory and applications.
And yet, not so common especially on popular websites with $$$ development costs.
if ("IntersectionObserver" in window) {
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => { entry.target.drawer.set_visible(entry.isIntersecting); })
}, { rootMargin: "300px" })
all_containers.forEach(container => observer.observe(container));
} else {
all_containers.forEach(container => container.drawer.set_visible(true));
}
You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/Intersectio...As a side note, all of the code is very pleasant to read. It's interesting that it's seemingly (almost) all hand-written, given that there are commented-out rules in the CSS, for example. I'm not sure what's going on with the HTML though, probably some custom generator.
Interesting side note - using the "basic" frequency/amplitude slider section, you can tell if you have any hearing loss in a certain ear at a certain frequency, as well as high frequencies in general.
As an ex-musician, I have some hearing loss caused by playing and being around extremely loud music. Between 6KHz and 7KHz, I felt the sound shift towards my right hear, indicating some hearing loss at that frequency in my left ear. Between 10KHz and 11.5KHz, I felt a strong shift toward my left ear, indicating hearing loss at those frequencies in my right ear. Above about 12.3KHz, I lost the sound entirely.
One very gentle bit of feedback (haha) to the author would be to provide anchors to each section so they could be more easily linked.
If you're on headphones maybe but might "only" be shit speakers
One thing that surprised me the first time I learned it is how 'dense' air is under normal circumstances. The 'mean free path' is the mean distance that a particle travels before changing velocity (typ due to collision). The mean free path of atmospheric air at standard pressure is ~65 nanometers, with ~2x10^19 (20 billion billion) molecules per cubic centimeter experiencing about 10^33 collisions per second. This is roughly the volume of an adult's ear canal.
Reality is very strange.
The one lesson I learned the hard way is that if you run a full-volume sine wave long enough you can permanently destroy your laptop speakers.
Don't hold your breath. It'll be rudimentary. I'm making it for my own joy and learning, but will probably publish it by EOY.
Minutes? Hours?
I never repeated the experiment. Maybe my laptop was a dud or something.
When I increased the slider that allows you to change the flow of time for the gas in the cube, it really looked like visualizations I've seen of increasing the temperature of a gas. Is there a deeper relationship here? Could an observer tell the difference between a cube $A$ of gas in which the flow rate of time were doubled and a cube $B$ of gas with normal time passage, but a correspondingly increased temperature? If so, what would give it away?
JWST has one
https://webb.nasa.gov/content/about/innovations/cryocooler.h...
basically, make a standing wave of gas in a pipe and the peak of pressure will be hotter than the valley. Put the thing you want to cool in the valley, radiator in the peak, and voila, a heat pump.
And it's due to this speed, despite air's low density, the force air exerts is enormous -- equivalent to 10 tons per square meter. Somehow, the human sandwich does not explode nor implode due to equivalent pressure coming from the other side and inside.
Indeed the all time record is >300m which is something like 32x pressure.
So it’s not merely that there is equivalent pressure from inside.
I'd say that pressure & temperature are a consequence of the speed, not the other way around
Clicking on the word 'switch' does exactly that. That's a delightful and clever touch that of course comes from Bartosz Ciechanowski.
edit: If I limit Firefox to 60fps (down from my display's 280hz) then it seems to work fine.
I also assume if you are starting at a reasonable (laptop, small desktop speakers) at a low-to-medium level (say 50-60dB), increasing a bit won't cause immediate damage even if you can't hear the sound?
It's also important to realize that especially with infrasound, you're always exposed to it along with most regular sounds.
The modulation applied to sound to turn it into speech (i.e. amplitude and frequency shifts on order ~0.5-2 Hz) shows up in the frequency spectrum at those sorts of frequencies.
If you say "hey hey hey hey hey", that's a 1 Hz-or-whatever sound wave you're producing with a higher frequency carrier wave.
https://blog.fluance.com/wp-content/uploads/2021/05/Ported-V...
Is the hole to help get the sound out..? No. As this article shows you, the speaker already moves back and forth, this will create changes in pressure yada yada.
The speaker port is not just a hole, it’s a tube. The air in that tube has a mass and due to changes of air pressure inside the box, the air mass in the tube will move back and forth just like a plate in the article.
The result is that you basically have 2 “moving plates” which create sound: the speaker cone itself powered by a motor, and the air mass in a tube powered by the air pressure in the speaker enclosure.
Cool video about speaker design
There is also variant of that where instead of pipe hole there is an extra passive membrane
Several of the piano key demos ask you to observe what happens when you play multiple keys at once. Is there a way to do this on a desktop PC that I am missing? I had to switch to my phone to try those sections.
Thanks. Next time I'll try actually reading all the text on the page.
Amazing that on a page with such exemplary UX my tired brain still managed to gloss over the massive letters on each key.
Edit: Oh, I think the answer is 6493 lines of artisanally hand-crafted javascript + WebGl. Beautiful.
Superb post.
This was great.
What we (the unmanicured masses) crave most is a clear blueprint for reconstructing the new Internet once our consumerism-based, debt-aggregation system inevitably comes to a screeching halt, complete with a spectacularly bloody and sparkling implosion.
I lack the proper academic terminology to even understand the field enough to discern what exactly it is that I don’t know that I don’t know, and personally my time “wasting time learning things on my own for seemingly no reason other than wanting to know” has recently been cut short, and I am left aching for someone to emerge from this chaos and hopefully be receptive to these messages/instructions/explanations before they are pulled from beneath us.
One of my favorite articles is this one on hex grids: https://www.redblobgames.com/grids/hexagons/ it blew my mind the first time I noticed that all the interactions and code change when you toggle between "flat topped" and "pointy topped".
Isn't 460 m/s the speed of the shock waves?
I mean, it you make some "air particle" move, it'll hit a nearby particle, and so on, and this wave has a speed of 460 m/s. In a solid object (wood, for example) the particles are close together and the speed will be greater. If you remove air particles it'll decrease the pressure and the speed will be slower...
If you mean technical, you have no choice but to actually study the topic and understand it so that you can create examples like the author did.
I had a quick look; as always with the presentations on this website, all the un-minified JavaScript is right there for you to pour over: https://ciechanow.ski/js/sound.js
So that covers the implementation: a giant pile of WebGL to power the rotatable boxes and animate effectively using the GPU, alongside in this case a bunch of Web Audio code.
Unfortunately that doesn't cover the focus/discipline part, which I would definitely appreciate some pointers on... one of these days I'll find some that fit within my ADHD address space xD
I recommend starting off by playing around with Three.js, which will get you up and running really quickly while still staying pretty grounded in WebGL. [1] You can make blog posts very similar to Ciechanowski using ObservableHQ. [2]
[1] https://threejs.org/docs/index.html#manual/en/introduction/C...
https://en.m.wikipedia.org/wiki/LMS_color_space
Similarly, our ears are sensitive to a rather larger number of frequency bins, and and each sensory cell senses one of these bins.
Neither of these sensory mechanisms is particularly sensitive to phase and, in fact, we can’t hear phase differences very well.
The combination happens in our brain because it's transforming those separate signals into useful information.
On atomic level. Like atoms oscilating? How many photons are emitted when say 5 carbon atoms connect with 5 oxyxen particles? I tried searching and no avail.
This is the type of blog I aspire to make, one day
All education should aim for this bar
Amazing work.
As someone who really likes math, programming, and visual design as well as having spent hours upon hours practicing often short, yet incredibly complex lead guitar riffs by himself for many hours as a kid, I never quite grasped music theory back then and I realize now that essentially the only reason that is the case is because it was never presented to me in such a fun, digestible, and incredibly beautiful way; a way that I've been very much seeking to discover myself my whole life.
There are people who pay others to build schools, and then there are those that build things far more capable of transmitting the most optimally distilled form of knowledge and intellectual achievement that mankind has to offer to us today.
I don't really have much words right now, other than I want to kiss this man's feet and then maybe hope to stop crying eventually.
Seeing there's a new Bartosz Ciechanowski explainer might be my one exception to this rule.
A link to all the HN submissions from ciechanow.ski
That's kinda crazy to think about. Someone across a gymnasium room farts, and you smell it milliseconds later. Ugh.
Amazing content as always otherwise.
:facepalm
No one knows for sure, one of the true mysteries of the universe.
I checked system audio settings and see nothing muted.
One suggest to Bartosz: breaking one long essay into many smaller pages or hiding content until the viewer has indicated understanding of previous steps will be even more useful (see: https://tigyog.app/d/H7XOvXvC_x/r/goedel-s-first-incompleten...).
Explorable models are a great way to increase engagement and understanding. Beyond that, I would supplement this with highly frequent comprehension questions to check for learning. I bet you'd find a way to make it fun and approachable.
You don't understand it but want to? Don't scroll. You don't want the next bit? Don't scroll.
Will this work for teachers in a classroom? Likely not as the kids who don't care, will skip everything they can. And this page will let them, because if you don't care to understand then this page is not for you.