software noise cancellation / antisound - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 25th July 2009, 09:15 AM   #1
diyAudio Member
 
Join Date: Mar 2007
Default software noise cancellation / antisound

Not sure if this is digital, or even diyaudio, but here goes.

I've just moved to a new apartment on a foreign assignment in one of those countries that practice open-air aerobics in the morning.

4:45am in the morning.

Their speakers are about 150m away, but big, and I still get woken to the thud-thud-thud of high-energy disco. It's not especially loud, but I'm a light sleeper, and it's loud enough.

Since it's a rental apartment, sound-proofing isn't really an option. I've tried earplugs, but they don't seem to have much effect on the low-frequencies, which are about all that's getting through 150m of park, my walls and windows, anyway.

I'm wondering if some kind of noise cancellation could work, since the source is at a fixed location and volume, I'm only trying to cancel at one particular fixed spot, where my head is when I'm sleeping, and I only need to deal with maybe 100Hz and lower.

I'm thinking along the lines of digital room correction. eg, I'd have a microphone several meters from the bed (maybe even outside), and measure a "room response" between it and a sleeping position (perhaps just record an early morning session, at the microphone, and at the sleeping position, and use software to convolve the two).
I'd have a subwoofer in the general line between source and bed, although I guess the sound is leaking through everywhere - the steel building frame, windows, ceiling and even floor. Again maybe the speaker is a meter or two from the bed, or maybe closer. I'd measure a "room response" between speaker to bed.

Then, combining the two impulse resposes, I should be able to generate a filter for the the microphone signal, that would result in canceled sound at my sleeping position. And given the microphone is several meters "ahead" of the speaker and the bed, and I only want to do the low frequencies, I should have plenty of time to process the microphone signal to generate an antisound signal.

Could this work?
  Reply With Quote
Old 25th July 2009, 09:28 AM   #2
diyAudio Member
 
Join Date: Mar 2007
They also play the same "set" every morning (yes, 7 days a week), so even a fixed "antisound recording" might work, though of course they don't always start at the same time to the microsecond.
  Reply With Quote
Old 27th July 2009, 11:24 PM   #3
Henk55 is offline Henk55  Netherlands
diyAudio Member
 
Join Date: Jan 2009
I have used "Pink-Noise" generated by Audacity played from an mp3 player during the night.
It mask out several disturbed sounds from the surrounding.
But (there is always a but) you have to get used to it, the very first days is difficult!

Thereafter you can't sleep without it (works for me)!
  Reply With Quote
Old 29th July 2009, 03:25 AM   #4
diyAudio Member
 
Join Date: Mar 2007
Thanks Henk55, I'll look into it. Isn't pink noise what they use for torture though?
  Reply With Quote
Old 29th July 2009, 07:00 AM   #5
diyAudio Member
 
Join Date: Mar 2007
Also it's the repetitive thump-thump that wakes and annoys, I wonder if simply inversely-modulating the noise generator to the level picked up by microphone would help mask any rhythm - ie not actually trying to cancel individual waves would be a big simplification.
  Reply With Quote
Old 29th July 2009, 07:45 AM   #6
diyAudio Member
 
Groundloops's Avatar
 
Join Date: May 2004
Location: fubar Germany.
That works for me:

http://www.ohropax.de/9-1-classic.html

Give it a try in the way as follows: Cut one piece into halves or thirds (depending on the diameter of your external acoustic meatus) and knead them into longish cones, insert in your ear, cram a bit and enjoy the silence. Itīs recommended to use them only once, but each does several times.

Good night, sleep tight, don't let the bedbugs bite.
  Reply With Quote
Old 29th July 2009, 07:59 AM   #7
diyAudio Member
 
Groundloops's Avatar
 
Join Date: May 2004
Location: fubar Germany.
That works for me, suffering from moron neighbourhood (thud-thud-thud-oomph-oomph-thud-clash-bang-blast-explode ...):

http://www.ohropax.de/9-1-classic.html

Give it a try in the way as follows: Cut one piece into halves or thirds (depending on the diameter of your external acoustic meatus) and knead them into longish cones, insert in your ear, cram a bit and enjoy the silence. Itīs recommended to use them only once, but each does several times.

Good night, sleep tight, don't let the bedbugs bite.
  Reply With Quote
Old 30th July 2009, 08:23 PM   #8
diyAudio Member
 
Join Date: Mar 2003
Location: Mountain View, CA
Quote:
Originally posted by jackpipe
I'm wondering if some kind of noise cancellation could work
Ah, sounds like a near-ideal application for an adaptive noise canceller. Do you happen to have two microphones, a loudspeaker, and the facility for some real-time signal processing? If so, I imagine something relatively successful could be made to work based on an adaptive filter.

Try looking up the LMS (Least Mean Squares) or, if you have lots of computing power, the RLS (Recursive Least Squares) algorithms. They're relatively simple to code up, too.

In essence, place one microphone near (or even outside) your window, and the other close to where you sleep, along with the loudspeaker. The signal from the outdoor microphone is then run through an FIR filter, and the output inverted and sent to the speaker. At the second microphone (and, of course, your own head), the original outdoor sound and the loudspeaker's output are summed. The LMS/RLS system will adapt the coefficients of the filter to try and minimise power of this sum.

Since in this case the disco music audible inside your room is going to be a filtered (by your walls) version of the music captured by the outdoor microphone, I imagine the system would perform very well.
__________________
Wingfeather
  Reply With Quote
Old 31st July 2009, 02:53 PM   #9
diyAudio Member
 
Join Date: Mar 2007
Wow thanks Wingfeather, that is exactly what I was looking for. The setup you describe is exactly what I had in mind, but I couldn't find how to get the FIR filter.

All the digital room correction systems seem to use a log sweep signal of some kind to do the measurement, and that would mean putting a signal speaker where the outside microphone is, and would probably be quite inaccurate - also they don't measure the absolute delay between outside microphone/speaker and measurement microphone.

Just one question - can you "freeze" the adaptively-generated FIR filter in some way, does that even make sense? Or should the system run adaptively always. I'm guessing just running the signal through a "frozen" fir filter is less intensive than running the adaptive algorithm all the time (ie I could temporarily ship in a big machine to do the measurement), not to mention the issue of having a microphone on the pillow...
  Reply With Quote
Old 31st July 2009, 09:01 PM   #10
diyAudio Member
 
Join Date: Mar 2003
Location: Mountain View, CA
Generally speaking, this kind of system is run adaptively all the time. This is nearly always the best thing to do: the update equations are not computationally expensive, and any changes to the acoustic transfer function (maybe you accidentally knock the reference microphone after you've set the system up or something) are adapted to.

Also, the delay between the outdoor microphone and the pillow microphone is accounted for - it comes out in the wash with the adaptive filter, and you're free to move things around during operation to find the best placement. Accounting for the delay does mandate a long filter if the two microphones are a long distance apart, which could be expensive - but if you know approximately the delay you're expecting you could add in a delay line to take care of the buik of it.

In terms of needing a microphone actually on the pillow, you don't need it to be that close. It all depends what kind of bandwidth you want to cancel out, as this approach is most effective at low frequencies. So long as the pillow mic is "relatively close" to yourself at the highest frequencies you want to cancel (in terms of phase difference), the system should be relatively effective. Indeed, you should actively bandlimit the signals (a 4th order lowpass or so is probably sufficient) so that this is satisfied.

If the pillow microphone is about a meter away from you, I imagine you should get good results at ~150Hz and down, give or take.

In terms of microphone placement, imagine a line drawn from the distant loudspeakers to the pillow microphone and beyond. I *think* that arranging the loudspeaker somewhere on this line will give the broadest sweet-spot (but I'm not in a position to think that through properly right now).

Do you have/use MATLAB at all? I have some code I could send you.
__________________
Wingfeather
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer white noise generator, which software? Bricolo Everything Else 16 6th April 2010 12:50 AM
Active noise cancellation for a computer? MikeHunt79 Everything Else 0 3rd April 2008 11:54 PM
Active Noise Cancellation gcladis Pass Labs 4 28th June 2006 12:36 AM
software 1/3 octave pink noise generator deandob Multi-Way 6 25th March 2006 07:05 AM
Active Noise Cancellation manse Everything Else 7 31st March 2003 05:57 PM


New To Site? Need Help?

All times are GMT. The time now is 01:21 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright Đ1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2