SignalProcessing - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Signal Processing : Transforms : SignalProcessing/Hilbert

SignalProcessing

  

Hilbert

  

calculates the Hilbert Transform of a 1-D signal

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

Hilbert( signal, fftlength )

Parameters

signal

-

one-dimensional rtable

fftlength

-

(optional) non-negative integer. The default is numelems(signal).

Description

• 

The Hilbert command takes a 1-D rtable, and computes the (Discrete) Hilbert Transform. The continuous version is defined by a convolution with the function t1πt, and for signal ft, the Hilbert Transform is given by

Ft=ftπtsⅆs

  

where the integral uses the Cauchy Principle Value.

• 

The passed container is converted to an Array of complex[8] datatype. For this reason, it is most efficient for the container to have this datatype beforehand. However, the signal needs to be real-valued, and if a complex[8] rtable is passed, the imaginary parts must be zero.

• 

The fftlength option determines the length of the Arrays used with Discrete Fourier Transforms (DFTs). If fftlength is greater than the size of signal, then padding is used, and if fftlength is smaller than the size of signal, truncation is performed. The default value is numelems(signal). Note that the ideal value for using Fast Fourier Transforms (FFTs) is the smallest power of two that is at least 4 and no smaller than the size of signal, that is, 2^(-ilog2(1/max(4,numelems(signal)))).

• 

An Array of size fftlength is returned, with the real part being the modified (padded or truncated) signal, and the imaginary part being the corresponding Hilbert Transform.

• 

Since DFTs are used to find the Hilbert Transform, there may be numerical artifacts in the result that are small in size.

• 

To obtain the Hilbert Transform, we use the algorithm outlined by S.L. Marple (see references below):

1. 

Pad with zeros or truncate signal so that the modified signal f has size n=fftlength.

2. 

Compute F, the DFT of f.

3. 

Construct G, the Finite Impulse Response (FIR) signal, as follows. First, define k=ceil(n/2)+1. Now, initialize an Array G of size n filled with zeros, and then set G[1]=1, G[i]=2 for i=2..k-1, and, if n is even, G[k]=1. Note that H[i]=0 for i=k+1..n corresponds to the filtering out of negative frequencies.

4. 

Define H to be the element-wise product of F and G.

5. 

Take the Inverse DFT (IDFT) of H, which returns the Hilbert Transform h of signal.

• 

As the underlying implementation of the SignalProcessing package is a module, it is also possible to use the form SignalProcessing:-Hilbert to access the command from the package. For more information, see Module Members.

Examples

withSignalProcessing:

Simple Example

• 

Consider the following simple signal:

AArray1,2,3,4

1234

(1)
• 

Different values of fftlength give different results (here, the default is 4):

HilbertA

1.0+1.0I2.01.0I3.01.0I4.0+1.0I

(2)

HilbertA,5

1.00000000000000071.3763819204711734I2.00.649839392465812I2.99999999999999961.3763819204711738I3.999999999999999+1.70130161670408I0.0+1.701301616704079I

(3)
• 

However, when you increase fftlength, the first four elements converge:

maxabsHilbertA,200..4HilbertA,400..4

0.000549867553851779

(4)

Continuous Signal

• 

Here, we generate a discrete signal from a continuous one. First, define the time bounds and signal:

t110.0

t1−10.0

(5)

t210.0:

ft10t2+1

ft10t2+1

(6)
• 

Second, define the number of points, along with the sample time and signal values:

n64:

φit1+i1t2t1n1:

TArray`~`φseq1..n:

AArray`~`fT,datatype=float8:

• 

Now, we can find and plot the Hilbert Transform:

BHilbertA:

pdataplot,B,legend=Original signal,Transformed signal,title=Discrete Signals vs. Index,color=blue,red,symbolsize=7,font=Verdana,15,legendstyle=font=Verdana,10

• 

The time values are in terms of the indices, but we can transform the plot:

plots:-displayplottools:-transformi,xφi,xp,title=Discrete Signals vs. Time

• 

For comparison, let's determine the Continuous Hilbert Transform, which is fairly simple for this example:

Funapply1πintfτtτ,τ=..,CauchyPrincipalValue,tassumingt::real

Ft10tt2+1

(7)

pplotft,Ft,t=t1..t2,legend=Original signal,Transformed signal,title=Continuous Signals vs. Time,color=blue,red,symbolsize=7,font=Verdana,15,legendstyle=font=Verdana,10

References

  

Marple, S.L., Jr. "Computing the Discrete-Time "Analytic" Signal via FFT." IEEE Transactions on Signal Processing. Vol. 47, No. 9, 1999.

Compatibility

• 

The SignalProcessing[Hilbert] command was introduced in Maple 2020.

• 

For more information on Maple 2020 changes, see Updates in Maple 2020.

See Also

dataplot

inttrans[hilbert]

plottools[transform]

SignalProcessing