[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hilbert transform y = hilbert(x,n)
From: |
Dmitri A. Sergatskov |
Subject: |
Re: Hilbert transform y = hilbert(x,n) |
Date: |
Tue, 9 Jun 2009 13:35:42 -0500 |
On Tue, Jun 9, 2009 at 9:35 AM, John B. Thoo<address@hidden> wrote:
> Hello, everyone.
>
> A friend sent me some code he had written for the "dark side." When
> I tried to execute it in Octave, I got the error
>
> error: `hilbert' undefined near line 11 column 8
> error: evaluating assignment expression near line 11, column 6
> error: called from `psidot' in file `/Users/jbthoo/Desktop/
> NumMethPractice/BurgersHilbert/psidot.m'
> error: called from `rk_step' in file `/Users/jbthoo/Desktop/
> NumMethPractice/BurgersHilbert/rk_step.m'
> error: evaluating for command near line 93, column 5
> error: evaluating for command near line 91, column 1
> error: near line 101 of file `/Users/jbthoo/Desktop/NumMethPractice/
> BurgersHilbert/run_amp.m'
> octave-3.0.5:4>
>
> When I looked in the file "psidot.m", I saw near the beginning the line
>
> hpsi = hilbert(psi,lx);
>
> so I googled "octave hilbert". This led me to two definitions of
> "hilbert":
>
> <http://sccn.ucsd.edu/pipermail/eeglablist/2006/001257.html>
> <http://www.nabble.com/Hilbert-transform-m-file-contribution-
> td9238169.html>
>
> However, both of them define
>
> y = hilbert(x)
>
> of one argument instead of two as called in "psidot.m".
hilbert is part of the octave-forge signal-1.0.8 package :
octave:1> help hilbert
-- Function File: H = hilbert (F,N,DIM)
Analytic extension of real valued signal
`H=hilbert(F)' computes the extension of the real valued signal F
to an analytic signal. If F is a matrix, the transformation is
applied to each column. For N-D arrays, the transformation is
applied to the first non-singleton dimension.
`real(H)' contains the original signal F. `imag(H)' contains the
Hilbert transform of F.
`hilbert(F,N)' does the same using a length N Hilbert transform.
The result will also have length N.
`hilbert(F,[],DIM)' or `hilbert(F,N,DIM)' does the same along
dimension dim.
/usr/share/octave/packages/signal-1.0.8/hilbert.m
Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc <topic>' to search the manual index.
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.
octave:2>
>
> How can I modify either of the two definitions that google returned
> so that I can execute my friend's code?
>
> Thanks.
>
> ---John.
Hope that helps,
Dmitri.