Hilbert Transform on data

Hi guys,

This question is regarding the use of hilbert transform command.

On my hand, I have experimental data for w(omega) and Ln(sqrtR(w)). I hope to do a hilbert transform on Ln(sqrtR(w)) and using the w data. How should I do so? I am asking this question because I realise that the IGOR take hilbert transform on Ln(sqrtR(x)) where x is the point number, instead of what I wanted, and it seems to me that there is no way to specify that i want the hilbert transform to be Ln(sqrtR(w)) instead of Ln(sqrtR(x)).

Kindly refer to the picture attached if my question is still ambiguous.

Thank you all in advance.

REgards,
Eecheng
Question_0.png
clanx wrote:

On my hand, I have experimental data for w(omega) and Ln(sqrtR(w)).


You need to clarify if w is a variable or w is a function of omega. It would also help to know what is sqrtR().

If you have a function that has an analytic form I encourage you to at least attempt to write down the full integral. If nothing more it might give you a good idea how to tackle the problem numerically. If you do not have an analytic expression and you just have some data that is a function of some parameter w then one would assume that you can either use direct wave scaling or re-sample the data so that it can be represented by a wave with proper wave scaling. Once you have waveform data you can apply the Hilbert Transform.

A.G.
WaveMetrics, Inc.
Thank you for the reply, appreciated.

anyway, sorry for not making myself clear enough.

The data 'w' is omega, while R is the the reflectivity which is a function of 'w'. Kindly refer to the picture attached for further illustration.

You mentioned about the setting of scale. May I know how this can be done and how does it let me Hilbert transform with respect to 'w', instead of 'x'?

Regards,
Eecheng
Question.png
You are still not telling me if you need to evaluate a numeric or an analytic expression.

Start by executing the command:

DisplayHelpTopic "HilbertTransform"

At the bottom of the topic you should be able to find an example where w0 is a wave containing exponential decay of a cosine oscillation. The Hilbert transform is calculated to give the analytic signal (w0 +i*w0h) from which you can extract the envelope and phase. Note that the example includes a phase unwrapping step which may or may not be relevant to your application.

As you can see, this example includes wave scaling using the SetScale operation. This is an elementary concept in IGOR so it might be a good idea to understand its use before getting to HilbertTransform. You can find out more about this topic by executing the command:

DisplayHelpTopic "The Waveform Model of Data"

I hope this helps,

A.G.
WaveMetrics, Inc.
Hi

I have read the help topic that you mentioned and try to do the following.

Commands typed:

make/ N=100 xdata
Setscale/I x,0,4*pi,xdata
make /N=100 ydata
ydata=cos(xdata)
HilbertTransform /DEST='ydata 1' ydata
make /N=100 'ydata h'=-1* 'ydata 1'

Kindly refer to the picture attached for the values.

From what I know, the hilbert transform of a cosine function gives a sine function. However, the data 'ydata h' does not give me sine function; when xdata =0, 'ydata h' is not 0.

May I know how I can improve this?

Regards,
Eecheng
Question1.png
My guess is that you have forgotten to scale the y-data properly in x and you have to reset the x-scale after the Hilbert transform. I can show you how to fix the former problem. Someone else will have to show you how to fix the latter one. Put this function in a procedure window.

Function DoHilbert()

    // make the empty data and set its x-scale
    make/O/N=100 ydata
    SetScale/I x, 0, 4*pi, ydata
    // set y as the cos() of x
    ydata = cos(x)
    // Hilbert
    HilbertTransform/DEST = hdata ydata
    hdata *= -1
    // re-set the scale on hdata here
    // ...
   
    return 0
end


Now type on the command line …

DoHilbert()
display ydata, hdata


Change the color on hdata to see the difference to ydata.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Hi jjweimer,

Thank you for the reply. However, the approach that you mentioned does not seem to work.
I guess it has smth to do with the amplitude scaling (from what I read from the help topic "Fourier Transform"). However, I do not know how I can scale the amplitude of the sine-wave.
Please enlighten me.

Regards,
EC
This is out of my league. Someone else will have to help you.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
I'm sorry but I still fail to understand where you see a problem. This should be pretty simple:
make/n=1000 ddd=sin(2*pi*x/100)
hilberttransform/dest=hddd ddd
display ddd, hddd

As you can see, you get two sinusoidal waves that represent the sine and cosine (the transform). If you are not sure about this, apply cursors to consecutive peaks with cursor A on ddd and cursor B on hddd and you will see that they are 25 wave points apart. Since 2*pi are covered in 100 points the phase difference is 25*2*pi/100 or pi/2.

A.G.
WaveMetrics, Inc.
Hi,

Thanks for the reply. I am aware that the command that you typed could give me an “accurate” cosine curve (hilbert transform of a sine curve). However, may I know why is it that I could not get an “accurate” cosine curve if I keyed the following command which I believe essentially does the same thing:

make/N=1000 ddd
Setscale/I x,0,2*pi, ddd
ddd=sin(x)
HilbertTransform/Dest=hddd ddd
setscale/I x,0,2*pi,hddd


By saying an “accurate” cosine curve, I mean the following. When ddd has the value of 0, hddd gets the value of 1. If I keyed in the command above, hddd is 0.988301 when ddd has the value of 0. This is why I am puzzled.

Please allow me to ask another question.
Supposed I have a complex function of ydata + i ydata1. The following is the command I typed:


make /N=100 ydata
•setscale/I x,0,10,ydata
•ydata=1/((x+3)^2)
•Display ydata
•hilbertTransform /DEST=ydata1 ydata
•setscale/I x,0,10,ydata1
•ydata1*=-1


Now I want to make sure that I could get back ydata, if I hilbert transform ydata1.


•hilbertTransform /DEST=ydatacheck ydata1
•setscale/I x,0,10,ydatacheck


However, you can see from the picture 1 attached that ydatacheck is different from ydata.
May I know why is this so? How can I improve this?
pic.jpg