Friday, September 28, 2007

Compressive sensing

A very nice beginner-level guide for anyone interested in compressive sensing and reconstruction, by Richard Baraniuk from Rice University:

A lecture on compressive sensing (PDF)

Monday, September 24, 2007

The Chirp z-Transform: High Resolution, Narrow Band Analysis

The Chirp z-Transform (CZT) is a pretty useful tool in signal processing for increasing the resolution of a signal's frequency spectrum within a certain frequency band, without having to increase the sampling frequency/number of samples of the continuous time signal. The CZT calculates the DFT (discrete fourier transform) of a time series by converting the DFT equation into a convolution sum of two series, which can easily be calculated using the convolution property of fourier transforms. More importantly, the CZT algorithm can map a DFT onto circles, spirals, and arcs in the complex z-plane. By mapping the transform to a full circle with radius 1, we get the usual DFT. By mapping it onto circular arcs, we get narrow band DFTs, and by increasing the number of frequency samples within those arcs, we can obtain a higher resolution frequency response. I'm not sure what use it would be to map a DFT onto a spiral or spiral arc, but in any case, it requires extremely an high floating point precision capability for computation.

To implement the CZT, you could use the readily available czt() function in Matlab's Signal Processing Toolbox, or the chirpz() function in MathCAD's Signal Processing Extension Pack. But if you don't have access to these toolboxes, or just want to learn and play around with the CZT like I did, it isn't hard to implement on any programming language. An excellent reference, in case you do want to implement your own CZT or learn about it, is the following 1969 paper by Rabiner, Schafer, and Rader:

The Chirp z-Transform Algorithm

A useful concept that is used in the implementation, is to be able to calculate a regular/linear convolution using a DFT/FFT. To do this you first have to zero-pad both series to a specific length, and then perform a circular convolution by calculating the individual DFTs of both series and the inverse DFT of their product. Also, to calculate a DFT of a time series with the efficient standard FFT algorithm, the zero-padded series has to be of radix-2 length.

The video at the bottom shows the CZT at work for a narrow band spectrum of a time series.





Sunday, September 23, 2007

Trying out Linux/OpenSUSE 10.2 with GNOME

I've been reading a lot in the news recently about companies/ organizations/ schools making the switch from Windows based operating systems to open-source Linux based ones. Being open-source and having a ton of free software to go along with it makes Linux seem really appealing. And it apparently works well on old computers too. I was a bit hesitant to try it out since I really don't know much about Linux, but I decided to give it a go anyway.

So I decided to install it on my old Dell Inspiron 1100 that I had lying around. There are many popular Linux distributions such as Ubuntu, OpenSUSE, RedHat etc. I downloaded the OpenSUSE 10.2 installation files and burned the ISO images onto 5 CDs. The installation itself was pretty straight forward, and Linux was able to detect most of my hardware. I hit a snag after installation, where after a reboot, it would go straight to the Linux command prompt instead of the GNOME desktop environment (a graphical, Windows-like interface). After a couple re-installations, and a lot of looking up online troubleshooting sources, I realized that it was a problem with my LCD monitor configuration. I finally managed to fix it by manually configuring my monitor by logging in as 'root' at the Linux command prompt and executing the 'yast2' configuration tool. Good thing I was able to get a hold of my Dell monitor specs (resolution, refresh rate, size etc) online.

After tinkering around for a bit, there are a few disappointing things about OpenSUSE w/GNOME that I've noticed:
  • New software takes much longer to install than Windows XP. Also, unless the installation comes in a RPM package, it could be very annoying to install. For example, I downloaded the installation for a program called Octave in a compressed '.tar.gz' file. I had to uncompress the file, execute './configure', 'make', and 'make install' successively from the Linux command line, only to find that I was missing some C/C++/Fortran libraries. RPM packages, if available, are easier to install.
  • Sometimes newly installed programs won't show up in the "Applications Menu" of GNOME, in which case you have to look for it yourself in /usr/bin or wherever else programs are installed. I faced this problem with RealPlayer and XPDF.
  • You have to download patches to be able to play mp3 files and DVDs etc. So far, I still haven't been able to get WMA files to play.
  • There's a very annoying program called Beagle that comes with OpenSUSE. It's some sort of search indexing utility that goes through your hard drive and collects information for easier future searching. The bad thing about it is that it runs in the background and utilizes almost 100% of the CPU processes until it finishes indexing, which can apparently last for days. Initially, I was really concerned when I could hear my CPU fan running at full speed even when all programs were idle, until I read about Beagle complaints online. The CPU fan became less noisier, and programs in general ran much faster once I disabled this utility.
Good things about Linux/OpenSUSE:
  • The amount of free and useful software available for Linux is huge
    • For example, free Matlab equivalent software (Octave, SciLab), office development (OpenOffice), music/video players, instant messaging, CAD tools etc and a whole lot more. Moreover, there seems to be a growing Linux community that's constantly updating and providing support for these applications.
Here's an example of Octave being used (in command line mode) to calculate and graph a simple DTFT (discrete time fourier transform). Obviously it can do a lot more. Octave also has a ton of Matlab-like toolboxes (signal processing, control systems etc), which are also completely free.



  • Different desktop environments
    • The two desktop GUIs I've been able to play around with are GNOME and KDE. Although KDE looks much better, it's a bit slow for older machines. These desktop environments are a refreshing change from Win XP.
  • Compiz windows management: I absolutely love the rotating cube and window selection feature, especially since I tend to have at several windows open at a time and switching back and forth on the same screen can be annoying.


Here's a video I found that shows what Compiz can do. Compiz works on my old Dell very well, despite it having a very ordinary graphics card (Intel), and it doesn't seem to slow the computer functionality down at all.

Linux software that I've tried so far and found very usable:
  • kile - LaTeX editor
  • OpenOffice - documents, spreadsheets, compatible with MS Office, convertible to PDF
  • Octave - Matlab-like software (most of the commands are exactly the same too), contains many add-ons, toolboxes, although I think it lacks a Simulink equivalent.
  • Gaim - multi-protocol instant messaging
  • Eclipse IDE - for C/C++ development
I'm going to play around with OpenSUSE a bit more (or maybe try Ubuntu) before I decide to make a permanent switch from Windows XP. For potentially new users unfamiliar to Linux, I don't think I would recommend the switch unless you're willing to spend a lot of time installing patches and programs, and generally learning and getting used to the Linux file structure and environment.

Well, here's a start...

I've had a bit of spare time since I graduated from Penn State in August. I've been spending a lot of time looking into jobs and graduate schools. I've also been spending a lot of time "self-studying", learning, and trying things related to math, engineering, and computer stuff. Hopefully I'll be able to share some info in upcoming posts. Feel free to leave any comments or feedback!