The best approach really depends on your signal. If it is, for
example, a pure (or at least relatively clean) sine tone, you may want
to perform your integration in the frequency domain. Otherwise you'll
have to choose a "cut-off" frequency under which your integration
flattens out or become differentiation (highpass filtering or
ac-coupling).
Finally, when you say you just want the "value of the displacement",
what is it more precisely? The peak value? The rms value?
Could you post a VI with your signal (for example default values on a
graph) to be integrated and some few comments on what you want to
measure?
kungfucrazy wrote:
You need
loop:
y1=y0
y0 = y1+k*u
end
where k is a constant, y0 is the output and u the input to the
integrator. Any slight dc offset will send it soaring high into
saturation however. Pure integrators are normally only used when there is
feedback around say a closed loop system. To implement the above you need
a while loop and a register to get y1. Feed the output y0 into the
register and get y1 from the past value. u is the current input. If you
want this in vector (array) format it is a little more complicated as the
register does not do the trick there. For the array case you have to be a
little smarter.
regards
Tom
I have done something like this, but on chunks of data, and with only
one integration. The program acquires 1000 samples from the AD-card in
each program iteration and puts these into an array. It then
calculates the mean of the array and subtracts the mean from every
array location. After this the array is high pass filtered (signal
prosessing/butterwort filter)and then integratet (signal
prosessing/time domain/integral x(t)).
With this program I measure both a geophone(velocity transducer) and a
accelerometer. When I integrate the accelerometer this way, its time
series matches the volocity time series very vell.
Hope this helps