Parodies of the popular song “Do the Harlem Shake” tend to feature people just dancing a little bit until they hear a deep-voiced artist say, “Do the Harlem Shake.” Then they go wild. What if you wanted your robot to start dancing madly? Wouldn't it be nice to have a circuit that could detect and active your animatronic friend at the appropriate point in the song?
I used ViaDesigner to design and simulate the circuit to do just that. This simulator can be used with analog, digital, or mixed signal circuits. In the video (below), a high-level mixed signal circuit is designed and simulated. The circuit successfully indicates when the “Do the Harlem Shake” phrase is first spoken in the song.
ViaDesigner is very convenient to use. It contains the schematic capture function (an obvious starting point). It has a simulator with the features you will likely need, such as active filter simulation. In this case, I used the filter wizard to create a bandpass filter. I also created the comparator and the D-flip-flop.
The circuit simulation accepts signals from the real world. In this case, the circuit “plays” the song from a file-based voltage source that generates a “music” waveorm from raw wavefile (or .wav file) values. This music waveform contains all the frequency components of the song. To isolate the low-frequency energy, the “music” signal is sent through a 10th order continuous time bandpass filter. The filter attenuates frequencies outside of the 100 to 200 Hz range. The output of this filter shows the presence of low-frequency content in the song. Since the “Do the Harlem Shake” voice is so low (100 to 200 Hz) it will have higher output voltages when he starts talking.
The output of the bandpass filter is then applied to a voltage comparator with a fixed reference voltage. When the output of the filter exceeds this threshold voltage, the comparator output goes high and clocks a D-flip-flop, asserting the DO_THE_HARLEM_SHAKE signal. Note that there is other additional low-frequency content in the song, but the deep voice is the first instance of such low-frequency content. The DO_THE_HARLEM_SHAKE signal is what you use to drive your robot's electronics.
If you embed external videos (e.g., from YouTube), center them and give them a height of 288 and a width of 480.
Some points to highlight:
- The filter was created with a ViaDesigner filter wizard;
- The comparator and flop were made from ViaDesigner wizards as well;
- Pretty cool little simulation because it contains eight seconds of integer audio being processed by a 10th order bandpass filter combined with a comparator and digital circuit;
- And, it doesn't take a several days to complete.
Yes, this is a horribly naive circuit: Audio voltages are assumed to be well behaved, fixed slicing threshold is used, and the circuit cannot distinguish between other low-frequency signals.
So, you think you can design a better Harlem Shake detector circuit? Sure, you could do better, so download ViaDesigner and try. If you need any help getting the waveform generator working let me know and I'll show you how to generate the waveforms. Share your “Do The Harlem Shake” detector circuit with us.