Presented by Ian Paul and Carl Moser

Spectrum Analyzer

Olin College of Engineering Software Design Final Project Spring 2016

About

What is our project

We worked on building a spectrum analyzer. This is a tool for looking at the signals and examining them. We can see both the time and frequency domain content of system out audio at high enough resolution for humans to discern patterns. One of our main focuses of this product is being able to process the data all in real time, something we are proud to say we have accomplished. Gathering data a sufficiently high rate as well as doing the processing is decently computationally intensive. Because of this, we transitioned away from using Python into using C++. Our Python implementation works; however, it lack high enough resolution to satisfy our standards and has been depricated. Our C++ implementation reaches 14000 Hz before it fails which is comparable ro or better than similar industry tools (ignoring those which preload audio).

The current version of our product is a complete one, but we intent to continue developing it. As of 2016-05-05, the final submission date of the project, we have implemented plotting our data in the time and frequency domains, which sufficiently captures the intent of our project. Things that we are working on implementing in the future include: a UDP server to control adressable LED strips, different visuals for a FFT, and a GUI control panel to choose what is displayed.

Pakages

FFTW

Package used for fast fourier transforming our signal

Pulse

Gathering realtime audio out from the computer

QT

Real-time visualizations of data

Installation and Explanation

Installing

First, clone the repository, found at 'https://github.com/IanOlin/Softdes-Final-project'. Next install all the requisite developement repositories so you can build the code yourself. (This works for Ubuntu 15.10)

sudo apt-get install libpulse-dev libfftw3-dev qt4-dev-tools

After getting the dependencies installed, run our run function (./run.sh) to compile. Then you cazn run main (./spectrogram) to run the program.

Explanation

One thing that we are proud of with this project is the toolings we chose. FFTW is a more complicated FFT pakage, but we decided to use it, as well as the appropriate(but more difficult) methods it offers. Similarly, QT is a massive tool that is the industry standard for GUI creation and some analytics.

We'd also like to take some space on this page to describe the process we went through to get to this point in our tooling. We started in Python because our class is taught in Python. From there we took our initial set of modules: Pulse, MatPlotLib, and Numpy for our collection, plotting, and data analysis respectively. We were persistantly dogged by performance issues, so we explored our other options. We chose to move to C++ because we were interested in learning the language and because we were confident it would provide us with the speed we needed. We continued to use Pulse for audio because we were most comfortable interactive with that level of the Linux sound system. Briefly, we used KissFFT as our FFT pakage, but we decided to switch to FFTW for profesionalism and even more speed (not that we needed it at this point). We tried to use MathGL for plotting, but we were struggling to get the displays we wanted so we switched to QT which ended up being easier and a better learning experience because of its wider use cases. Overall, in terms of speed, we are about one full order of magnitude faster with C++ than we were in Python, with better accuracy.