LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

standard x(t) integration vi: could be improved

Problem with standard Labview Integral x(t).vi (time domain)

What it does:
Performs the discrete integration of the sampled signal X. If Y
represents the output sequence, Integral X; the elements of Y are
obtained using the following equation:

Y[i] = Y[i-1] + (1/6) (X[i-1] + 4*X[i] + X[i+1]) dt.

for i = 0, 1, 2, ...n-1.

where n is the number of elements in X.
Y[-1] = 0.0 (AArgh!)
X[-1] is the initial condition
X[n] is the final condition

The fact that Y[-1] is systematically zero prevents this vi from being
used for continuous buffers the way it can be with IIR filter when
setting
init/cont (init:F) to False

I guess this is a real drawback for real-time continuo
us data
acquisitions with integration.

Experience has shown that writing a dll for the standard execution
executes slower than the standard Integral x(t).vi from Labview. Does
anybody have a fast solution for integration where Y[-1] can be
initialized to the last value from the previous call to integration?
After all, X[-1] can be specified. I do not see why Y[-1] couldn't be
so.
Gérard D'Ans


--
Regards Meilleures salutations Met vriendelijke groeten Mit freundlichen
Grüssen
Gérard D'Ans
Laborelec: gerard.dans@laborelec.be 32 2 3820568 fax 32 2 3820241
Université Libre de Bruxelles: gdans@ulb.ac.be 32 2 6502515
fax 32 2 6502710
URL site: http://www.ulb.ac.be/polytech/laborulb/index.htm
0 Kudos
Message 1 of 4
(2,550 Views)
You can do it by yourself:

Make a VI that calls Integral x(t).vi and remembers (in a shift register)
the value Y[n] for the next call.
On the next call, add this value to the whole Y output array.


Gérard D'Ans a écrit dans le message :
38E0D29A.A47020D9@ulb.ac.be...
> Problem with standard Labview Integral x(t).vi (time domain)
>
> What it does:
> Performs the discrete integration of the sampled signal X. If Y
> represents the output sequence, Integral X; the elements of Y are
> obtained using the following equation:
>
> Y[i] = Y[i-1] + (1/6) (X[i-1] + 4*X[i] + X[i+1]) dt.
>
> for i = 0, 1, 2, ...n-1.
>
> where n is the number of elements in X.
> Y[-1] = 0.0 (AArgh!)
> X[-1] is the initial condition
>
X[n] is the final condition
>
> The fact that Y[-1] is systematically zero prevents this vi from being
> used for continuous buffers the way it can be with IIR filter when
> setting
> init/cont (init:F) to False
>
> I guess this is a real drawback for real-time continuous data
> acquisitions with integration.
>
> Experience has shown that writing a dll for the standard execution
> executes slower than the standard Integral x(t).vi from Labview. Does
> anybody have a fast solution for integration where Y[-1] can be
> initialized to the last value from the previous call to integration?
> After all, X[-1] can be specified. I do not see why Y[-1] couldn't be
> so.
> Gérard D'Ans
>
>
> --
> Regards Meilleures salutations Met vriendelijke groeten Mit freundlichen
> Grüssen
> Gérard D'Ans
> Laborelec: gerard.dans@laborelec.be 32 2 3820568 fax 32 2 3820241
> Université Libre de Bruxelles: gdans@ulb.ac.be 32 2 6502515
> fax 32 2 6502710
> URL site: http://www.ulb.ac.be/polytech/
laborulb/index.htm
>
>
0 Kudos
Message 2 of 4
(2,549 Views)
Dear Jean-Pierre (where are you from?),
It is just what I did the next day.
What is more annoying is the availability of X[N] in the integration scheme.
Granted this kind of predictive filter couteracts the dt phase shift and
produce a smoother integration. I solved it in the vi prototype I sent you by
separate mail
(never mind the spaghetti-like wiring). Note the triple shift register with
successive x[i] buffers. I'll modify this to consume less memory space.
Too bad that integration is not really an IIR filter. The standard library
might have a boolean for initialize/run, to solve the availabilty of X[-1}]
and Y[-1], not X[N] since this gest you out of the standard IIR with inherent
phase lag.
Thanks for your comments. I posted the message at the end of th
e day out of
temper. The next day was better.
Greetings from Belgium
0 Kudos
Message 4 of 4
(2,549 Views)
Very easy to do it by yourself:

Having a Y[-1] value different from 0.0 resutls merely of an additive
constant to the whole Y array.
Thus make a VI that calls Integral x(t).vi and remembers (in a shift
register)
the value Y[n] for the next call.
On the next call, add this value to the whole Y output array.
Have also a boolean the force reinitialisation to Y[-1] to 0.0

Jean-Pierre Drolet


Gérard D'Ans a écrit dans le message :
38E0D29A.A47020D9@ulb.ac.be...
> Problem with standard Labview Integral x(t).vi (time domain)
>
> What it does:
> Performs the discrete integration of the sampled signal X. If Y
> represents the output sequence, Integral X; the elements of Y are
> obtained using the following equation:
>
> Y[i] = Y[i-1] +
(1/6) (X[i-1] + 4*X[i] + X[i+1]) dt.
>
> for i = 0, 1, 2, ...n-1.
>
> where n is the number of elements in X.
> Y[-1] = 0.0 (AArgh!)
> X[-1] is the initial condition
> X[n] is the final condition
>
> The fact that Y[-1] is systematically zero prevents this vi from being
> used for continuous buffers the way it can be with IIR filter when
> setting
> init/cont (init:F) to False
>
> I guess this is a real drawback for real-time continuous data
> acquisitions with integration.
>
> Experience has shown that writing a dll for the standard execution
> executes slower than the standard Integral x(t).vi from Labview. Does
> anybody have a fast solution for integration where Y[-1] can be
> initialized to the last value from the previous call to integration?
> After all, X[-1] can be specified. I do not see why Y[-1] couldn't be
> so.
> Gérard D'Ans
>
>
> --
> Regards Meilleures salutations Met vriendelijke groeten Mit freundlichen
> Grüssen
> Gérard D'Ans
> Laborele
c: gerard.dans@laborelec.be 32 2 3820568 fax 32 2 3820241
> Université Libre de Bruxelles: gdans@ulb.ac.be 32 2 6502515
> fax 32 2 6502710
> URL site: http://www.ulb.ac.be/polytech/laborulb/index.htm
>
>
0 Kudos
Message 3 of 4
(2,549 Views)