Live data from Hacker News

Fire alarm audio detection, using FFTs and Go

github.com

31–40 of 51 posts

Re: Fire alarm audio detection, using FFTs and Go

#31
post #30

There's a physical product that implements the same idea [1]. I'm not sure how it actually works (presumably there's a patent somewhere, is there an alternative solution?) but it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves. If you're in a building that uses these, you can test yourself by playing a recorded fire alarm sound - they work on quite a few different…

Ubiquiti also has a battery powered alarm-sound sensor in their Unifi Protect lineup[1]

> "Based on UL217 and UL2034 alarm patterns."

UL217 is apparently for smoke alarms, UL2034 is apparently for CO alarms.

https://store.ui.com/us/en/collections/unifi-camera-security...

Re: Fire alarm audio detection, using FFTs and Go

#32
post #30

There's a physical product that implements the same idea [1]. I'm not sure how it actually works (presumably there's a patent somewhere, is there an alternative solution?) but it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves. If you're in a building that uses these, you can test yourself by playing a recorded fire alarm sound - they work on quite a few different…

> it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves

Closing doors on a fire alarm seems hilariously cruel.

Re: Fire alarm audio detection, using FFTs and Go

#33
post #32
post #30

There's a physical product that implements the same idea [1]. I'm not sure how it actually works (presumably there's a patent somewhere, is there an alternative solution?) but it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves. If you're in a building that uses these, you can test yourself by playing a recorded fire alarm sound - they work on quite a few different…

> it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves Closing doors on a fire alarm seems hilariously cruel.

It prevents the fire from quickly moving through the building...

Re: Fire alarm audio detection, using FFTs and Go

#34
post #30

There's a physical product that implements the same idea [1]. I'm not sure how it actually works (presumably there's a patent somewhere, is there an alternative solution?) but it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves. If you're in a building that uses these, you can test yourself by playing a recorded fire alarm sound - they work on quite a few different…

You can also enable fire alarm audio detection on iPhones, HomePods and other home smart hubs.

Re: Fire alarm audio detection, using FFTs and Go

#35

I took a look at the source, as I was curious about how does one perform a FFT of a signal, but stumbled upon this. Could somebody explain to me what this calculation does? ( in is the audio signal, if I'm not wrong) window := make([]float64, len(in)) for i, x := range in { window[i] = float64(x) * (0.54 - 0.46*math.Cos(2*math.Pi*float64(i)/float64(len(in)-1))) Thanks

It looks like a windowing function. Used to turn continuous data into segments of data for FFT processing. https://en.m.wikipedia.org/wiki/Window_function

From that article, that's the original Hamming windows with a_0 = 0.54 and a_1 = 0.46.

> Setting a_0 to approximately 0.54, or more precisely 25/46, produces the Hamming window, proposed by Richard W. Hamming. That choice places a zero-crossing at frequency 5π/(N − 1), which cancels the first sidelobe of the Hann window, giving it a height of about one-fifth that of the Hann window. The Hamming window is often called the Hamming blip when used for pulse shaping.

Re: Fire alarm audio detection, using FFTs and Go

#36
post #35

Earlier quoted context omitted.

It looks like a windowing function. Used to turn continuous data into segments of data for FFT processing. https://en.m.wikipedia.org/wiki/Window_function

From that article, that's the original Hamming windows with a_0 = 0.54 and a_1 = 0.46. > Setting a_0 to approximately 0.54, or more precisely 25/46, produces the Hamming window, proposed by Richard W. Hamming. That choice places a zero-crossing at frequency 5π/(N − 1), which cancels the first sidelobe of the Hann window, giving it a height of about one-fifth that of the Hann window. The Hamming window is often called…

This is the kind of discovery that settles all debate in my mind that I could have ever been an electrical engineer, or any kind of mathematician.

Re: Fire alarm audio detection, using FFTs and Go

#37
post #33
post #32

Earlier quoted context omitted.

> it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves Closing doors on a fire alarm seems hilariously cruel.

It prevents the fire from quickly moving through the building...

Also, people.

Re: Fire alarm audio detection, using FFTs and Go

#38

Earlier quoted context omitted.

yeah using a DSP for this definitely makes more sense - but I'm lacking experience in the field. Same goes for using a discrete band-pass filter. This project is more of an attempt at "how can I build something in 2 hours that works reliably" ! For reference, it eats ~25% of the available CPU resources on my rpi zero 2w - which draws a maximum of 350mA, so this implementation definitely draws less than 1 watt.

1W of continuous power consumption is not great. To put it into perspective: that’s 1x24x365Wh, almost 9kWh per year. A kettle (1.8-2kW) can run for 4-5 hours for that amount of energy. If getting a kettle to boiling takes 5 minutes, that’s almost 50-60 kettles. That’s two month of boiling one kettle a day.

Or, at the rate of $0.30/kWh in California for residential use, $2.70/year. Lowering power usage on embedded devices is important when you're producing thousands, but for a hobbyist it doesn't really matter.

Re: Fire alarm audio detection, using FFTs and Go

#39
post #36
post #35

Earlier quoted context omitted.

From that article, that's the original Hamming windows with a_0 = 0.54 and a_1 = 0.46. > Setting a_0 to approximately 0.54, or more precisely 25/46, produces the Hamming window, proposed by Richard W. Hamming. That choice places a zero-crossing at frequency 5π/(N − 1), which cancels the first sidelobe of the Hann window, giving it a height of about one-fifth that of the Hann window. The Hamming window is often called…

This is the kind of discovery that settles all debate in my mind that I could have ever been an electrical engineer, or any kind of mathematician.

This is pretty much how I feel every time delving into FFTs. Like, I get the concept, but something in my brain just shuts off when it comes to actually trying to grok it. I do however very much appreciate those that have created software where I just provide --input and they handle the rest.

Re: Fire alarm audio detection, using FFTs and Go

#40
post #32
post #30

There's a physical product that implements the same idea [1]. I'm not sure how it actually works (presumably there's a patent somewhere, is there an alternative solution?) but it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves. If you're in a building that uses these, you can test yourself by playing a recorded fire alarm sound - they work on quite a few different…

> it's quite a magic feeling to hear the fire alarm go off and the doors independently close by themselves Closing doors on a fire alarm seems hilariously cruel.

In many large buildings (schools, etc. in particular), you want the internal fire doors to close to keep the fire from spreading. Of course, exits must be provided for each isolated section.
Post reply on HN