LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Numeric Integration.vi: Is this correct?

Hi:

I wanted to see if someone would be kind enough who has experience with the numeric integration.vi to check some code I have written to use this VI. At the top of the diagram is formula of what I need to code. Basically, what I am doing is integrating a function that I have calculated that is based on the cross-correlation function.

Thanks for your help.

Sincerely,

Don
0 Kudos
Message 1 of 6
(3,272 Views)
Hi Don,

I had a quick glance on your VI and the formula in it. This formula contains terms like fcc(taumax + tau) which IMO are meant to read: value of the (time dependent) function fcc at time (taumax+tau). In your code however you calculate the product fcc * (taumax + tau) which is of course quite different


-Franz
0 Kudos
Message 2 of 6
(3,272 Views)
This is an extremely good point and I need to contact the authors of this article who first used the Nonsymmetry coefficient and determine the correct usage. I guess the reason I assumed multiplication is because the value of fcc at (tau_max - tau) over the period of the integration can result in a lot of values that cannot be evaluated because tau_max - tau will be negative (egs. fcc(-10 usec)) and the correlation fx produced I believe starts at time = 0 and proceeds positively). What do you think? But I will contact them.

Sincerely,

Don
0 Kudos
Message 3 of 6
(3,272 Views)
The "problem" that the function is not defined at negative times tau is a common one: it also happens e.g. in cross- and auto-correlation formulae. A real-world sampled signal always is measured during a finite period of time (mostly starting by convention at t=0), but mathematically the formulae assume an integration from -infinity to +infinity. You may look at the real signal as a product of an ideal one (unlimited in time) and a rectangular window function with value 1 between time=0 and time=T and 0 elsewhere. A Fourier transform of a (bounded in time) function can therefore be considered as the convolution of the Fourier transform of the (unbounded in time) function with the Fourier transform of a rectangular function (which is an x/sin(x) f
untion, AFAI recall). In order to minimize the related artefacts in FFT, people often use other than rectangular window functions before FFT'ing, the 'Hanning' and the 'Hamming' type functions being most widely used.

I don't know if for the formula you are evaluating also such a windowing 'trick' is possible to reduce the artifacts of the function being defined only between 0 and T, but to start with, I would simply assume that fcc(tau) is 0 for tau<0 and for tau>T.

(PS: another argument why in your formula a functional relation and not a product is meant: if it were a product, the integrand could be converted like
[fcc*(taumax+tau)-fcc*(taumax-tau)]^2=fcc^2*[2*tau]^2=4*fcc^2*tau^2, i.e. taumax wouldn't appear any more...)

regards

Franz
0 Kudos
Message 4 of 6
(3,272 Views)
Hello Franz:

I have contacted and left messages with the authors of the article that I saw the formula in but your argument makes sense. I am familiar with the FFT and correlation process and in fact we use the hanning window to reduce the artifacts of the discrete fourier transform just as you say.

Thanks a lot for your help. I will post the final answer when they get back to me. I am glad I had someone else take a look at this.

Now the next step i have to figure out is how to do this in 2d, that is in the spacial image domain. I want to work and calculate the formulation of the nonsymmetry coefficient in the 2d domain. I am going to start with the FFT of the image and the complex conjugate of the FFT of the image to get corr
relation function. At this point, I am a little confused on how to use numeric integration in labview in the 2d domain so need to study that some more.

Sincerely,

Don
0 Kudos
Message 5 of 6
(3,272 Views)
Per one of the authors:

"As for the nonsymmetry coefficient, this
integral is just a measure of the mirror symmetry of fcc around taumax.
It would be zero if perfectly symmetric. The integration should really
be from 0 to +infinity, but as before, outside of some range of tau,
both fcc(taumax-tau) and fcc(taumax+tau) (these are functional
evaluations, and not multiplications) will both go to zero. So the
integral may be appropriately truncated."

So you were correct and I thank you for pointing this out. As explained, this makes perfect sense.

Thanks again,

Don
0 Kudos
Message 6 of 6
(3,272 Views)