<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alexander Kojevnikov | Blog</title><link href="http://kojevnikov.com/" rel="alternate"></link><link href="http://kojevnikov.com/spek.xml" rel="self"></link><id>http://kojevnikov.com/</id><updated>2014-08-31T00:00:00+00:00</updated><entry><title>Faster Fast Fourier Transform</title><link href="http://kojevnikov.com/faster-fast-fourier-transform.html" rel="alternate"></link><updated>2014-08-31T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2014-08-31:faster-fast-fourier-transform.html</id><summary type="html">&lt;p&gt;&lt;img alt="Spek logo" class="right" src="http://kojevnikov.com/static/images/logo-spek.png" /&gt;
&lt;a href="http://spek.cc/"&gt;Spek&lt;/a&gt; is already pretty fast at analyzing audio files and creating their
spectrograms. Apparently, it can be made even faster!&lt;/p&gt;
&lt;p&gt;A sizable chunk of processing time is spent calculating discrete Fourier
transforms of audio samples. In this post I'm going to explore a few DFT
libraries and compare their performance to what Spek is currently using.&lt;/p&gt;
&lt;p&gt;This won't be a comprehensive overview of all available libraries. I'm going to
benchmark only what Spek needs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Relatively small, power of 2 transform sizes. The default size in Spek is
  2&lt;sup&gt;11&lt;/sup&gt;, this will be adjustable in the future, but not by much.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Single precision floating point numbers. 24-bit significand is enough when
  working with audio samples.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Only one-dimensional forward real transforms.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Last but not least, the DFT library should be free software, actively
  maintained, fairly popular and multi-platform.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The list of candidates is surprisingly short:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;avfft, which is part of the &lt;a href="http://ffmpeg.org/"&gt;FFmpeg&lt;/a&gt; project. This is what Spek uses.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://www.fftw.org/"&gt;FFTW&lt;/a&gt;. Probably the most respectable FFT library of all. Supports both
  in-place and out-of-place transforms.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://cr.yp.to/djbfft.html"&gt;djbfft&lt;/a&gt; by Dr. Bernstein of daemontools fame. It's not as performance tuned
  as the other two (e.g. it doesn't use SIMD instructions), but I want to see
  how it fares against them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The test setup is straightforward (the code is on &lt;a href="https://github.com/alexkay/fft-bench"&gt;GitHub&lt;/a&gt; in case
you're curious):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Generate pseudo-random single-precision floating point samples. The number of
  samples corresponds to 10 minutes of signal at standard 44.1 kHz sampling
  rate.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For all libraries and for all transform sizes from 2&lt;sup&gt;9&lt;/sup&gt; to 2&lt;sup&gt;13&lt;/sup&gt; run
  non-overlapping FFTs for the entire signal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Measure wall clock time only for FFTs (exclude sample generation and library
  initialization), take 5 measurements for every combination, report the
  fastest.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Results:&lt;/p&gt;
&lt;p&gt;&lt;img alt="fft-bench-results" class="center" src="http://kojevnikov.com/static/images/fft-bench-results.png" /&gt;&lt;/p&gt;
&lt;p&gt;As expected, djbfft is the slowest, using SIMD instructions does make things
faster. I am however surprised how fast the FFTW is compared to avfft
(approximately 60% faster!)&lt;/p&gt;
&lt;p&gt;Conclusion: Next version of Spek will switch to FFTW.&lt;/p&gt;</summary><category term="spek"></category></entry><entry><title>Spek 0.8.0 Released</title><link href="http://kojevnikov.com/spek-0-8-0-released.html" rel="alternate"></link><updated>2012-09-23T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2012-09-23:spek-0-8-0-released.html</id><summary type="html">&lt;p&gt;&lt;img alt="Spek logo" class="right" src="http://kojevnikov.com/static/images/logo-spek.png" /&gt;
After more than a year in the baking, a &lt;a href="http://spek-project.org"&gt;new version of Spek&lt;/a&gt; is out!&lt;/p&gt;
&lt;p&gt;This release is almost a complete rewrite driven by the switch from &lt;a href="http://www.gtk.org/"&gt;GTK+&lt;/a&gt; to
&lt;a href="http://www.wxwidgets.org/"&gt;wxWidgets&lt;/a&gt; to simplify packaging and to improve integration on Windows and
Mac OS X. The switch also allowed to make a singe-exe version of Spek on
Windows, which was a frequently requested feature.&lt;/p&gt;
&lt;p&gt;Spek now allows to change the spectral density range, which is essential when
trying to detect lossy transcodes. It also handles the low end of the density
better resulting in less noisy spectrograms.&lt;/p&gt;
&lt;p&gt;There were also some infrastructure changes: downloads and issues have been
moved from Google Code to &lt;a href="https://github.com/alexkay/spek"&gt;GitHub&lt;/a&gt;, and wiki pages with platform-specific
installation instructions have been moved to a single &lt;a href="https://github.com/alexkay/spek/blob/0.8.0/INSTALL.md"&gt;INSTALL file&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Read the &lt;a href="https://github.com/alexkay/spek/blob/0.8.0/README.md"&gt;changelog&lt;/a&gt; for the full list of changes in this release.  Download
links and installation instructions are available on the &lt;a href="http://spek-project.org"&gt;Spek homepage&lt;/a&gt;,
get it while it's hot!&lt;/p&gt;</summary><category term="spek"></category></entry><entry><title>Spek and Lion</title><link href="http://kojevnikov.com/spek-and-lion.html" rel="alternate"></link><updated>2011-08-17T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2011-08-17:spek-and-lion.html</id><summary type="html">&lt;p&gt;&lt;img alt="Spek and Lion" class="center" src="http://kojevnikov.com/static/images/spek-lion.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://spek-project.org"&gt;Spek&lt;/a&gt; is now fully compatible with the recently released Mac OS X
Lion. &lt;a href="http://code.google.com/p/spek/issues/detail?id=51"&gt;The bug&lt;/a&gt; that prevented it from starting up is now fixed, thanks to
&lt;a href="https://github.com/jralls/"&gt;John Ralls&lt;/a&gt; and the awesome &lt;a href="http://gtk-osx.sourceforge.net/"&gt;GTK-OSX project&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Get your &lt;a href="http://code.google.com/p/spek/downloads/list"&gt;copy of Spek&lt;/a&gt; today!&lt;/p&gt;</summary><category term="spek"></category></entry><entry><title>Spek 0.7 Released</title><link href="http://kojevnikov.com/spek-0-7-released.html" rel="alternate"></link><updated>2011-04-24T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2011-04-24:spek-0-7-released.html</id><summary type="html">&lt;p&gt;I'm happy to announce the release of &lt;a href="http://spek-project.org/"&gt;Spek 0.7&lt;/a&gt; – a multi-platform acoustic
spectrum analyser.&lt;/p&gt;
&lt;p&gt;This version features multi-lingual support and a much better OS X
integration. It also includes performance tweaks and many bug fixes.&lt;/p&gt;
&lt;p&gt;Read the &lt;a href="http://gitorious.org/spek/spek/blobs/0.7/NEWS"&gt;NEWS&lt;/a&gt; file for a full change log.&lt;/p&gt;
&lt;p&gt;Download links and installation instructions are on the
&lt;a href="http://spek-project.org/"&gt;Spek website&lt;/a&gt;, get it while it's hot!&lt;/p&gt;</summary><category term="spek"></category><category term="gnome"></category></entry><entry><title>Spek status update</title><link href="http://kojevnikov.com/spek-status-update.html" rel="alternate"></link><updated>2011-03-16T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2011-03-16:spek-status-update.html</id><summary type="html">&lt;p&gt;Just a quick update on the status of &lt;a href="http://spek-project.org/"&gt;the project&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Spek is now translatable, the next version will feature at least these
translations: Dutch, German, Russian, Swedish and Ukrainian. We use
&lt;a href="http://www.transifex.net/projects/p/spek/resource/spek/"&gt;Transifex&lt;/a&gt; to manage translations. Feel free to translate it into your
language or to improve an existing translation. Transifex is a very easy to use
tool, you don't have to know anything about programming to translate.&lt;/p&gt;
&lt;p&gt;Some progress has been made on the packaging front, Spek packages are now
available in &lt;a href="http://aur.archlinux.org/packages.php?ID=38001"&gt;Arch Linux&lt;/a&gt;, &lt;a href="http://www.freshports.org/audio/spek/"&gt;FreeBSD&lt;/a&gt; and &lt;a href="http://packages.gentoo.org/package/media-sound/spek"&gt;Gentoo&lt;/a&gt; repositories.&lt;/p&gt;
&lt;p&gt;I also created a package for Debian which needs a sponsor. If you are a Debian
Developer I would appreciate a review and eventually an upload.  The package can
be found on &lt;a href="http://mentors.debian.net/cgi-bin/sponsor-pkglist?action=details;package=spek"&gt;mentors.debian.net&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Last but not least, the next version will show some OS X love. Many OS X
specific bugs have already been fixed or are scheduled to be fixed for the next
release.&lt;/p&gt;
&lt;p&gt;I expect to release Spek 0.7 sometime this spring. If you are feeling
adventurous, try Spek from &lt;a href="http://gitorious.org/spek"&gt;git master&lt;/a&gt;, compilation instructions are on
&lt;a href="http://code.google.com/p/spek/wiki/UnixInstall"&gt;the wiki&lt;/a&gt;.&lt;/p&gt;</summary><category term="gnome"></category><category term="spek"></category></entry><entry><title>Spek 0.6 Released</title><link href="http://kojevnikov.com/spek-0-6-release.html" rel="alternate"></link><updated>2010-07-13T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-07-13:spek-0-6-release.html</id><summary type="html">&lt;p&gt;I'm happy to announce the release of &lt;a href="http://spek-project.org/"&gt;Spek 0.6&lt;/a&gt; – a multi-platform acoustic
spectrum analyser.&lt;/p&gt;
&lt;p&gt;This version is about 3 times faster than 0.5 thanks to the lightning-fast
&lt;a href="http://kojevnikov.com/gstreamer-ffmpeg-and-spek.html"&gt;FFmpeg decoders&lt;/a&gt; and the new multi-threaded analysis algorithm.&lt;/p&gt;
&lt;p&gt;Spek 0.6 also features dramatically reduced size of the Windows installer (from
17.1 MiB to 9.8 MiB) and OS X bundle (from 10.5 MiB to 6.1 MiB)&lt;/p&gt;
&lt;p&gt;Read the &lt;a href="http://gitorious.org/spek/spek/blobs/0.6/NEWS"&gt;NEWS&lt;/a&gt; file for a complete change log.&lt;/p&gt;</summary><category term="spek"></category><category term="gnome"></category></entry><entry><title>GStreamer, FFmpeg and Spek</title><link href="http://kojevnikov.com/gstreamer-ffmpeg-and-spek.html" rel="alternate"></link><updated>2010-07-04T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-07-04:gstreamer-ffmpeg-and-spek.html</id><summary type="html">&lt;p&gt;Next version of &lt;a href="http://spek-project.org/"&gt;Spek&lt;/a&gt; will use &lt;a href="http://ffmpeg.org/"&gt;FFmpeg&lt;/a&gt; libraries to decode audio
files. There are several reasons for the switch from &lt;a href="http://gstreamer.freedesktop.org/"&gt;GStreamer&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;GStreamer is a fantastic framework for building complex multimedia pipelines,
however what Spek really needs is a simple decoder and FFmpeg's libavformat and
libavcodec do just that.&lt;/p&gt;
&lt;p&gt;To handle some audio formats (e.g. APE and DTS), GStreamer relies on FFmpeg
anyway, so the switch will result in fewer dependencies. It doesn't matter too
much on GNU/Linux, but this will reduce the size of the Windows and Mac OS X
installers.&lt;/p&gt;
&lt;p&gt;Spek used GStreamer's &lt;a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-spectrum.html"&gt;spectrum&lt;/a&gt; plugin to perform the actual spectral
analysis, with FFmpeg I had to implement it myself. The code I ended up with is
very compact and gives room for a lot of experimentation, from using different
window functions (it's still Hamming) and working on performance optimisations
to switching to a faster FFT library.&lt;/p&gt;
&lt;p&gt;The last bit is actually done, Spek now uses &lt;a href="http://www.fftw.org/"&gt;FFTW&lt;/a&gt; which in my tests is 1.5x
to 2x faster than &lt;a href="http://kissfft.sourceforge.net/"&gt;Kiss FFT&lt;/a&gt; used by GStreamer. Apart from that, FFTW can
scale to multiple threads with near linear performance increase, future versions
of Spek will take advantage of this.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;UPDATE: As one of commenters pointed out, FFTs on small number of samples are
not very parallelisable and my benchmarks confirm this.  Also, I switched from
FFTW to &lt;a href="http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/avfft_8h-source.html"&gt;avfft&lt;/a&gt; which is built into FFmpeg. It's a little bit faster than FFTW
for my particular use case. Lastly, 1.5x to 2x speed up was actually caused by a
faster decoder, not by a faster FFT library.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Another thing that would be hard with GStreamer is static cross-compilation
using &lt;a href="http://www.nongnu.org/mingw-cross-env/"&gt;mingw-cross-env&lt;/a&gt; to produce a single Windows executable. Because FFmpeg
doesn't employ a plugin architecture, static linking is not an issue.&lt;/p&gt;
&lt;p&gt;Last, but not least, the whole experience was very educational. I now remember
why I loved C back in the days, the trick is to not even attempt to write any
GObject code with it, that's what Vala is for. Fast Fourier Transform and the
maths behind it is much fun, and &lt;a href="http://www.nrbook.com/a/bookcpdf.php"&gt;NR&lt;/a&gt; was very helpful here.&lt;/p&gt;
&lt;p&gt;For the curious, the code is merged to git master and pushed to
&lt;a href="http://gitorious.org/spek"&gt;Gitorious&lt;/a&gt;. The next version of Spek will be released sometime in July.&lt;/p&gt;</summary><category term="spek"></category><category term="gnome"></category></entry><entry><title>Spek 0.5 - Mac OS X port</title><link href="http://kojevnikov.com/spek-0-5-mac-os-x-port.html" rel="alternate"></link><updated>2010-06-27T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-06-27:spek-0-5-mac-os-x-port.html</id><summary type="html">&lt;p&gt;I'm happy to announce the release of version 0.5 of &lt;a href="http://spek-project.org/"&gt;Spek&lt;/a&gt;, a multi-platform
acoustic spectrum analyser.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://kojevnikov.com/static/images/spek-0-5-osx.png"&gt;&lt;img alt="Spek under OS X" class="center shrink" src="http://kojevnikov.com/static/images/spek-0-5-osx.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Changes since the previous release:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Significantly speed up spectral analysis by using the optimal number of
  frequency bands.&lt;/li&gt;
&lt;li&gt;DTS files support.&lt;/li&gt;
&lt;li&gt;Distribute Windows version as a ZIP archive in addition to the MSI
  installer. &lt;img alt="Spek logo" class="right" src="http://kojevnikov.com/static/images/logo-spek.png" /&gt;&lt;/li&gt;
&lt;li&gt;Mac OS X installer.&lt;/li&gt;
&lt;li&gt;Use Pango to render text.&lt;/li&gt;
&lt;li&gt;Brand new icon.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is the first version of Spek that features a Mac OS X port. All binaries in
the app bundle are compiled completely from scratch using a
&lt;a href="http://github.com/alexkay/bockbuild/tree/spek"&gt;slightly modified&lt;/a&gt; version of &lt;a href="http://abock.org/"&gt;Aaron&lt;/a&gt;'s excellent &lt;a href="http://github.com/abock/bockbuild"&gt;bockbuild&lt;/a&gt; project
(the same tool that is used to package &lt;a href="http://banshee.fm/"&gt;Banshee&lt;/a&gt; for OS X).&lt;/p&gt;
&lt;p&gt;If your project uses the GNOME stack and you want to port it to Mac OS X -- give
bockbuild a try. Check Spek's &lt;a href="http://gitorious.org/spek/spek/blobs/master/bundle.sh"&gt;bundle script&lt;/a&gt; for gory details.&lt;/p&gt;</summary><category term="gnome"></category><category term="spek"></category></entry><entry><title>Spek 0.4 Released</title><link href="http://kojevnikov.com/spek-0-4-released.html" rel="alternate"></link><updated>2010-05-21T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-05-21:spek-0-4-released.html</id><summary type="html">&lt;p&gt;I've just released version 0.4 of &lt;a href="http://spek-project.org/"&gt;Spek&lt;/a&gt; -- an acoustic spectrum analyser for
GNU/Linux and Windows.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Spek showing a 24-bit FLAC file" class="center" src="http://kojevnikov.com/static/images/spek-0-4-flac.png" /&gt;&lt;/p&gt;
&lt;p&gt;This version brings the following features and improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Associate with audio files ("Open with..." menu in file managers.)&lt;/li&gt;
&lt;li&gt;Show the name of the open file in the window title.&lt;/li&gt;
&lt;li&gt;Support 24-bit FLACs.&lt;/li&gt;
&lt;li&gt;Drag and Drop support.&lt;/li&gt;
&lt;li&gt;Show file name and its properties in the window.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grab Spek 0.4 while it's hot, the source code tarball and the Windows installer
can be downloaded &lt;a href="http://code.google.com/p/spek/downloads/list"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A special "thank you" to users of a popular private tracker, their great
suggestions helped to shape this release.&lt;/p&gt;
&lt;p&gt;P.S. Hello, Planet GNOME! :)&lt;/p&gt;</summary><category term="gnome"></category><category term="spek"></category></entry><entry><title>Spek 0.3 Released</title><link href="http://kojevnikov.com/spek-0-3-released.html" rel="alternate"></link><updated>2010-05-17T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-05-17:spek-0-3-released.html</id><summary type="html">&lt;p&gt;&lt;a href="http://spek-project.org/"&gt;Spek 0.3&lt;/a&gt; is out, just 2 days after the previous release. This version
includes the following features and fixes:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Rulers in Spek" class="center" src="http://kojevnikov.com/static/images/spek-0-3-rulers.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Horizontal (time) and vertical (frequency) rulers, auto-adjustable to the
  duration and sample rate of the audio file and to the window size.&lt;/li&gt;
&lt;li&gt;First take on the command line arguments parsing, for now Spek understands
  only &lt;code&gt;--help&lt;/code&gt; and &lt;code&gt;--version&lt;/code&gt; (in addition to the usual gtk+ and gst options.)&lt;/li&gt;
&lt;li&gt;Open the file passed as an argument. In the future Spek will also associate
  itself with common audio formats so that you could use it as a viewer.&lt;/li&gt;
&lt;li&gt;Fix a crash when the window width is very small.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Spek 0.3 source code tarball and the Windows installer can be downloaded
&lt;a href="http://code.google.com/p/spek/downloads/list"&gt;here&lt;/a&gt;.&lt;/p&gt;</summary><category term="gnome"></category><category term="spek"></category></entry><entry><title>Spek 0.2 - now works in Windows</title><link href="http://kojevnikov.com/spek-windows.html" rel="alternate"></link><updated>2010-05-15T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-05-15:spek-windows.html</id><summary type="html">&lt;p&gt;&lt;a href="http://spek-project.org/"&gt;Spek&lt;/a&gt; now has a fully functional Windows port! The installer bundles GTK+,
GStreamer and all their dependencies, you don't need to install anything else.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://kojevnikov.com/static/images/spek-0-2-windows.png"&gt;&lt;img alt="Screenshot of Spek running under Windows 7" class="center shrink" src="http://kojevnikov.com/static/images/spek-0-2-windows.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I also moved project hosting over to Google Code so Spek now has a full-fledged
&lt;a href="http://code.google.com/p/spek/issues/list"&gt;bug tracker&lt;/a&gt;. The source code is still hosted on &lt;a href="http://gitorious.org/spek"&gt;Gitorious&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are tired of starting up monstrous applications like Adobe Audition or
Audacity just to check a file's spectrogram, &lt;a href="http://code.google.com/p/spek/downloads/list"&gt;give Spek a shot&lt;/a&gt;!&lt;/p&gt;</summary><category term="spek"></category><category term="gnome"></category></entry><entry><title>Introducing Spek</title><link href="http://kojevnikov.com/introducing-spek.html" rel="alternate"></link><updated>2010-05-10T00:00:00+00:00</updated><author><name>Alexander Kojevnikov</name></author><id>tag:kojevnikov.com,2010-05-10:introducing-spek.html</id><summary type="html">&lt;p&gt;I just released version 0.1 of &lt;a href="http://spek-project.org"&gt;Spek&lt;/a&gt; -- a little program that shows
&lt;a href="http://en.wikipedia.org/wiki/Spectrogram"&gt;spectrograms&lt;/a&gt; of audio files. Spek is written in &lt;a href="http://live.gnome.org/Vala"&gt;Vala&lt;/a&gt; and uses the
standard GNOME stack: GLib, GTK+, Cairo and GStreamer.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://kojevnikov.com/static/images/spek-0-1-flac.png"&gt;&lt;img alt="Spectrogram of a FLAC file" class="center shrink" src="http://kojevnikov.com/static/images/spek-0-1-flac.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Spectrograms are used to analyse the quality of audio files, you can easily
detect lossy re-encodes, web-rips and other badness by just looking at the
spectrogram.&lt;/p&gt;
&lt;p&gt;This version of Spek doesn't do much apart from showing the actual spectrogram
and allowing to save it as a PNG image. However, I plan to add a bunch of
features before releasing version 1.0:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows port.&lt;/li&gt;
&lt;li&gt;Horizontal (time) and vertical (frequency) rulers.&lt;/li&gt;
&lt;li&gt;Zooming, scrolling and other adjustments.&lt;/li&gt;
&lt;li&gt;Associate Spek with audio files to use it as a viewer.&lt;/li&gt;
&lt;li&gt;Use multiple threads to speed-up processing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can download the tarball from the project's &lt;a href="http://spek-project.org"&gt;website&lt;/a&gt;. To build and
run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;%&lt;/span&gt; tar -xjvf spek-0.1.tar.bz2
&lt;span class="gp"&gt;%&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;spek-0.1
&lt;span class="gp"&gt;%&lt;/span&gt; ./configure
&lt;span class="gp"&gt;%&lt;/span&gt; make
&lt;span class="gp"&gt;%&lt;/span&gt; src/spek
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Or &lt;code&gt;sudo make install&lt;/code&gt; to have it installed.&lt;/p&gt;
&lt;h3 id="contribute"&gt;Contribute&lt;/h3&gt;
&lt;p&gt;The code is available on &lt;a href="http://gitorious.org/spek"&gt;Gitorious&lt;/a&gt;. I really need and will appreciate help
in these areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Packaging&lt;/li&gt;
&lt;li&gt;Translations&lt;/li&gt;
&lt;li&gt;Review of autotools-related code&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="why-vala"&gt;Why Vala?&lt;/h3&gt;
&lt;p&gt;I initially wanted to write Spek in Haskell to practice the language after
reading &lt;a href="http://www.haskell.org/soe/"&gt;The Haskell School of Expression&lt;/a&gt; (generously sent to me by
&lt;a href="http://castrojo.wordpress.com/"&gt;Jorge&lt;/a&gt;). However, after writing a bit of code I realised that all the
functional goodness of Haskell is not used at all because Spek is simply a bit
of glue between GTK+ and GStreamer, with very little code of its own. Also, the
prototype's executable size of 14+ MiB didn't help much in convincing myself
that Haskell was a good pick for this project.&lt;/p&gt;
&lt;p&gt;I was left with C and C#. The latter didn't feel like a good idea for the same
reasons: I wanted something lightweight for this small little app, C# would
require a lot of dependencies. Also, while I &lt;em&gt;really&lt;/em&gt; like C# as a language and
Mono/.NET as a platform, I wanted to try something new for a change -- I already
use them full-time on my day job and when hacking &lt;a href="http://banshee-project.org/"&gt;Banshee&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I wrote very little C/C++ code since late 90's, now I know why I didn't miss it
much -- it's so incredibly verbose! After a few hours I gave up, decided to do
some research and found &lt;a href="http://live.gnome.org/Vala"&gt;Vala&lt;/a&gt; :)&lt;/p&gt;
&lt;p&gt;The impression so far is hugely positive. Vala still has a few rough edges but
nothing too bad and not work-aroundable. If you are tired of using C for your
GTK+ applications, definitely give it a try!&lt;/p&gt;</summary><category term="gnome"></category><category term="spek"></category></entry></feed>