337 points · by bigwheels · 2w ago · 173 comments
Standing in the hallways listening at different angles, as the article says, didn't help. No Fable in '05 either.
So I had to improvise. Got a ~1 meter stick and two headphones (every headphone is a microphone, even if it sucks as a microphone). Plugged them into the stereo mic port, and started recording in Audacity. The phase shift between L and R pointed directly to the source. Took about 4 or 5 beeps to get the sucker.
Turns out, it was hiding above the ceiling tiles in the garage. My wife still tells this story to all her friends as one of my biggest life achievements. Everything I shipped, the companies I founded -- pales in comparison to finding a dead smoke alarm
Do you not feel this way about it yourself? I know I would.
The beep frequency is about 3000-3500 Hz, which makes its wavelength about 10cm (1/3 of a foot). The piezo speaker in the smoke detector is so small that it takes 3-4 wave periods to go from silent to full blast. Meaning, if my stick was pointing perfectly to the source (it never was, obviously, but if), then one of the "mics" would hear the sound at full blast while the other still wouldn't hear anything.
So, I would have Audacity recording, hear the beep, stop the recording and zoom at the wavefront of the beep. Whichever mic shows the signal first, I'd move my stick (and the laptop) in that direction. After 2 or 3 moves and I was right under the source. Took me about 2 or 3 beeps at different stick orientation to understand that the sound is coming from above.
Many many many years ago, I was a wee IT manager. Sort of a weird company, I was too young to be much more than smart kid who can install / fix anything.
Anyways, worked a few years there, made some friends, had one CAD engineer who was an utter jerk. In hindsight, probably a bully, but at the time just a really irritating person.
So that was my first foray into small electronics… worked up a small breadboard with a 555, some source of randomness I don’t remember now, a piezo speaker, and a 9v battery. It would emit a short beep at random intervals between roughly 60 and 240 minutes.
Stashed it above the ceiling tiles in his office on my last day at the company.
Good times. I bet it’s still magnetically attached to the inside of the steel riser column of one of their desk chairs, though the battery is likely long dead.
So I may in the future be the villain in a story like this if I am forgetful when I sell my apartment.
My upstairs neighbor is a moron who has flooded their apartment at least twice, so I have stashed moisture sensors into the access panels in multiple rooms as a sort of early warning system.
It wasn’t until the next day did I realize that it was two separate locations!
To answer the inevitable question, EE students with a tiny amount of spare time. Not much, but just enough.
Our dog goes outside and hides in the lavender bush if a smoke alarm starts making a "I need a battery" noise.
So I went into this project with the attitude that I would like to solve this class of problem forever.
Nicely done!
> Claude doesn’t have native audio input (yet), but it can run JavaScript and Python code that can analyze audio captured by a microphone.
LLMs can also do that with non-mic audio, btw. I had GLM (or was it qwen?) answer the question of "Why does the spotify version of the Metal Gear Rising" soundtrack sound so bad" - to great results.
Compared with the CD rips on archive.org, the noise floor was 27dB (!!!) higher, and, the whole thing was 10dB more compressed.
I cannot vouch for these specific numbers, but subtracting the good version from the bad one gave me a horrible delta wav file with lots to listen to, so there was definitely a _lot_ of difference.
It got the job done is what I want to say.
I bought an album from Apple Music, it was “in flames - reroute to remain” an album I’m very fond of when growing up.
Turns out that the digital version just sounded like trash, it sounded very compressed, so I had to find a CD to rip.
Could be interesting to know how they butchered it.
When you say “very compressed” are referring to the dynamic range or a low bit-rate? If it’s dynamic range, that would be somewhat ironic. The loudness wars resulted in remastered CDs from the 90s and 2000s having a reduced dynamic range compared to the original album release. Back in the good old days, many What.CD users valued rips from vinyl over CD re-issues for this reason.
Our three dogs are absolutely terrified of the Nest smoke alarm after I almost burned down my kitchen trying to make some copycat crunchwraps a few years ago. =P They're so afraid of the smoke alarm that the monthly "sound check" thing Nest performs makes them quiver and quake. We used to be able to delay the sound check through the Nest app, so we could have a chance to bring the dogs outside before it goes off, but Nest seems to have removed that functionality.
Animal species sometimes use this in different sounds they make. An alarm call has that kind of "smooth tone" characteristic, so a predator can't locate the source of the sound but it still works to raise the alarm. Meanwhile more social sounds are more "chirpy" and sharp, so they can locate each other.
Examples
- beep: curve coming up ahead in X metres
- beep: curve coming up
- beep beep beep (too close to lane divider)
- beep: the speed limit is X
- beep: you’re speeding (no, I’m transitioning from a 60kmh to 40kmh section)
- beep: gps directions
- beep: gps directions again in case you missed it
- beep: yes again, turn left here you idiot!
Then its solved.
1) Move half the boxes to another room.
2) Listen for a beep and determine which room the beep comes from.
3) Take the boxes in that room and split them in half again.
4) Repeat until one box is left.
- the boxes are stacked
- the heavy boxes are at the bottom of a stack, and you can't stack a heavy box on top of a light one
- boxes aren't the same size
- some boxes are open, so must be put on top
- storage space and height are limitedI also feel like ordering the moves by lightest box first is reasonable as a real-world optimization.
The number of partitions doesn’t matter either, the most straightforward case is the beeping box always being in the original room, so regardless of strategy you move n-1 boxes to narrow it down, and by symmetry it doesn’t matter which room beeps.
sum_{i=1}^{log_2(n)} (n/2^i) = n - 1
So it's O(n).A simple example: start at n = 2^m = 10000... (n in binary)
move 2^m/2, and keep adding halves:
0100...
0010...
0001...
...
Sum: 0111...11 = 2^m - 1 = n - 1
n-1 moves are O(n). So you were right.n. Sum(2^-i)=n
So its o(n. Log(n))
I like to keep a lot of things in storage, and sometimes go through my boxes and “rediscover” things I haven’t used in a while.
Sure I have a lot of things I never use also. Some things I could sell, and some things I could give away, and some things I could throw away.
But just because a lot of things are in boxes, doesn’t mean that I might as well get rid of all of it for that reason alone.
And the piles of rubbish at the landfill are probably beeping too.
(Out of curiosity: I think "physical binary search" is more properly O(n^{1/3} log(n)), or maybe O(n^{1/2} log(n)). Since physical objects have sizes, and moving things (or moving between things) takes time proportional to distance).
EDIT: My earlier analysis was wrong (it assumed you never move the beeping item after the initial halving), but the conclusion was right for a different reason: Each time you move items, you move half as many as you did last time. You initially move n/2 items, and the geometric series n/2 + n/4 + n/8 + ... + 1 sums to n-1. So O(n) moves are done, and this dominates the log n term for the number of steps.
O(log n) is if you can split the collection in half in an O(1) step, like, *shoving* the whole pile together as a unit
O(n) if you're moving items one at a time. So, splitting the pile in half once is O(n)
O(n^{3/2}) if the project is way out of control and walking distances start to matter
Alternatively, no.
I'll see myself out...
Edit: good ol 5273
I've personally had to track down a beep before and used a similar technique as you suggest: time the beeps then be in right place to perform a kind of binary search to home in on it. I found a smoke alarm in the roof space above my flat, nailed to the top of the rafters that had been there since the building was built 20 years prior. It was annoying but I'm sure it took way less time and effort than "getting AI to do it".
A few examples
dotnet does not work on OpenBSD, so to run jellyfin (supported by the infuse app on the apple tv), I have to run Linux. I wonder if I can replicate the API somehow
calibre is quite nice, but I don’t use much of its capabilities. I could try to make a simpler system for my use cases.
And so on.
I spelled it out a bit more on Bluesky etc:
> There is a mysterious intermittent beep coming from somewhere in your room of unopened boxes. Do you:
> 1. Open the boxes methodically one by one until you find it
> 2. Vibe code software that lets you set up two laptops, two iPads and a phone in various points around the room to triangulate it
https://bsky.app/profile/simonwillison.net/post/3mzvuqd4ndk2...
What use could a teacher make of a locator system, if students could identify their location and desire to be singled out for a moment, by simply clapping once?
In a big auditorium, a spotlight could track over to the student, who could then ask a question.
And/or, directional microphones could zero in on the student so the question could be played on the PA system.
You're trying to catch a fly that's been tormenting you. You clap your hands together to catch it, but it slips out. The motors on the spotlight whir. "No no no, cancel cancel!" It's too late. Your hunt now has an audience. The spotlight is on you. Your classmates are calling out when they see the fly, cheering your swats, and groaning when you miss. Even the professor is silently praying for your victory so they might be able to regain some semblance of control over the class.
Of course it can analyze audio. I made it detect Marijn Frank saying a high pitched "Hallo" in a much better way that I could have done myself (subtitle matching), namely by frequency analysis, in the process learning how that works with librosa: https://marijnfrankzegthallo.nl
I didn't have birdnet to hand and wanted to identify something. It was hard to take a picture with my phone but easy to record. Turns out one of the models was able to identify it.
I guess the Americans might appreciate gunshot identification and localisation or someone might drive around in winter/summer recording the streets to listen for heat pumps that are on the way out so they can advertise repair services. I would like a local version for movement/presence detection based on footsteps as an alternative to having pir sensors all over the place for my hall lights.
https://neufangled.com/payload
Simon’s microphone configuration is very similar except instead of payload kg it would be affecting detection accuracy.
I wonder why the accuracy was an OOM outside the expected result (40cm vs 7mm)? Also using claps for calibration of unknown devices feels like a different approach to measuring distances between devices with a tape and solving the polygon. How many devices would be needed to self calibrate — 1x beep and Nx listening — instead of relying on smudgy claps? Or maybe every sound is smudged in a room filled with boxes?
But I don't know why the rough location was required, given the 0.7cm distance measure between devices. And then one difference between the paper and the application is that in the paper the beep comes from the recorder, and in the application one "chirp" comes from one of the recorders and the second beep comes from a non-recording source.
Carbon monoxide is only produced when it's burned and builds up. And is obviously very dangerous. But a small gas leak building up over time or an oven pilot out and left on is not great for you either.
Make sure you place it relatively near the ceiling as it pools up there apparently. Saved my life during Covid lockdowns
"The system worked as intended. It gave me the position of the beep to within about 40cm, then I dug through that specific pile of boxes and found an ancient carbon monoxide detector that desperately wanted its batteries replaced."
Maybe I should have asked Claude to help triangulate it for me.
On the other hand, warning calls are often spectrally complex. Think of a cat's hiss: it's nearly white noise, one of the easiest sounds to locate. By telling another animal exactly where you are, you project your confidence that you're able to win a fight.
What I've been finding is just setting AI loose like this doesn't give me any of that. I've decided not to think, so I don't feel any struggle. No struggle means no relief, no feeling of accomplishment. I also don't learn anything because AI read the paper for me. Learning is what I live for.
There is no world in which I would have spent the days (more likely weeks) necessary to learn enough about audio analysis in both JavaScript and Python and the WebAudio APIs necessary to build this thing, just to help me identify an annoying beep.
Thanks to coding agents, I got to build a wildly ambitious system that still taught me a bunch of interesting things about audio analysis and network web application design, all in about an hour and a half of clock time.
The alternative wasn't learning those things at increased detail, it was not learning anything about them at all.
And I added more tools to my tool belt for the future. I now know that it's possible to measure distances to sounds using cheap devices over a network, and I've got code in a GitHub repository that shows exactly how to do that.
The trick where the server could inject additional JS modules into the clients without needing to refresh the page (and hence lose the microphone permission) was neat, too.
I don't believe you learnt anything to any appreciable depth in 1.5 hours. I guess you learnt what's possible, but not much more. I get it, learning is learning and you got 1.5 hours' worth. Fair enough.
The bit I struggle with, though, is celebrating things being easy. I'm not excited by easy things. I like hard things. It's a bit like reading an account of how easy it was doing the Alpe d'Huez in a car. I'm more excited by people cycling up it because I know how difficult that is, or building the car. But driving it? Meh.
I do wonder if I'm descended from the people who built Stonehenge. I get restless if things are too easy. I need something hard, like erecting huge stones. But damn it's been nice being able to get that kind of satisfaction just sitting at a desk.
Was starting to drive me absolutely bonkers.
Then I saw a neighbour up a couple of houses reversing their SUV into their drive - it was the proximity sensor beeping - they had reversed with their car so many times that they'd become masters at performing the manoeuvre so the noise was always the same: "beep beep beepity beep beep beeeeeeeeeeeeeeep"
How loud does that noise need to be though?!
https://www.youtube.com/shorts/ai1gIWacf0I
It costs ~$1,000 so you'd probably rent it if you're only going to use it once, but it's a neat gadget.
https://www.minidsp.com/applications/usb-mic-array/acoustic-...
Lmk if anyone has any questions about it! It’s android-only, but I’ve gotten an agent to write a Mac version of it though haven’t tested yet.
eBay link to what I bought: https://www.ebay.com/itm/960060893216
In my case it identified that the likely beep was about every 62 seconds pretty quickly - then I confirmed that one of the recordings was the mystery sound and it locked in from there.
In fact about:processes is a good enough replacement: just sort by CPU usage descending and you'll find the source in the top 5.
In the meanwhile, every day around 10AM (sometime after, or later if I happen to not log in in the morning), my Mac makes a super loud DING! DING! sound, like a boxing match just started or a cable car trolley is about to pass through. I've tried using the Console and combed through the launchd.log to no avail. :)
One time, the guy was hiding under a pile of debris in the woods next to a high school. We found him at night time. I'll never forget it.
This is an excellent use of LLM generated code.
The post touches on my biggest pet peeves about how many software engineers currently use AI at work: they ask it to "write out a problems.md file describing the problem we want to solve" then lob the output over the fence for the rest of the engineering org to review, often times without even disclosing they used AI to generate it (it's, of course, obvious).
AI can not do the reasoning for us; thinking that because it is great at writing code that works, the same applies to documents whose primary purpose is to demonstrate critical thinking, explore trade-offs, and reason through a problem is absurd.
In fact (or IMO?), this "problems.md" document is entirely unnecessary. In many cases, simply describing the issue and providing the relevant context is enough for AI to come up with a working solution.
AI can not do critical thinking (yet), so don't ask it to (and stop sending your fellow software engineers AI-slop RFCs).
This is actually the first time I've told an agent to write out a "problems.md" document - it was an experiment to see if stating the problem provided decent results, as opposed to working directly on a spec.
It did seem to work well though. I was outsourcing as much judgement as possible to the model, and the model did a good job at making decisions that got me to my required end result.
In this case, the AI could do the reasoning for me. Opus 5.5 and Fable 5.2 are really good!
I don't mean to respond to your 'professional work' scenario, but I find it quite useful to first let it draft a PLAN.md, even when "in many cases" it would one-shot some implementation without it. I mostly prompt it with a problem statement, "write a PLAN.md", "ask me any questions in prose and numbered", "don't start implementation until my say-so". The back-and-forth questions are often pretty significant to the final result, and I can (skim) review the plan and make other adjustments.
When you ask most models to write that plan, you see an extended thinking trace similar to implementation itself, but now all the decisions are made up front. If you one-shot it an implementation, those decisions are sprinkled all over the implementation phase, while half of it has been written and some architectural choices have already been locked in. I then frequently adjust that plan to end up (IMO) with a much better implementation, or much better suited to my situation, with less shortcuts.
I really like the idea of sound as automatic maintenance issue detection for cars. You could correlate repetitive noises with wheel speed or engine speed to help narrow down the subsystems involved, or even which cylinder is firing when a sound happens. Even one or two microphones would be helpful. You'd need to be careful not to accidentally record conversations inside the car and leak them to any maintenance tech, though.
Doesn't pick anything or doesn't pick anything that you can hear back? Might still be worth giving for processing to an LLM as some nerd is able to locate a webcam location from the recorded sound and date [1].
If anyone has recommendations for a small USB or Bluetooth mic (since my new phone—that I'll definitely start using, any day now for sure—has no headphone jack anymore), let me know. Not looking for a giant streamer mic, the less space it takes in my electronics box the better
Same brand as my smoke detectors.
Make sounds that can be detected directionally, assholes.
Now, what to do about the neighbor's wind chimes against humanity?
Who would win?? :-)
I lack the courage to plant such a PCB prank device... it really feels like you could drive people completely crazy haha
Maybe the directionality of typical speaker and mic spoils an attempt to apply a 1/r^2 fit?
> Distances only fix the layout up to translation, rotation and mirror image. That doesn't matter for the maths, but the map I'm shown has to match the real room, so the UI needs "rotate" and "flip" controls, or a way to say "Blue is next to the door".
https://github.com/simonw/beep-locator/blob/main/problem.md#...
It was nearly impossible to get decent repeatable results.
You found out you can connect a microphone to a computer and have it record and process the audio? Well I'm glad you can be one of todays 10,000 https://xkcd.com/1053
You didn't.
This was utterly pointless to read. I expected some nice learnings here.
The time you spent on this could've probably unpacked a few boxes and actually been at a better place.
Did you really learn nothing at all from this?