National Instruments Car Stereo System 320571-01 用户手册

下载
页码 157
NI-DSP Analysis VI Reference 
Chapter 2
Part 3:  NI-DSP Function Reference 
2-73 NI-DSP SRM for LabVIEW for Windows
DSP Square Pattern
Generates an array containing a square
pattern.  If the Square Pattern is
represented by the sequence X, then
the pattern is generated according to
the following formula:
x
i
 = 
 

 a       if 0 
 remainder 
( )
 i 
T
 <  0.01 dT
 
 0.0     elsewhere
 for  i = 0, 1, …, n-1 ,
where T  =  
n
cycles
   is the time period of one cycle of the Square Pattern,
a is the amplitude,
d is the duty cycle in percent, and
n is the number of elements in Square Pattern.
amplitude defaults to 1.0.
duty cycle must be greater than or equal to 0 and less than or equal to 100.  If duty cycle is less than
zero or greater than 100, the VI returns an error.  duty cycle defaults to 50.0.
Note: duty cycle must be a percentage.  Make sure you convert the fractions of a cycle into
percentages, as shown below, before using the DSP Square Pattern VI in a block diagram.
Special Cases: Two special cases can occur when the duty cycle assumes its extreme values of 0 and
100.  The VI sets Square Pattern to zero:
duty cycle  = 0 or 100 
⇒ 
X = 0.
cycles must be greater than 0.  If cycles is less than or equal to zero, the VI returns an error.  cycles
defaults to 1.0.
Note: Because cycles is a floating-point number, fractional cycles of the Square Pattern are
permitted.
Square Pattern in is a DSP Handle Cluster that indicates the memory buffer on the DSP board that will
contain the output square pattern.
Square Pattern out is a DSP Handle Cluster that is identical to Square Pattern in, but with the
generated pattern already stored in the memory buffer on the DSP board.  The largest square pattern that
can be generated depends upon the amount of memory on your 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.