[Eeglablist] Hilbert Transform

Nathan Weisz nathanweisz at mac.com
Tue Jan 31 12:10:42 PST 2006


hi

if you have the signal processing toolbox you can use matlab's  
hilbert function.
help hilbert

otherwise 'steal' the function from octave (hilbert.m; see below).  
you might have to adapt 1 or 2 things, but basically it should work  
without big changes.

good luck.
nathan

## Copyright (C) 2000 Paul Kienzle
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   
02111-1307  USA

## usage: y = hilbert(x)
##
## real(y) contains the original signal x (x must be a real-valued)
## imag(y) contains the hilbert transform of x
## if x is a matrix, computes the hilbert transform on each row
function y = hilbert(x)
   if nargin != 1, usage("y = hilbert(x)"); endif
   if !isreal(x), error("hilbert: requires real input vector"); endif
   transpose = rows(x)==1;
   if transpose, x=x.'; endif
   [r, c] = size(x);
   n=2^nextpow2(r);
   if r < n, x = [ x ; zeros(n-r, c) ]; endif
   y = fft(x);
   y = ifft([y(1,:) ; 2*y(2:n/2,:) ; y(n/2+1,:) ; zeros(n/2-1,columns 
(y))]);
   if r < n, y(r+1:n,:) = []; endif
   if transpose, y = y.'; endif
endfunction


On 31.01.2006, at 14:06, UCT Staff Member - emuluh wrote:

> Hi all,
> 	Does anyone know how to hilbert transform eeg data using eeeglab?
> Regards,
> Muluh.
>
> ET MULUH
> MRC/UCT Medical Imaging Research Unit
> Department of Human Biology
> Faculty of Health Sciences
> University of Cape Town
> Observatory 7925
> South Africa
> Tel: +27 21 406-6550
> Cell: 082 44 44 993
> emuluh at cormack.uct.ac.za
> http://www.uct.ac.za/departments/humanbio
> _______________________________________________
> eeglablist mailing list eeglablist at sccn.ucsd.edu
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist- 
> unsubscribe at sccn.ucsd.edu




More information about the eeglablist mailing list