Monday, 31 December 2012

What Software Is Good For Learning Or Implementing Digital Signal Processing On A Desktop or Laptop Computer ?


I nearly always start out at the C level and then port to Assembly code, as required.

Under Linux, GCC is the obvious choice but under Windows I use Microsoft Visual C++ V10.0 Express Edition that can be downloaded for free (http://www.microsoft.com).

For audio I/O I use the standard sound card and PortAudio (http://www.portaudio.com). PortAudio is a great open-source API for audio I/O and runs on a number of different operating systems so software written with this is very portable.
A great example of what can be done with PortAudio is Audacity (http://audacity.sourceforge.net). As an aside, Audacity is also a great tool to use for analyzing sampled waveforms and I have used it for analyzing all sorts of signals from radar to gas turbine (jet engine) vibration.
PortAudio supports several different host-APIs and the main one I use under Windows is Microsoft DirectX SDK (http://www.microsoft.com/en-us/download/details.aspx?id=6812).
See my earlier blog (http://realgonegeek.blogspot.co.uk/2012/12/compiling-portaudio-and-visual-studio-c.html) for further details on using PortAudio under Windows. I have found WDM/KS to have a very low (and predictable) latency but I have also found that it often supports less sample rate options than MME or DS.

If you wish to do some signal processing with the above software then a very simple way to generate data graphs direct from a C program is Signal Visualizer (http://signalvisualize.sourceforge.net). The nice thing about this is that it is a IP based client-server package that allows the DSP client to run on an embedded machine and display the graphs on a remote Windows or Linux computer.
Other tools that I have used for back-end display of data are GnuPlot (http://www.gnuplot.info/) and XMGrace (http://plasma-gate.weizmann.ac.il/Grace/).

If you want to write a complete GUI application for processing signals then for a host API I almost exclusively use C++ and wxWidgets (http://www.wxwidgets.org), which is an open source API that supports portability on a number of OSs in the same way that PortAudio does for audio I/O. When using wxWidgets, you should also install Bakefile (http://www.bakefile.org) which makes building wxWidgets examples much easier.

If you want to hack an application that puts all of these together and allows you to process signals via a soundcard then you can download System Analyzer (http://www.numerix-dsp.com/files/). This uses the Numerix Graphical Library (http://www.numerix-dsp.com/files/) and the free version of the Numerix SigLib DSP Library (http://www.numerix-dsp.com/free/).

What about if you want to use a different language other than C/C++ ?
I write nearly all of my DSP code in C or Assembly so rather than rewrite the functions in the target language for a particular project I typically use SWIG (http://www.swig.org/) to allow access to these C/ASM functions from other languages such as C#, Perl, PHP, Python etc.

No comments:

Post a Comment