Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Input Devices Open Source

80FFTs Per Second To Detect Whistles (and Switch On Lights) 156

New submitter Mathieu Stephan writes "Hello everyone! Some people told me that my latest project might interest you. I'm not sure you publish this kind of projects, but here it goes. Basically, it is a small platform that recognizes whistles in order to switch on/off appliances. It will be obviously more useful for lighting applications: just walk in a room, whistle, and everything comes on. The project is open hardware, and all the details are published on my website." The linked video is worth watching for the hidden-camera footage alone: it would be hard to not keep playing with this sensor.
This discussion has been archived. No new comments can be posted.

80FFTs Per Second To Detect Whistles (and Switch On Lights)

Comments Filter:
  • by Vombatus ( 777631 ) on Wednesday May 08, 2013 @11:52PM (#43672159)
    What could possibly go wrong?
  • by Dan East ( 318230 ) on Thursday May 09, 2013 @12:01AM (#43672197) Journal

    Interesting idea, but I think there would be serious scalability problems. Imagine if this was in each room in your home, and the doors to the rooms were open. Whistling in one room would almost certainly trigger the lights in the adjacent rooms as well. You would run into similar issues trying to control multiple lights in the same room independently, unless you started getting into more complex whistle patterns then those shown in the video. In that case you would start to sound like a songbird, or maybe R2D2.

    And finally two side notes...
    Not for use in emergency situations while eating saltine crackers.
    This method of controlling the lights would be extremely popular in the von Trapp house.

    • The real danger is watching Star Wars with these in the room. *R2 sad whistle*

      • by Molochi ( 555357 )

        Funny. But the last time I tried using any kind of auditory control I found that I would have to give up music and movies to get it to work.

    • by account_deleted ( 4530225 ) on Thursday May 09, 2013 @02:44AM (#43672737)
      Comment removed based on user account deletion
    • Re:Multiple rooms (Score:5, Insightful)

      by gnasher719 ( 869701 ) on Thursday May 09, 2013 @03:13AM (#43672821)

      Interesting idea, but I think there would be serious scalability problems. Imagine if this was in each room in your home, and the doors to the rooms were open. Whistling in one room would almost certainly trigger the lights in the adjacent rooms as well.

      Typical slashdot combination of the Nirvana fallacy (a solution that isn't 100% perfect is not acceptable), and a totally defeatist attitutude to technical problems.

      • by Hentes ( 2461350 )

        In a case where we already have a 100% perfect solution, then of course it's unacceptable.

      • Typical slashdot combination of the Nirvana fallacy (a solution that isn't 100% perfect is not acceptable), and a totally defeatist attitutude to technical problems.

        It's not a defeatist attitude towards technical problems. It's a jaded belief that, sometimes, just throwing technology at a problem doesn't get you a better solution, just more technology.

        Like Microsoft's "house of the future" or whatever it's called -- sometimes it seems like technology for the sake of having more technology, not because it's

    • Hi! Actually if you put one whistled in one "inside" room corner this won't happen :) The microphone is omnidirectional, but not that much :)
    • Imagine if this was in each room in your home, and the doors to the rooms were open.

      If you want to separate a signal based on multiple sources, then there are algorithms for that.
      Have a look here: http://en.wikipedia.org/wiki/Kalman_filter [wikipedia.org]

      This type of filter has been used, for example, to separate the heartbeat signals from a mother and her fetus, using multiple sensor elements (one close to the mother's heart).

  • by crankyspice ( 63953 ) on Thursday May 09, 2013 @12:03AM (#43672199)

    http://www.washingtonpost.com/wp-dyn/content/article/2007/02/16/AR2007021602102.html

  • by SuperKendall ( 25149 ) on Thursday May 09, 2013 @12:03AM (#43672201)

    Just whistle while you work!

    WShreee.... Click!

    *Dammit*

  • by ls671 ( 1122017 ) on Thursday May 09, 2013 @12:04AM (#43672215) Homepage

    I remember seeing a whistle device that you attach to your key ring. When you lose your keys, you whistle and your key ring beeps.

    https://www.amazon.co.uk/Tobar-Keyfinder-Keyring-Whistle-Activated/dp/B000246JIQ [amazon.co.uk]

    • by mvar ( 1386987 )
      Now that's a blast from the past..in the 80s these were quite popular
      • Now that's a blast from the past..in the 80s these were quite popular

        I don't think they were popular back then. While I saw them on late night television commercials all the time, I never met anyone who actually owned one.

        • A blast from the past indeed. [youtu.be]
        • Now that's a blast from the past..in the 80s these were quite popular

          I don't think they were popular back then. While I saw them on late night television commercials all the time, I never met anyone who actually owned one.

          I did :)

          My dad bought a bunch of these for next to nothing in the late eighties, and I gave a few to friends. After the novelty factor wore off, however, no-one used them. People don't really mislay their keys a lot, and they were somewhat bulky on the keychain.

    • I remember seeing a whistle device that you attach to your key ring. When you lose your keys, you whistle and your key ring beeps.

      https://www.amazon.co.uk/Tobar-Keyfinder-Keyring-Whistle-Activated/dp/B000246JIQ [amazon.co.uk]

      Yes it is a problem that can be solved with very simple analog electronics. That was my first thought when I read the summary, but I guess that wouldn't be cool today.

    • by dgatwood ( 11270 )

      Even funnier is putting a bunch of those things in the same room, whistling, and laughing as they set each other off. Bonus points if you do this on the shelf at Wal-Mart.

    • by Inda ( 580031 )
      I bought a friend one because he's always losing his keys; losing them at my house *facepalm*

      It goes off when he's got the radio on, when a door creaks, when dogs bark, when his phone goes off... Well worth the couple of quid I spent on it. muhahaha
    • Except that for the one that I had you had to whistle something very close to a B-flat.
  • Kids These Days... (Score:4, Interesting)

    by lobiusmoop ( 305328 ) on Thursday May 09, 2013 @12:19AM (#43672275) Homepage

    They've got so much cheap compact compute horsepower to play with, it's almost obscene. 2048-wide FFT? In my day you would be overjoyed with a simple time-domain autocorrelation pitch detector.

    (Lawn, etc...)

    • Reminded me of the formulas and tables in ye olde CRC Handbook. Neat project, tho.

    • by jmv ( 93421 ) on Thursday May 09, 2013 @02:13AM (#43672655) Homepage

      Actually, an FFT is often cheaper than autocorrelation because it's N*log(N) whereas auto-correlation is N^2. In any case, it's insanely cheap on today's machines.

      • You can do auto- and crosscorrelation in linear time in frequency domain.

        • by tlhIngan ( 30335 )

          You can do auto- and crosscorrelation in linear time in frequency domain.

          ... and given a time domain signal, how are you going to switch it to the frequency domain without using an FFT or DCT? The goal is to avoid using a transform...

      • by tibit ( 1762298 )

        Not only that, but really FFTs and similar transforms are everywhere. Long FIRs? You need FFT. Correlators? Too. Polynomial multiplication? Yep. Long integer multiplication? Yep. The list goes on and on.

    • I'd just go with a small handful of analog tuning circuitry. From the article (can't watch the video currently), it sounds like the device detects a two-tone whistle and toggles a relay. That's not terribly hard to do with two adjustable tuners, some voltage comparators, and a few other bits for cleaning.
      • by tibit ( 1762298 )

        Yep, but the tones are arbitrary and I just can't help how people miss this key property. The tones can by at any of a range of frequencies.

        BTW, you can do FFT in analog domain quite simply, it just requires a lot of buffers. Multiplication by a constant is done by resistor dividers, addition requires a buffer stage. Easy-peasy. A bare bone time-discrete but voltage-continuous, lower accuracy FFT could probably be done with emitter followers for buffers :)

  • If this device becomes a commodity found in every home, it will spawn a whole new generation of pranksters who will sneak up to houses and "hack" the lighting and appliances with a whistle. We'll wind up needing two-factor authentication for our whistle-houses.

    • by isorox ( 205688 )

      If this device becomes a commodity found in every home, it will spawn a whole new generation of pranksters who will sneak up to houses and "hack" the lighting and appliances with a whistle. We'll wind up needing two-factor authentication for our whistle-houses.

      Just like the problem of people waking around firing infrared through the window at your tv and changing the channel?

      • by macraig ( 621737 )

        I hate when that happens!

      • I know you are kidding, but this actually happens to me all the time. Damn kids.
        • by isorox ( 205688 )

          I know you are kidding, but this actually happens to me all the time. Damn kids.

          Did you tell them to get off your lawn?

      • I love driving down a neighborhood and using my TV-B-Gone to turn off people's TV sets. It's really good at a bar during a big game. Once I even used it at a Vegas casino on the giant TV's for the betting on horse races and other sports. Good times!
  • Just hook up your microphone to a schmidt-trigger. Your output will have your dominant frequency in it. Often the inputs of your microcontroller will already have schmidt-triggers, look at the data sheet, if not get a controller with a built-in op-amp.
    Then just count the zero-crossings, by having one timer count them, and having another timer regularly looking at the output of the first counter.

    The great advantage is that you can use much cheaper microcontrollers, which need much less power and have much l

    • And what will you do with a noise that randomly falls into the frequency window?

      • Well low noise would not trigger the Schmidt-Trigger. Noise that will trigger it will trigger it randomly. so you'll end up with a frequency of zero crossing that randomly changes.

  • We can tell you've got teh True Geek... ...a normal guy would have made it make the girls' knickers fall down.

  • I can whistle and get a sandwich, now that I'm married.
    Sometimes I have to added "sudo" before it, though.

  • by Anonymous Coward

    I can't whistle!

  • In my day we would use a couple of IIR filters, instead of FFT's. Much faster, better control over bandwidth. But, hey, then you'd actually have to do some math to design them....
    • FFTs will allow the analysis of all frequencies up to half the sampling frequency using a single algorithm per execution. A processing method using IIR filters can only be used for a single band/filter. If whistles were the sole application I would agree with you(heck, I'm just a 27 old recently graduated from my PhD course and I think I could do that using only analog components). But the developer himself talks about other applications that could use other sounds. Instead of implementing and executing dif
      • by Viol8 ( 599362 )

        "our hardware can handle "bloat"."

        Your average modern car could probably handle carrying half a ton of lead in the back and still out accelerate the equivalent from the 60s. Does that make it sensible to carry the lead around when you could quite easily take it out - ie make the car much more efficient and even faster?

        • Your analogy is bad.

          The lead neither improves development time nor adds to the flexibility.

          The FFT does both, so yet it is worth it.

          • by Viol8 ( 599362 )

            Yeah , right.

            That attitude is why american "sports" cars like the corvette , camaro or mustang use huge gas guzzling V8 engines because its cheaper to just chuck in something off the shelf than spend time optimising it and ending up with something more efficient and powefull.

  • Puts me in mind of a breaking-glass detector my rather naive (in electronics terms) boss came up with in the early 1980s as a security device. Technology wasn't really up to FFTs or anything in those days, so it had two filters, one to detect the low frequency 'thump' of whatever hit the glass, followed by the high frequency 'tinkle' of when the pieces hit the ground, after a short delay which was also considered. It did work given ideal conditions, but in practice was extremely unreliable. I wonder why?
    • Seems like a clever idea to me even if there was too much enviromental variability for it to succeed. Pressure mats and other affordable 80s style security devices weren't exactly reliable or hard to foil either.

      Presumably you had a far better solution so why not fill us in about it?

  • /reads article, whistles appreciatively.

    /power goes out
  • You might want to check this out at the patent office first, there was a device I remember from the late 70's, early 80's very similar to the "Clapper" called "The Whistle Switch" that did exactly the same thing.

    You plugged it in the outlet then plugged whatever appliance (typically a lamp) you wanted to turn on or off. It came with a little whistle that had a squeeze bulb on it that you would produce a high pitched whistle and toggle the device on and off.

    You could also reproduce tone whistling with your m

  • In China it is quite common to have something similar: the lights in communal areas, like on staircases in apartment buildings, switch on when you make a noise, like clapping your hands or stomping your feet. Or, as I can attest, if you fart loudly enough.

  • So it's basically The Clapper, except with whistles? How soon will we start seeing infomercials for it?

  • For their trains in 1968.

    http://www.youtube.com/watch?v=QTF1Gq5V6Mo [youtube.com]

  • ...Robert Adler's [wikipedia.org] Space Command television remote control which used struck aluminum rods to generate ultrasonic frequencies detected by the set.
  • And another one for detonating the little explosives. (Obligatory "The Living Daylights" reference)

  • I have a parrot, you insane bastard! Are you trying to blow up my house?

  • "As a representative of the RIAA, we'd like to buy your whistle-recognition technology. We think we could make tens of millions of dollars each year by suing people who whistle our songs as providing unlicensed public performances. We'll give you as much as $200.00 for complete ownership of your patents!"

  • I can't whistle, but even if I could, I'd much rather say, "Computer, lights!"

Keep up the good work! But please don't ask me to help.

Working...