Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
ASK HN: Perfect noise cancellation of loud music in the gym?
9 points by fud101 on Aug 25, 2022 | hide | past | favorite | 19 comments
Is it possible to create a system which can perfectly cancel the playback of a known piece of music. Like if you're playing Avici, since you know exactly what is coming next, should it be possible to automatically?


Let me preface this all with: I’m not an expert, and this is based on my intuition and understanding of noise cancellation technology and how sound works. I’m an idiot, take this with a grain of salt.

I dont think this is really possible, but probably not for the reason you think.

Noise cancellation works by picking up surrounding sounds using microphones and then generating the same sounds 180 degrees out of phase. So, we could get rid of the microphones processing sounds in real-time and instead we use something that can identify the song (like Shazam) as well as the position in the song, and then use reference audio for that song to play it back out of phase. So sure, that seems at least possible.

But the audio file itself _doesn’t describe exactly what you hear_. The acoustics of the room, your position in the room, the speakers, the amplifier, and I’m sure many other things all color and change what you’re hearing. In short, I’m not so sure that raw audio data out of phase _actually_ matches what you’re hearing in all situations. You’d still want a microphone.


i didn't even think of the situation without a mic but you've opened my mind to that possibility! I agree with your assessment about perception.


I used to patronize a gym that had music and thought I was better off without it. That gym closed and I started going to the local YMCA gym, which has no music of any kind. Now I get the pleasure of hearing:

- the people who grunt at the top of a rep

- the people who grunt throughout each rep

- the people who mutter the lyrics to the angry rap-rock in their heads

- giggling teenage boys who gather around the bench press and never do a rep


It’s like asking which is the best mask to mask smoke at a cigar lounge / bar! Perhaps it’s possible - I’ll let sound experts chime-in, but I think opt-in is a better approach!

The loud 80s club style music is outdated and made sense before iPods / smartphones etc with individual custom playlists and thousands of songs on-demand.

Gyms should really provide headphones or Bluetooth or better yet online radio station to connect to if you ever want to hear their music (even remotely at home gym) and at your desired volume level, just like airplanes do! Quite airports like Dubai International is an awesome library-like experience especially when you have a long layover compared to regular noisy airports.


“Canceling out” requires knowing the exact phase of the sound hitting your ear, so that you can cancel it by playing a sound 180 degrees out of phase.

First problem: Your system needs to be perfectly synced up in time with the known sound being played. Human hearing goes to ~20KHz, so you need to be synced up with an error of <0.1 ms per second, probably much less. That’s gonna be tough.

Next problem: as you move around the room, your distance to the speaker changes, and you go out of phase. So you need positional data for your ears with sub-centimeter accuracy.

Can we get rid of the first two problems by using a microphone to detect the signal and auto-correct its phase as you move? Maybe but then you need an incredible algorithm to be able to pick out the correct part of the signal from all the background noise and echoes, plus it has to run in real-time at high sample rates. Very very difficult.

Then even if you solve these issues, you also have to cancel the echoes of the song bouncing off the walls etc. If you’re trying to take advantage of the fact that it’s a “known song” you then need an extremely good model of the room you’re in to predict how the sound will bounce.

In short, I suspect it’s “theoretically possible” but completely infeasible.


For a known piece of music some if these problems go away, don't they?

Regarding sync response time I don't think that's so much of an issue because after you recognize the song you know what the future waveform will look like in advance.


You know roughly what the future looks like, but it only takes a tiny (sub-millisecond) amount of error (due to user movement, clock drift, wireless lag etc etc) to throw the phasing off and ruin the effect. So you still need some combination of precise modeling/listener positional data and/or a sophisticated algorithm that uses an input signal to detect and correct the error and keep you “out of phase”


The best way to cancel loud music is by canceling your gym membership and moving to another place.


This. And tell the gym why you're cancelling. I don't understand why any gym thinks playing music is a good idea in a world where nearly everyone is bringing their own audio players anyway.


> moving to another place

Like the woods?


No, it is not. For one good reason, you will not be static. As you move through air your noise reduction system would need to precisely re-adjust, in real-time. The technology just isn't there. Headphones that do reduce noise reduce best sounds that are more or less uniform, like continuous motor hum. I work with music and I hate unnecessary music, it's a scourge. I have successfully argued at many non music venues, cafes, restaurants, gyms, to at least unplug some speakers so there is respite for those who wish to talk and enjoy their own music, or none. Have you made any progress?


I thought about this a lot, it's possible, but you aren't ignoring 90% of all the sounds in the gym. Without a predictive system or an instant computer you can't get all the noises cancelled correctly, just the music. The music also bounces off walls, so if you remove the Avici direct from the speaker, you'll hear echos from the reflection.


It's technically possible using advanced, cumbersome positioning equipment. However, it is not feasible or practical at all.

The best I've found is ANC over-ear headphones along with brown noise, for my hearing profile. Pink noise may or may not work better for you, depending on your hearing abilities and the type of music being played.


Perfectly, no, but you'd be surprised how good passive noise cancellation is. Try out an Etymotic IEM with the triple flange eartips.


I desperately want this too! In my case when stuck in a car and other people insist on playing music. That's probably easier because I'm not moving relative to the speakers.


Bad news is loud ambient sound vibration travels through your bones, so you need more than noise cancelling, which means a louder sound and that will damage your hearing.


are you OK to wear closed-can earphones? If so one of my tricks is:

1) put in silicone earplugs

2) wear noise cancelling headphones (Sennheiser seems good to me)

3) crank your music at 30% louder than you would normally


I got tinnitus doing this, at least I think I did!


Ya System of a Down, and turn it up to 11. Get some c4 pre-workout too.

LIGHT WEIGHT BABY.




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

Search: