Thumbs-Down Songs on Pandora with Your Mind

[Steven] likes music. Like many of us, he uses Pandora to enjoy the familiar and to discover new music. Now, Pandora means well, but she gets it wrong sometimes. [Steven] has had a Mindwave Mobile EEG headset lying around for a while and decided to put it to good use. With the aid of a Raspberry Pi and a bluetooth module, he built a brainwave-controlled Pandora track advancing system.

The idea is to recognize that you dislike a song based on your brainwaves. The Mindwave gives data for many different brainwaves as well as approximating your attention and meditation levels. Since [Steven] isn’t well-versed in brainwavery, he used Bayesian estimation to generate two multivariate Gaussian models. One represents good music, and the other represents bad music. The resulting algorithm is about 70% accurate, so [Steven]‘s Python script waits for four “bad music” estimations in a row before advancing the track.

[Steven] streams Pandora through pianobar and has a modified version of the control-pianobar script in his GitHub repo His script will also alert you if the headset isn’t getting good skin contact, a variable that the Mindwave reports on a scale of 0 to 200.

Stick around for a demo of [Steven] controlling Pandora with his mind. If you don’t have an EEG headset, you can still control Pandora with a Pi, pianobar, and some nice clicky buttons.

[Read more...]

FFT On The Raspi’s GPU

fft

The Raspberry Pi has been around for two years now, and still there’s little the hardware hacker can actually do with the integrated GPU. That just changed, as the Raspberry Pi foundation just announced a library for Fourier transforms using the GPU.

For those of you who haven’t yet taken your DSP course, fourier transforms take a function (or audio signal, radio signal, or what have you) and output the fundamental frequency. It’s damn useful for everything from software defined radios to guitar pedals, and the new GPU_FFT library is about ten times faster at this task than the Raspi’s CPU.

You can get a copy of  the GPU_FFT library by running rpi-update on your pi. If you happen to build anything interesting – something with a software defined radio or even a guitar pedal – you’re more than welcome to send it in to the Hackaday tips line. We’d love to see what you’re up to.

Hackaday Links: October 27, 2013

hackaday-links-chain

[Kyle] came across a project which he thinks is “simply elegant”. If you don’t already have a PCB vice, here’s an easy way to build one of your own.

This one’s so good but alas it’s not a hack. Check out the slideshow tour at UC Boulder’s Fiske Planetarium. You get a really cool look at the hardware that makes the dome and projector such a great experience. [via Reddit]

Here’s a schematic and a couple of snapshots of [Trax's] CAN bus hacking rig. He plans on doing a tutorial but decided to share this link after reading the first part of our own CAN hacking series.

These strings of LEDs bump to the tunes. [Alex] is using GrooveShark as a frequency analyzer, then pushing commands via Node.js to the Arduino controlling the lights. It’s all planned for the back porch during his Halloween party.

We remember drilling holes in the 3.5″ floppy discs (we even made a wood jig for this) to double their capacity. A similar blast from the past was to punch a notch in the larger 5.25″ versions to make them double-sided.

If you’re trying to learn about FFT [Ronald] highly recommends this website. We didn’t do too much poking around because it’s kind of strange. But if you do get sucked in and have fun with it leave a comment to let others know it’s worth their attention.

We suppose that using 39 Raspberry Pi boards and their camera modules isn’t the worst way to build a huge 3D model capture rig. The results certainly are impressive. [Thanks Wouter]

Retrotechtacular: The Fourier Series

retrotechtacular-fourier-series

Here’s a really quick video which takes a different approach to understanding the Fourier Series than we’re used to. If you’re a regular reader we’re sure you’ve heard of the Fourier Series (often discussed as FFT or Fast Fourier Transform), but there’s a good chance you know little about it. The series allows you to break down complex signals (think audio waves) into combinations of simple sine or cosine equations which can be handled by a microcontroller.

We’ve had that base level of understanding for a long time. But when you start to dig deeper we find that it becomes a math exercise that isn’t all that intuitive. The video clip embedded after the break changes that. It starts off by showing a rotating vector. Mapping the tip of that vector horizontally will draw the waveform. The Fourier Series is then leveraged, adding spinning vectors for the harmonics to the tip of the last vector. The result of summing these harmonics produces the sine-based square wave approximation seen above.

That’s a mouthful, and we’re sure you’ll agree that the video demo is much easier to understand. But the three minute clip just scratches the surface. If you’re determined to master the Fourier Series give this mammoth Stanford lecture series on the topic a try.

[Read more...]

Magic eye spectrum analyzer

its goddamned magic

 

If Nixies aren’t cool enough, maybe it’s time to step it up to magic eye tubes.

Magic eye tubes are, like Nixies and Dekatrons, display tubes. Unlike the alphanumeric characters of Nixies or rotating points of light in a Dekatron, Magic eye tubes are either bar graph or ‘Pac-Man’ displays that were used to show the signal strength of a radio station on very expensive radio sets.

After doing a few experiments with tubes, [sylvain] thought it would be cool to do something with magic eye tubes. He sourced eight vertical ‘bar graph’ magic eye tubes and built an audio spectrum analyzer.

One of the more difficult things to do was to compute the power levels for each frequency band. There are a few graphic equalizer ICs available, but [sylvian] decided to go the old-school, harder way by putting an FFT algorithm on an ATMega624.

An impressive piece of work that would look amazing next to a nice tube stereo system.

Stellaris Launchpad and booster packs used as frequency analyzer

stellaris-frequency-analyzer-using-booster-packs

[Jordan Wills] got tired of being limited to eight pixels of resolution and having jumper wires littering his work space. He set out to upgrade his Stellaris Launchpad frequency analyzer project using booster packs. You may remember the initial iteration of the project which used an 8×8 LED matrix to map audio spectrum. With this upgrade he’s really putting the power of that ARM chip to use.

His first improvement with this project was to spin his own audio input board. It has a standard headphone jack for input and a few passive components to shift the signals to rest nicely within the ADC measurement range. The shield has two double pin headers and a group of four stand offs to serve as legs. This way it plugs into the female headers on the bottom of the Launchpad and provides a stable base for the assembly.

The second portion of the setup is an LCD booster pack for the hardware. Kentec manufactures this 3.5″ 320×240 LCD (EB-LM4F120-L35) complete with a resistive overlay making it touch sensitive. The increase in resolution, and availability of different colors gave [Jordan] plenty to work on. Since this add-on is designed for the Launchpad and has a driver library already available he was able to focus on adapting the FFT output for display and adding in new features. Don’t miss seeing what he’s accomplished in the clip after the break.

[Read more...]

Building a spectrum analyzer with parallel processing

fft

It’s the end of the semester for [Bruce Land]‘s microcontroller design class at Cornell, and the projects coming off the workbench this semester look as awesome as any before. For their final project, [Alexander Wang] and [Bill Jo] designed an audio frequency spectrum analyzer using two microcontrollers in a parallel setup.

This spectrum analyzer takes an audio signal from an iPod, phone, or CD player through a 3.5 mm jack and displays the level for dozens of frequency bands much like an audio visualizer in iTunes or a nice car stereo display. To display these frequency bands, the spectrum analyzer first needs to perform a Fast Fourier Transform on the incoming audio signal. While FFT is extremely fast, the calculations are rather hardware intensive; calculating the frequencies and displaying them on a TV would be a bit much even for the ATMega1284 used in the project.

To graph the audio signal on their small display, [Alexander] and [Bill] broke the build up into two parts – one to do the math on the audio, and another to generate the NTSC video signal for the display.

As seen in the video after the break, the spectrum analyzer works wonderfully, and even though it only functions up to 4kHz, it’s more than enough to see what’s going on in most music.

[Read more...]