National Instruments 320571-01 用户手册

下载
页码 157
NI-DSP Analysis VI Reference 
Chapter 2
Part 3:  NI-DSP Function Reference 
2-46
NI-DSP SRM for LabVIEW for Windows
DSP Integral
Performs the discrete integration of the
sampled signal X.  The integral F(t) of a
function f(t) is defined as follows:
F(t)  = 
 
 
 f(t)  dt  .
Let Y represent the sampled output sequence Integral X.  The VI obtains the elements of Y using the following
formula:
y
i
  =  
1
6
  
j=0
i
  (x
j-1
 + 4x
+ x
j+1
dt
for  i = 0, 1, 2, …, n-1 ,
where n is the number of elements in X,
x
-1
 is specified by initial condition when i = 0, and
x
n
 is specified by final condition when i = n-1.
The initial condition and final condition minimize the overall error by increasing the accuracy at the boundaries,
especially when the number of samples is small.  Determining boundary conditions before the fact enhances
accuracy.
X is a DSP Handle Cluster that indicates the memory buffer on the DSP board that contains the input
signal array.
initial condition defaults to 0.0.
final condition defaults to 0.0.
dt is the sampling interval and must be greater than zero.  If dt is less than or equal to zero, the VI
returns an error.  dt defaults to 1.0.
Y in is a DSP Handle Cluster that indicates the memory buffer on the DSP board that will contain the
results of the integration of X.
Y out is a DSP Handle Cluster that is identical to Y in, but with the results of integration already stored
in the memory buffer on the DSP board.
error in (no error) contains the error information from a previous VI.  If an error occurs, it is passed out
error out and no other calls are made.
error out contains the error information for this call.
The operation can be performed in place; that is, the input X and the output Y can be the same DSP Handle Cluster.
Note: You can also use the DSP Integral x(t) VI to numerically evaluate the finite integral:
a
b
  f(t)  dt  =   F(b) - F(a)  
≈ 
 y
n-1
 ,
by extracting the last element of the output sequence Y.