Nicolas Electronics

Electronic projects and programming

Fast Fourier Transform on the PSVita

As some of you may know the PSVita, just like its predecessor the PSP, has been hacked and reverse engineered to allow unsigned code execution on FW3.60.

I’m not going to go into the details of how you develop programs for the PSVita.
Here’s the VITASDK and here are some samples, which I’m glad that I could contribute to.

I’ve done a couple of programs for the PSP a while back and thought I could try again on the PSVita.

Having done a crude embedded spectrum analyzer before, see my earlier How to program an FFT posts, I wanted to try to program an FFT on the PSVita.

I started with making a microphone sample, which displayed the audio buffer and it even had a VU meter.

After that I took my FFT library, which you can find on github now, made some changes to it and added some cool stuff like windowing.

Because the FFT library only uses standard includes, it is cross compatible with any device.
This means that it’s a piece of cake to add the library to a homebrew program for the PSVita.

Thus came this first version 0.1 :

I do love me some good old Sonic music.

You can find this program as a proof of concept here :

The program was very basic and only displayed the amplitude.
The next version had a little arrow which you can move to point to a frequency.

After a few more iterations, this was version 0.1.4 :

The arrow has been replaced by a ‘+’ cursor, controlled with a joystick, and I changed the cosmetics a bit to make it more pleasing to the eye.
This was the first program where I’ve added amplitude to decibel conversion.
In the top right corner there’s like an info box which can be made invisible by pressing a button.
This was also the first release using a windowing function. I believe that I had used a triangular window.

You can find this version here :

Now the latest release v0.1.6 has been given a few images, so the icon on the PSVita isn’t blank anymore.
I’ve also changed the triangular window to the Blackman window. I’ve added a Y-scale zoom when changing from plain amplitude values to decibel. And lastly I offset the decibel Y-origin up so that we can not only see amplification of the frequencies, but also see the attenuation. I don’t have a video for this version.

Here’s the latest release :

All in all, this was a fun little project and I enjoyed programming this after such a long time not doing much.

I’ll see you in the next post,

– pyroesp

PS: Special thanks to xerpi for his vita2d library and everyone involved in the making of the vitasdk and the ability to run homebrews on the PSVita.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box