research

EEG Signal Processing in Python and Scipy.Signal (1): Spectrum Estimation, FIR Filter Design, Convolution and Windowing

by Forrest Sheng Bao http://fsbao.net

I am doing a take-home midterm test of a class I am taking. So, I decided to use Python to to it. Below is a code for one problem. It includes several frequency used functions in classical signal spectral analysis and FIR filter design. The problem itself is to design bandpass filters over alpha to theta bands and apply them onto a EEG series, and plot the time domain and frequency domain signal, as well as the frequency response of filters. I used window methods to design FIR bandpass filters. The filters coefficients are smoothed by a Kaiser window. Filtering is implemented by convolving original signal with coefficients of filters.

summation and factorial in gprolog

by Forrest Sheng Bao http://fsbao.net

I can't run sicstus Prolog on my department Solaris workstation. That makes me very unhappy at 3 am. So I decide to use gprolog. And the programming can be easier. In gprolog, FD is built-in.

Factorial in gprolog:

factorial(0,1). 

factorial(N,F) :-  
   N>0, 
   N1 is N-1, 
   factorial(N1,F1), 
   F is N * F1.

Summation in gprolog

sum(0,0). 

sum(N,F) :-  
   N>0, 
   N1 is N-1, 
   sum(N1,F1), 
   F is N + F1.

It seems that "is" is also a built-in predicate in swi-prolog.

STFT using spectrogram() in MATLAB, with Hamming and Chebychev windows and different window lengths

by Forrest Sheng Bao http://fsbao.net

The code below is an example on using spectrogram function of MATLAB to compute STFT of a chirp signal, which changes frequency from 10 Hz to 200 Hz in 1 second. Both Hamming and Chebychev windows are used. Different window length has been tried, 128, 64 and 32.

Butterworth, Chebyshev I/II and Elliptic filters in MATLAB

by Forrest Sheng Bao http://fsbao.net

% Copyleft (C) Forrest Sheng Bao 1984-2009 http://fsbao.net
% with Dept. of Electrical and Computer Engineering and Dept. of Computer Science, Texas Tech University, Lubbock, Texas, USA
%
% This program shows the orders and frequency/phase properties of four different kinds of filters, Butterworth, Chebyshev Type I, Chebyshev Type II and Elliptic.
% The filter is expected to have a cutoff frequency at 200 Hz with attenuation 40 db/octave. The sampling frequency is 2000 Hz.
%
% This program licensed in GNU GENERAL PUBLIC LICENSE (GPL) v3 or later.
% If you do not know what GNU GPL is, please visit http://www.gnu.org/copyleft/gpl.html

Why Z-transform is related to digital filter design

by Forrest Sheng Bao http://fsbao.net

A friend asked me an interesting question: Why is Z-transform always related to digital filter design? Well, this is interesting. But the clue is simple.

You need a web browser that supports MathML to read this doc. To see whether your browser supports it, please check whether you can see formulas on this page. By default, Linux and Mac user should be able to make it from their Mozilla Firefox browser. For Windows users, well, that's not a question you should ask me.

The author cannot guarantee this article has no typo. Please confirm all equations before you use them.

FT, STFT, DTFT, DFT and FFT, revisited

by Forrest Sheng Bao http://fsbao.net

You need a web browser that supports MathML to read this doc. To see whether your browser supports it, please check whether you can see formulas on this page. By default, Linux and Mac user should be able to make it from their Mozilla Firefox browser. For Windows users, well, that's not a question you should ask me.

The author cannot guarantee this article has no typo. Please confirm all equations before you use them.

There are so many guys asking me the difference between DTFT and DFT. And, they confused these two concepts with FFT and STFT.

Wireless Networking conferences coming

by Forrest Sheng Bao http://fsbao.net
ConferenceConference timedeadlinePlace
ACM MobiSys 2010 June unknown Palo Alto, California
IEEE GlobeCom 2010Dec 6-10 Mar 15, 2010 Miami, Florida
ACM MobiHoc 2010 (w/ MobiCom)late Sept Abs: Feb 12, 2010
Paper: Feb 19, 2010
Chicago, Illinois
ACM MobiCom 2010 (w/ MobiHoc)late Sept unknownChicago, Illinois
ACM SigComm 2010Aug 30 - Sept 3 Abs: Jan 22, 2010
Paper: Jan 29, 2010
New Delhi, India
IEEE ICCCN 2010Aug 2 - 5 Abs: Feb 19, 2010
Paper: Feb 26, 2010
ETH Zurich Switzerland

Welch method and autocorrelation of 1-D signals in MATLAB

by Forrest Sheng Bao http://fsbao.net

Here are some examples about computing autocorrelation, PSD in Welch methods with different windowing functions.

The problems are from John Semmlow's Biosignal and Medical Image Processing chapter 3. I used the MATLAB routine sig_noise() that comes with the textbook CD.

Problem 3.8 Welch method

Problem 3.9 Direct FFT spectrum vs FFT spectrum of a signal's autocorrelation function

Repeat above problem, but let SNR=0 dB

To say "Hello world" in Python CGI Web Programming in 5 minutes

by Forrest Sheng Bao http://fsbao.net

I have lotta Python programs for bioinformatics research. I wanted to put them onto the web. I only developed Web apps in PHP before. And it seemed to be a big pain for porting a Python program to the web. But, I figured out in 5 minutes.

First, you need an Apache server on your Linux/Mac OS/Windows box. If you are gonna use data base, you need a database server. There are tons of blogs addressing these issues. So I won't be gossipy here. Suppose everything we mention below happens on your server-even web browsing.

Installing Agilent ADS 2009 on Ubuntu Linux 9.04

by Forrest Sheng Bao http://fsbao.net

Agilent ADS is a great tool for circuit simulation on Linux.

1. Install ksh

sudo apt-get install ksh

2. Download and extract ADS2009 installation files. Enter the directory that stores all installation files. Run

./SETUP.SH

and follow on-screen instructions.

Be sure to set the proper path for ADS2009. ADS2009 could be very big, 5.5 GB. So it is better to install it on a separate partition other than your root partition, like below.

Syndicate content