National Instruments 320571-01 manuel d'utilisation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

Aller à la page of

Un bon manuel d’utilisation

Les règles imposent au revendeur l'obligation de fournir à l'acheteur, avec des marchandises, le manuel d’utilisation National Instruments 320571-01. Le manque du manuel d’utilisation ou les informations incorrectes fournies au consommateur sont à la base d'une plainte pour non-conformité du dispositif avec le contrat. Conformément à la loi, l’inclusion du manuel d’utilisation sous une forme autre que le papier est autorisée, ce qui est souvent utilisé récemment, en incluant la forme graphique ou électronique du manuel National Instruments 320571-01 ou les vidéos d'instruction pour les utilisateurs. La condition est son caractère lisible et compréhensible.

Qu'est ce que le manuel d’utilisation?

Le mot vient du latin "Instructio", à savoir organiser. Ainsi, le manuel d’utilisation National Instruments 320571-01 décrit les étapes de la procédure. Le but du manuel d’utilisation est d’instruire, de faciliter le démarrage, l'utilisation de l'équipement ou l'exécution des actions spécifiques. Le manuel d’utilisation est une collection d'informations sur l'objet/service, une indice.

Malheureusement, peu d'utilisateurs prennent le temps de lire le manuel d’utilisation, et un bon manuel permet non seulement d’apprendre à connaître un certain nombre de fonctionnalités supplémentaires du dispositif acheté, mais aussi éviter la majorité des défaillances.

Donc, ce qui devrait contenir le manuel parfait?

Tout d'abord, le manuel d’utilisation National Instruments 320571-01 devrait contenir:
- informations sur les caractéristiques techniques du dispositif National Instruments 320571-01
- nom du fabricant et année de fabrication National Instruments 320571-01
- instructions d'utilisation, de réglage et d’entretien de l'équipement National Instruments 320571-01
- signes de sécurité et attestations confirmant la conformité avec les normes pertinentes

Pourquoi nous ne lisons pas les manuels d’utilisation?

Habituellement, cela est dû au manque de temps et de certitude quant à la fonctionnalité spécifique de l'équipement acheté. Malheureusement, la connexion et le démarrage National Instruments 320571-01 ne suffisent pas. Le manuel d’utilisation contient un certain nombre de lignes directrices concernant les fonctionnalités spécifiques, la sécurité, les méthodes d'entretien (même les moyens qui doivent être utilisés), les défauts possibles National Instruments 320571-01 et les moyens de résoudre des problèmes communs lors de l'utilisation. Enfin, le manuel contient les coordonnées du service National Instruments en l'absence de l'efficacité des solutions proposées. Actuellement, les manuels d’utilisation sous la forme d'animations intéressantes et de vidéos pédagogiques qui sont meilleurs que la brochure, sont très populaires. Ce type de manuel permet à l'utilisateur de voir toute la vidéo d'instruction sans sauter les spécifications et les descriptions techniques compliquées National Instruments 320571-01, comme c’est le cas pour la version papier.

Pourquoi lire le manuel d’utilisation?

Tout d'abord, il contient la réponse sur la structure, les possibilités du dispositif National Instruments 320571-01, l'utilisation de divers accessoires et une gamme d'informations pour profiter pleinement de toutes les fonctionnalités et commodités.

Après un achat réussi de l’équipement/dispositif, prenez un moment pour vous familiariser avec toutes les parties du manuel d'utilisation National Instruments 320571-01. À l'heure actuelle, ils sont soigneusement préparés et traduits pour qu'ils soient non seulement compréhensibles pour les utilisateurs, mais pour qu’ils remplissent leur fonction de base de l'information et d’aide.

Table des matières du manuel d’utilisation

  • Page 1

    © Copyright 1993 National Instruments Corporation. All Rights Reserved. NI-DSP ™ Software Reference Manual for LabVIEW ® for Windows Digital Signal Processing Software for the PC December 1993 Edition Part Number 320571-01[...]

  • Page 2

    National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 (512) 794-0100 Technical support fax: (800) 328-2203 (512) 794-5678 Branch Offices: Australia (03) 879 9422, Austria (0662) 435986, Belgium 02/757.00.20, Canada (Ontario) (519) 622-9310, Canada (Québec) (514) 694-8521, Denmark 45 76 26 00, Finland (90) 527 [...]

  • Page 3

    Limited Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software[...]

  • Page 4

    Warning Regarding Medical and Clinical Use of National Instruments Products National Instruments products are not designed with components and testing intended to ensure a level of reliability suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving medical or clinical treatment can create a pot[...]

  • Page 5

    © National Instruments Corporation v NI-DSP SRM for LabVIEW for Windows Contents About This Manual .................................................................................................................... xi Assumption of Previous Knowledge .................................................................................................[...]

  • Page 6

    Contents NI-DSP SRM for LabVIEW for Windows vi © National Instruments Corporation DSP Absolute ............................................................................................................................................ 2-4 DSP Add .....................................................................................................[...]

  • Page 7

    Contents © National Instruments Corporation vii NI-DSP SRM for LabVIEW for Windows DSP ReFFT ............................................................................................................................................... 2-66 DSP Reset .................................................................................................[...]

  • Page 8

    Contents NI-DSP SRM for LabVIEW for Windows viii © National Instruments Corporation Chapter 4 Using the DMA VIs .................................................................................................................................. 4-1 DSP DMA Copy(DSP to LV) ..............................................................................[...]

  • Page 9

    Contents © National Instruments Corporation ix NI-DSP SRM for LabVIEW for Windows Figures Part 1 Figure 1-1. Development Paths with the NI-DSP Software ............................................................................. 1-1 Part 2 Figure 1-1. Communication between the PC and the DSP Board .................................................[...]

  • Page 10

    Contents NI-DSP SRM for LabVIEW for Windows x © National Instruments Corporation Tables Part 1 Table 1-1. Subdirectories Created by SETUP ................................................................................................. 1-2 Part 3 Table 1-1. The NI-DSP Analysis VI Groups .............................................................[...]

  • Page 11

    © National Instruments Corporation xi NI-DSP SRM for LabVIEW for Windows About This Manual The NI-DSP Software Reference Manual for LabVIEW for Windows explains how to use the NI-DSP software package for the LabVIEW for Windows environment. The NI-DSP software package contains the NI-DSP Analysis VIs, which are high-level digital signal processing[...]

  • Page 12

    About This Manual NI-DSP SRM for LabVIEW for Windows xii © National Instruments Corporation - Chapter 3, DSP Board Function Overview , contains an overview of the prototypes of the C-callable NI-DSP Analysis functions on the DSP board that you can use in your custom programs. - Chapter 4, Using the DMA VIs, describes two special VIs that transfer [...]

  • Page 13

    About This Manual © National Instruments Corporation xiii NI-DSP SRM for LabVIEW for Windows LabVIEW Data Types Each VI description includes a data type picture for each control and indicator, as illustrated in the following table: Control Indicator Data Type Boolean String Signed 16-bit integer Array of signed 16-bit integers Signed 32-bit intege[...]

  • Page 14

    About This Manual NI-DSP SRM for LabVIEW for Windows xiv © National Instruments Corporation Related Documentation The following documentation available from National Instruments contains information that you may find helpful as you read this manual. • AT-DSP2200 User Manual , part number 320435-01 • LabVIEW Data Acquisition VI Reference Manual[...]

  • Page 15

    About This Manual © National Instruments Corporation xv NI-DSP SRM for LabVIEW for Windows Developer Toolkit The Developer Toolkit, an optional software package that you can purchase separately from National Instruments, is required for building custom libraries with the NI-DSP Interface Utilities. The Developer Toolkit contains an AT&T C comp[...]

  • Page 16

    NI-DSP SRM for LabVIEW for Windows 1-1 Part 1: Getting Started with NI-DSP Part 1 Getting Started with NI-DSP This part contains a brief product overview, information about the NI-DSP for LabVIEW for Windows package, and the procedure for installing the software. Product Overview The NI-DSP software package comes with a set of LabVIEW VIs that invo[...]

  • Page 17

    Getting Started with NI-DSP Part 1 Part 1: Getting Started with NI-DSP 1-2 NI-DSP SRM for LabVIEW for Windows What Your Distribution Diskettes Should Contain The NI-DSP software package contains the NI-DSP for LabVIEW for Windows Disks (for licensed LabVIEW for Windows users). If your kit is missing any of these components, contact National Instrum[...]

  • Page 18

    Part 1 Getting Started with NI-DSP NI-DSP SRM for LabVIEW for Windows 1-3 Part 1: Getting Started with NI-DSP NIDSP is the name you specify during setup. The SETUP program prompts you for information including the drive letter and directory in which you have installed the standard LabVIEW package. The program also verifies that your hard disk has e[...]

  • Page 19

    NI-DSP SRM for LabVIEW for Windows 1-1 Part 2: Introduction to the NI-DSP Analysis VIs Part 2 Introduction to the NI-DSP Analysis VIs This part describes how to use the NI-DSP Analysis VIs in your LabVIEW applications. This part also describes how to manage memory on the DSP board from your LabVIEW application, and how to transfer data between your[...]

  • Page 20

    Introduction to the NI-DSP Analysis VIs Part 2 Part 2: Introduction to the NI-DSP Analysis VIs 1-2 NI-DSP SRM for LabVIEW for Windows The AT-DSP2200 can process large amounts of data, separately and distinctly from the host PC processor. The board consists not only of a signal processing chip, but also memory where data that the board processes mus[...]

  • Page 21

    Part 2 Introduction to the NI-DSP Analysis VIs NI-DSP SRM for LabVIEW for Windows 1-3 Part 2: Introduction to the NI-DSP Analysis VIs The DSP Allocate Memory VI allocates memory buffers on the DSP board and returns a DSP Handle Cluster, which has two fields that uniquely describe this buffer–a DSP Handle and a size. Figure 1-2. DSP Handle Cluster[...]

  • Page 22

    Introduction to the NI-DSP Analysis VIs Part 2 Part 2: Introduction to the NI-DSP Analysis VIs 1-4 NI-DSP SRM for LabVIEW for Windows Figures 1-4 and 1-5 show how to allocate a DSP Handle Cluster of 2,048 4-byte-long elements on board 3. The board number on which the buffer is allocated is important for determining the ownership of the buffer. When[...]

  • Page 23

    Part 2 Introduction to the NI-DSP Analysis VIs NI-DSP SRM for LabVIEW for Windows 1-5 Part 2: Introduction to the NI-DSP Analysis VIs Special Features of the NI-DSP Analysis VIs This section describes the special features of the NI-DSP Analysis VIs that make them different from other LabVIEW VIs. • DSP Handle Cluster in/out . The way you specify [...]

  • Page 24

    Introduction to the NI-DSP Analysis VIs Part 2 Part 2: Introduction to the NI-DSP Analysis VIs 1-6 NI-DSP SRM for LabVIEW for Windows The error in/error out cluster contains the following elements: The boolean value is true if an error occurred, false if no error occurred. code is the error code. source is the source of the error. If an error occur[...]

  • Page 25

    Part 2 Introduction to the NI-DSP Analysis VIs NI-DSP SRM for LabVIEW for Windows 1-7 Part 2: Introduction to the NI-DSP Analysis VIs error out of the Copy Mem(LV to DSP) VI is connected to the error in of the DSP Free Memory VI error out of the DSP Add VI is connected to the error in of the Copy Mem(LV to DSP) VI Figure 1-9. An Example of Using th[...]

  • Page 26

    Introduction to the NI-DSP Analysis VIs Part 2 Part 2: Introduction to the NI-DSP Analysis VIs 1-8 NI-DSP SRM for LabVIEW for Windows An Example of Using NI-DSP Analysis VIs Figures 1-10 and 1-11 show the front panel and block diagram, respectively, of an example using NI-DSP Analysis VIs. Figure 1-10. Front Panel–An Example of Using NI-DSP Analy[...]

  • Page 27

    Part 2 Introduction to the NI-DSP Analysis VIs NI-DSP SRM for LabVIEW for Windows 1-9 Part 2: Introduction to the NI-DSP Analysis VIs This example shows you how to obtain the power spectrum of a sine wave signal. First, generate a sine wave that you want to analyze using the LabVIEW Analysis VIs, then use the Copy Mem(LV to DSP) VI to copy the data[...]

  • Page 28

    NI-DSP SRM for LabVIEW for Windows 1-1 Part 3: NI-DSP Function Reference Chapter 1 NI-DSP Analysis VI Reference Overview This chapter contains an overview of the NI-DSP Analysis VIs and includes a list of the VIs. This chapter describes how the NI-DSP Analysis VIs are organized and how to access them. The NI-DSP Analysis VI Overview The NI-DSP Anal[...]

  • Page 29

    NI-DSP Analysis VI Reference Overview Chapter 1 Part 3: NI-DSP Function Reference 1-2 NI-DSP SRM for LabVIEW for Windows Table 1-1. The NI-DSP Analysis VI Groups (Continued) Filters DSP Butterworth Coefficients DSP Chebyshev Coefficients DSP Inverse Chebyshev Coeff DSP Elliptic Coefficients DSP IIR Filter DSP Equi-Ripple LowPass DSP Equi-Ripple Hig[...]

  • Page 30

    Chapter 1 NI-DSP Analysis VI Reference Overview NI-DSP SRM for LabVIEW for Windows 1-3 Part 3: NI-DSP Function Reference Table 1-1. The NI-DSP Analysis VI Groups (Continued) Utility Functions DSP Reset DSP Load DSP Start DSP Timeout DSP Custom DSP DMA Copy(DSP to LV) DSP DMA Copy(LV to DSP) DSP Handle to Address Analysis VI Organization After insta[...]

  • Page 31

    NI-DSP Analysis VI Reference Overview Chapter 1 Part 3: NI-DSP Function Reference 1-4 NI-DSP SRM for LabVIEW for Windows Figure 1-1. Choosing DSP2200 from the Functions Menu About the Fast Fourier Transform (FFT) The VIs in the Frequency Domain group are based upon the discrete implementation and optimization of the Fourier Transform integral. The [...]

  • Page 32

    Chapter 1 NI-DSP Analysis VI Reference Overview NI-DSP SRM for LabVIEW for Windows 1-5 Part 3: NI-DSP Function Reference The discrete implementation of the DFT is a numerically intense process. However, it is possible to implement a fast algorithm when the size of the sequence is a power of two. These algorithms are known as FFTs, and can be found [...]

  • Page 33

    NI-DSP Analysis VI Reference Overview Chapter 1 Part 3: NI-DSP Function Reference 1-6 NI-DSP SRM for LabVIEW for Windows The set of coefficients a and b are often referred to as the numerator and denominator coefficients, respectively. Another common way to refer to them is as the feedforward and feedback coefficients. This is due to the mathematic[...]

  • Page 34

    Chapter 1 NI-DSP Analysis VI Reference Overview NI-DSP SRM for LabVIEW for Windows 1-7 Part 3: NI-DSP Function Reference The simplest window is a rectangular window. Because this window requires no special effort it is commonly referred to as the no window option. Remember, however, that a discrete signal and its spectrum is always affected by a wi[...]

  • Page 35

    NI-DSP Analysis VI Reference Overview Chapter 1 Part 3: NI-DSP Function Reference 1-8 NI-DSP SRM for LabVIEW for Windows Window definitions used in National Instruments analysis libraries are designed in such a way that the window operations in the time domain are exactly equivalent to the operations of the same window in the frequency domain. To m[...]

  • Page 36

    NI-DSP SRM for LabVIEW for Windows 2-1 Part 3: NI-DSP Function Reference Chapter 2 NI-DSP Analysis VI Reference This chapter contains a brief explanation of each NI-DSP Analysis VI . The VIs are arranged alphabetically. Copy Mem(DSP to DSP) Copies a buffer of data from the Source buffer on the DSP board that is referred to by a DSP Handle Cluster t[...]

  • Page 37

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-2 NI-DSP SRM for LabVIEW for Windows Copy Mem(DSP to LV) Copies an entire or partial buffer of data according to the entire/partial copy selector from the Source buffer on the DSP board that is referred to by a DSP Handle Cluster to the destination buffer in LabVIEW. To copy[...]

  • Page 38

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Reference 2- 3 NI-DSP SRM for LabVIEW for Windows Copy Mem(LV to DSP) Copies a buffer of data from th e source buffer in LabVIEW to the destination buffer on the DSP board, which is referred to by a DSP Handle Cluster. The source buffer can contain one of three kinds of data–float (3[...]

  • Page 39

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2- 4 Part 3: NI-DSP Function Reference DSP Absolute Find the absolute value of input array X . The i th element of the output arra y Y is obtained using the following formula: Y(i) = |X(i) |. for i = 0, 1, 2, … , n-1 where n is the number of elements in X . X is a DSP Handl[...]

  • Page 40

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Reference 2- 5 NI-DSP SRM for LabVIEW for Windows DSP Add Add arra y X to array Y. The i th element of the output array Z is obtained using the following formula: Z(i) = X(i) + Y(i). for i = 0, 1, 2, … , n-1 where n is the smaller number of elements in X and Y . X is a DSP Handle Clu[...]

  • Page 41

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2- 6 Part 3: NI-DSP Function Reference DSP Allocate Memory Allocates a block of memory buffer on the DSP board specified by slot and returns a DSP Handle Cluster that contains the coded DSP board memory and the number of elements in this buffer. The number of bytes allocated [...]

  • Page 42

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Reference 2- 7 NI-DSP SRM for LabVIEW for Windows DSP Blackman Window Applies a Blackman window to the input sequence X . If Y represents the output sequence Blackman{X } , the elements of Y are obtained from the following formula: y i = x i [0.42 - 0.50 cos(w) + 0.08 cos(2w)] for i = [...]

  • Page 43

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2- 8 Part 3: NI-DSP Function Reference DSP Blackman Harris Window Applies a Blackman Harris window to the input sequence X . If Y represents the output sequence Blackman Harris{X} , the elements of Y are obtained using the following formula: y i = x i [0.42323 - 0.49755 cos(w[...]

  • Page 44

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Reference 2- 9 NI-DSP SRM for LabVIEW for Windows DSP Butterworth Coefficients Generates the set of filter coefficients to implement an IIR filter as specified by the Butterworth filter model. You can then pass these coefficients to the DSP IIR Filter VI to filter a sequence of data. f[...]

  • Page 45

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-1 0 Part 3: NI-DSP Function Reference Parameter Discussion The arrays Forward Coefficients in/out an d Feedback Coefficients in/out must have a size of at least ( order + 1) for lowpass and highpass filters. The arrays Forward Coefficients in/out an d Feedback Coefficients [...]

  • Page 46

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-11 Part 3: NI-DSP Function Reference Feedback Coefficients out is a DSP Handle Cluster that is identical to the Feedback Coefficients in , but with the feedback coefficients already stored in the memory buffer on the DSP board. error in (no error) contains the error informa[...]

  • Page 47

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-12 NI-DSP SRM for LabVIEW for Windows DSP Complex FFT Computes the Fast Fourier transform of the complex input sequence X. If Y represents the complex output sequence, then: Y = F {X}. Re{X} is a DSP Handle Cluster that indicates the memory buffer on the DSP board that conta[...]

  • Page 48

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-13 Part 3: NI-DSP Function Reference DSP Convolution Computes the convolution of the input sequences X and Y . The convolution Cxy(t), of the signals x(t) and y(t), is defined as follows: C xy(t) = x(t) * y(t) = ∫ - ∞ ∞ x( τ ) y(t- τ ) d τ , where the symbol * deno[...]

  • Page 49

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-14 NI-DSP SRM for LabVIEW for Windows DSP Correlation Computes the cross correlation of the input sequences X and Y . The cross correlation R xy (t) of the signals x(t) and y(t) is defined as follows: R xy (t) = x(t) ⊗ y(t) = ∫ - ∞ ∞ x( t ) y(t+ t ) d t , where the s[...]

  • Page 50

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-15 Part 3: NI-DSP Function Reference DSP Cross Power Computes the cross power spectrum of the input sequences X and Y . The cross power, S xy (f), of the signals x(t) and y(t) is defined as follows: S xy (f) = X * (f)Y(f) where X * (f) is the complex conjugate of X(f), X(f)[...]

  • Page 51

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-16 NI-DSP SRM for LabVIEW for Windows DSP Custom Use this VI as the interface to call your own custom functions written on the DSP board from LabVIEW. For more details about how to use this VI, refer to Part 4, NI-DSP Interface Utilities , of this manual. slot is the board I[...]

  • Page 52

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-17 Part 3: NI-DSP Function Reference DSP Decimate Decimates the input sequence X by the decimating factor and the averaging control. If Y represents the output sequence Decimated Array , the elements of the sequence Y are obtained using: Y i = X im 1 m X i(m + k) k = 0 m ?[...]

  • Page 53

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-18 NI-DSP SRM for LabVIEW for Windows DSP Deconvolution Computes the deconvolution of the input sequences X and Y . The convolution operation can be realized using Fourier identities because x(t) * y(t) ⇔ X(f) Y(f) is a Fourier transform pair, where the symbol * denotes co[...]

  • Page 54

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-19 Part 3: NI-DSP Function Reference DSP Derivative Performs a discrete differentiation of the sampled signal X . The differentiation f(t) of a function F(t) is defined as follows: f(t) = d dt F(t). Let Y represent the sampled output sequence d/dt X . The discrete implement[...]

  • Page 55

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-20 NI-DSP SRM for LabVIEW for Windows DSP Divide Divide array X by array Y. The i th element of the output array Z is obtained using the following formula: Z(i) = X(i) / Y(i). for i = 0, 1, 2, …, n-1. where n is the smaller number of elements in X and Y . X is a DSP Handle[...]

  • Page 56

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-21 Part 3: NI-DSP Function Reference DSP Elliptic Coefficients Generates the set of filter coefficients to implement a digital elliptic IIR filter. You can then pass these coefficients to the DSP IIR Filter VI. filter type specifies the passband of the filter. filter type h[...]

  • Page 57

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-22 NI-DSP SRM for LabVIEW for Windows 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. Parameter Discussion The arrays Fo[...]

  • Page 58

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-23 Part 3: NI-DSP Function Reference DSP Equi-Ripple BandPass Generates a bandpass FIR filter with equi-ripple characteristics using the Parks-McClellan algorithm and the number of taps, lower stop frequency, higher stop frequency, lower pass frequency, higher pass frequenc[...]

  • Page 59

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-24 NI-DSP SRM for LabVIEW for Windows A delay is also associated with the output sequence delay = m-1 2 . 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[...]

  • Page 60

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-25 Part 3: NI-DSP Function Reference DSP Equi-Ripple BandStop Generates a bandstop FIR digital filter with equi-ripple characteristics using the Parks-McClellan algorithm and number of taps, lower pass frequency, higher pass frequency, lower stop frequency, higher stop freq[...]

  • Page 61

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-26 NI-DSP SRM for LabVIEW for Windows A delay is also associated with the output sequence: delay = m-1 2 . 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 th[...]

  • Page 62

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-27 Part 3: NI-DSP Function Reference DSP Equi-Ripple HighPass Generates a highpass FIR filter with equi-ripple characteristics using the Parks-McClellan algorithm and the number of taps, high frequency, stop frequency, and sampling frequency. The VI then filters the input s[...]

  • Page 63

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-28 NI-DSP SRM for LabVIEW for Windows 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 cannot be performed [...]

  • Page 64

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-29 Part 3: NI-DSP Function Reference DSP Equi-Ripple LowPass Generates a lowpass FIR filter with equi - ripple characteristics using the Parks - McClellan algorithm and the number of taps, pass frequency, stop frequency, and sampling frequency. The VI then filters the input[...]

  • Page 65

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-30 NI-DSP SRM for LabVIEW for Windows DSP Exact Blackman Window Applies an Exact Blackman window to the input sequence X . If Y represents the output sequence Exact Blackman{X} , the elements of Y are obtained using the formula: y i = x i [0.42659071 - 0.49656062 cos(w) + 0.[...]

  • Page 66

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-31 Part 3: NI-DSP Function Reference DSP Exponential Window Applies an exponential window to the input sequence X . If Y represents the output sequence Exponential{X} , the elements of Y are obtained using the formula: y i = x i exp(a * i) for i = 0, 1, 2, … , n-1, a = ln[...]

  • Page 67

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-32 NI-DSP SRM for LabVIEW for Windows DSP FHT Computes the fast Hartley transform (FHT) of the input sequence X . The Hartley transform of a function x(t) is defined as follows: X(f) = ∫ - ∞ ∞ x(t) cas(2 π ft) dt where cas(x) = cos(x) + sin(x). If Y represents the out[...]

  • Page 68

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-33 Part 3: NI-DSP Function Reference DSP Flat Top Window Applies a flat top window to the input sequence X . If Y represents the output sequence Flattop{X} , the elements of Y are obtained using the formula: y i = x i [0.2810639 - 0.5208972 cos(w) + 0.1980399 cos(2w)] for i[...]

  • Page 69

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-34 NI-DSP SRM for LabVIEW for Windows DSP Force Window Applies a force window to the input sequence X If Y represents the output sequence Force{X} , the elements of Y are obtained using the formula: y i =      x i if 0 ≤ i ≤ d 0 elsewhere for i = 0, 1, 2, [...]

  • Page 70

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-35 Part 3: NI-DSP Function Reference DSP Gaussian White Noise Generates a Gaussian distributed pseudorandom pattern whose statistical profile is as follows: ( µ , σ ) = (0, s) , where s is the absolute value of the specified standard deviation . standard deviation default[...]

  • Page 71

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-36 NI-DSP SRM for LabVIEW for Windows DSP General Cosine Window Applies a general cosine window to the input sequence X . If A represents the Cosine Coefficients input sequence and Y represents the output sequence GenCos{X} , the elements of Y are obtained using the formula:[...]

  • Page 72

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-37 Part 3: NI-DSP Function Reference DSP Hamming Window Applies a Hamming window to the input sequence X . If Y represents the output sequence Hamming {X} , the elements of Y are obtained from the formula: y i = x i [0.54 - 0.46 cos(w)] for i = 0, 1, 2, …, n-1 , w = 2 π [...]

  • Page 73

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-38 NI-DSP SRM for LabVIEW for Windows DSP Handle To Address Finds the actual DSP address value of DSP Handle Cluster that indicates a memory buffer on the DSP board. You can use the output DSP Address as the input of the DSP Address terminal in the DSP DMA Copy(DSP to LV) VI[...]

  • Page 74

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-39 Part 3: NI-DSP Function Reference DSP Hanning Window Applies a Hanning window to the input sequence X . If Y represents the output sequence Hanning {X} , the elements of Y are obtained using the formula: y i = 0.5 x i [1 - cos(w)] for i = 0, 1, 2, …, n-1 , w = 2 π i n[...]

  • Page 75

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-40 NI-DSP SRM for LabVIEW for Windows DSP IIR Filter Performs IIR filtering on the X input array and reports the result in Y . It uses the arrays a and b of sizes sza and szb respectively in implementing the linear difference equation that describes IIR filtering: k = sza - [...]

  • Page 76

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-41 Part 3: NI-DSP Function Reference Y out is a DSP Handle Cluster that is identical to Y in , but with the filtered data already stored in the memory buffer on the DSP board. Final Conditions on input is a DSP Handle Cluster that is identical to Initial Conditions on input[...]

  • Page 77

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-42 NI-DSP SRM for LabVIEW for Windows DSP Impulse Pattern Generates an array containing an impulse pattern. If the Impulse Pattern is represented by the sequence X, the VI generates the pattern according to the following formula: x i =      a if i = d 0 elsewh[...]

  • Page 78

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-43 Part 3: NI-DSP Function Reference DSP Impulse Train Pattern Generates a train of impulses of value amplitude at sample delay . If the impulse train pattern is represented by the sequence X, the VI generates the pattern according to the following formula: x i =   ?[...]

  • Page 79

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-44 NI-DSP SRM for LabVIEW for Windows DSP Index Memory Indexes into a DSP buffer allocated in the memory space of the specified DSP board. The return value is another DSP Handle Cluster. This VI does not allocate memory. In order to index into a buffer correctly, you need to[...]

  • Page 80

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-45 Part 3: NI-DSP Function Reference DSP Init Memory Initializes the memory heaps and frees all allocations of memory on the specified DSP board. slot is the board ID number. slot defaults to 3. error in (no error) contains the error information from a previous VI. If an er[...]

  • Page 81

    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 element[...]

  • Page 82

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-47 Part 3: NI-DSP Function Reference DSP Inv Chebyshev Coeff Generates the set of filter coefficients to implement an inverse IIR filter as specified by the Chebyshev II Filter mode. You can then pass these coefficients to the DSP IIR Filter VI to filter a sequence of data.[...]

  • Page 83

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-48 NI-DSP SRM for LabVIEW for Windows 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. Parameter Discussion The arrays Fo[...]

  • Page 84

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-49 Part 3: NI-DSP Function Reference DSP Inverse FHT Computes the inverse fast Hartley transform of the input sequence FHT {X} . The inverse Hartley transform of a function X(f) is defined as x(t) = ∫ - ∞ ∞ X(f) cas(2 π ft) df where cas(x) = cos(x) + sin(x). If Y rep[...]

  • Page 85

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-50 NI-DSP SRM for LabVIEW for Windows DSP Kaiser-Bessel Window Applies a Kaiser-Bessel window to the input sequence X . If Y represents the output sequence Kaiser-Bessel{X} , the elements of Y are obtained using the formula: y i = x i I o β 1. 0 - a 2     I o β[...]

  • Page 86

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-51 Part 3: NI-DSP Function Reference DSP Linear Evaluation Performs a linear evaluation of the input array X. The i th element of the output array Y is obtained using the following formula: Y(i) = a* X(i) + b for i = 0, 1, 2, …, n-1, where n is the number of elements in X[...]

  • Page 87

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-52 NI-DSP SRM for LabVIEW for Windows DSP Log Computes the logarithm base 10 of the X input array. The ith element of resulting array is obtained by using the following formula: y(i) = log10 (X(i)) * mult for i = 0, 1, 2, …, n-1, where n is the number of elements in X . Th[...]

  • Page 88

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-53 Part 3: NI-DSP Function Reference DSP Max & Min Finds the maximum and minimum values in the input array, as well as the respective indices of the occurrence of the maximum and minimum values. X is a DSP Handle Cluster that indicates the memory buffer on the DSP board[...]

  • Page 89

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-54 NI-DSP SRM for LabVIEW for Windows DSP Median Filter Applies a median filter of rank to the input sequence X . The median filter is a nonlinear filter that combines lowpass filters characteristics (to remove high- frequency noise) and high-frequency characteristics (to de[...]

  • Page 90

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-55 Part 3: NI-DSP Function Reference DSP Multiply Multiply array X by array Y. The i th element of the output array Z is obtained using the following formula: Z(i) = X(i) * Y(i) for i = 0, 1, 2, …, n-1, where n is the smaller number of elements in X and Y . X is a DSP Han[...]

  • Page 91

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-56 NI-DSP SRM for LabVIEW for Windows DSP Parks-McClellan Generates a set of linear-phase finite impulse response multiband digital filter coefficients using the number of taps, sampling frequency, filter type, and Band Parameters . # of taps is the total number of coefficie[...]

  • Page 92

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-57 Part 3: NI-DSP Function Reference weighted ripple is a DSP Handle Cluster that indicates the memory buffer on the DSP board that contains the weighting factor for each band. For each band, higher freq must be greater than lower freq , and for adjacent bands, lower freq i[...]

  • Page 93

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-58 NI-DSP SRM for LabVIEW for Windows The equi-ripple filters use a similar technique to filter the data.[...]

  • Page 94

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-59 Part 3: NI-DSP Function Reference Parameter Discussion The weights are usually the same for every band and inversely proportional to frequency f for a differentiate. The amplitudes of the bands are usually the same for every band and form a slope for a differentiation. T[...]

  • Page 95

    NI-DSP Analysis VI Reference Chapter 2 Part 3: NI-DSP Function Reference 2-60 NI-DSP SRM for LabVIEW for Windows DSP Polar to Rectangular Converts a set of polar coordinate points ( Magnitude, Phase ) to a set of rectangular coordinate points ( X , Y ). The i th elements of the rectangular set is obtained using the following formulas: X (i) = Magni[...]

  • Page 96

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-61 Part 3: NI-DSP Function Reference DSP Polynomial Evaluation Performs a polynomial evaluation on the input array X. The i th element of the output array Y is obtained using the following formula: k -1 Y (i) = ∑ ( Coefficients (j) * X (i) j ) j=0 for i = 0, 1, 2, …, n-[...]

  • Page 97

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-62 Part 3: NI-DSP Function Reference DSP Power Spectrum Computes th e Power Spectrum of the input sequence X . The Power Spectrum S xx (f) of a function x(t) is defined as S xx (f) = X * (f)X(f) = | X(f) | 2 , wher e X(f) = F {x(t)}, and X * (f) is the complex conjugate of [...]

  • Page 98

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-63 NI-DSP SRM for LabVIEW for Windows DSP Pulse Pattern Generates an array containing a pulse pattern. If Pulse Pattern is represented by the sequence X, then the pattern is generated according to the following formula: x i =      a if d ≤ i < last 0 el[...]

  • Page 99

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-64 Part 3: NI-DSP Function Reference DSP Ramp Pattern Generates an array containing a ramp pattern. If the Ramp Pattern is represented by the sequence X, then the pattern is generated according to the formula: x i = x 0 + i ∆ x for i = 0, 1, 2, … , n-1 , wher e ∆ x = [...]

  • Page 100

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-65 NI-DSP SRM for LabVIEW for Windows DSP Random Pattern Generates a uniformly distributed pseudorandom pattern whose values are in the range [0:1]. The sequence is generated using the Very-Long-Cycle random number generator algorithm. see d < 65536.0. If seed > 0.0,[...]

  • Page 101

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-66 Part 3: NI-DSP Function Reference DSP Rectangular To Polar Converts a set of rectangular coordinate points ( X , Y ) to a set of polar coordinate points ( Magnitude , Phase ). The i th element of the polar coordinate set is obtained by using the following fomulas: Magnit[...]

  • Page 102

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-67 NI-DSP SRM for LabVIEW for Windows DSP ReFFT Computes the Fast Fourier transform of a real input sequence X. If Y represents the complex output sequence, then: Y = F {X}. X is a DSP Handle Cluster that indicates the memory buffer on the DSP board that contains the input[...]

  • Page 103

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-68 Part 3: NI-DSP Function Reference DSP Reverse Reverse the order of the elements of the input array X. X is a DSP Handle Cluster that indicates the memory buffer on the DSP board that contains the input signal array X. The operation can only be performed in place; that is[...]

  • Page 104

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-69 NI-DSP SRM for LabVIEW for Windows DSP Sawtooth Pattern Generate a sawtooth pattern with positive-slope, zero-crossing at sampl e dela y . If the sawtooth pattern is represented by the sequence Y, then the pattern is generated according to the following formula: y i = ?[...]

  • Page 105

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-70 Part 3: NI-DSP Function Reference DSP Set Set the elements of the input array X to the constant value set value . If the output Set {X} is represented by the sequence Y, then: y i = set value for i = 0, 1, 2, …, n-1 , where n is the number of elements in X . X is a DSP[...]

  • Page 106

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-71 NI-DSP SRM for LabVIEW for Windows DSP Sinc Pattern Generates an array containing a sinc pattern. If the Sinc Pattern is represented by the sequence Y, then the pattern is generated according to the following formula: y i = a sinc(i ∆ t - d) , for i = 0, 1, 2, …, n-[...]

  • Page 107

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-72 Part 3: NI-DSP Function Reference DSP Sine Pattern Generates an array containing a sinusoidal pattern. If the Sine Pattern is represented by the sequence Y, the pattern is generated according to the following formula: y i = a sin(x i ) , for i = 0, 1, 2, …, n-1 , wher [...]

  • Page 108

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 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[...]

  • Page 109

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-74 Part 3: NI-DSP Function Reference DSP Square Root Find a square root estimate of the absolute value of each element of the input array X . The i th element of the output arra y Y is obtained using the following formula: Y(i) = | X ( i ) | for i = 0, 1, 2, …, n-1 , wher[...]

  • Page 110

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-75 NI-DSP SRM for LabVIEW for Windows DSP Sort Sort the input array X in ascending or descending order. X is a DSP Handle Cluster that indicates the memory buffer on the DSP board that contains the input signal array X. direction is the direction to sort: 0: ascending. 1: [...]

  • Page 111

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-76 Part 3: NI-DSP Function Reference DSP Start Enables the DSP board to run. Use DSP Start with the DSP Load and DSP Reset VIs after downloading a custom application. slot is the board ID number . slot defaults to 3. error in (no error) contains the error information from a[...]

  • Page 112

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-77 NI-DSP SRM for LabVIEW for Windows DSP Subtract Subtract arra y Y from arra y X. The i th element of the output arra y Z is obtained using the following formula: Z(i) = X(i) -Y(i) . for i = 0, 1, 2, …, n-1 , where n is the smaller number of elements in X and Y . X is [...]

  • Page 113

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-78 Part 3: NI-DSP Function Reference DSP TimeOut Selects the timeout limit in seconds to wait for a function on DSP board to complete execution. The default timeout setting at startup and after a DSP Reset call is 10 s. All subsequent calls from the VI to the onboard functi[...]

  • Page 114

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-79 NI-DSP SRM for LabVIEW for Windows DSP Triangle Pattern Generates an array containing a triangle pattern. If the Triangle Pattern is represented by the sequence Y, the pattern is generated according to the following formula: y i = a tri (x i ) , for i = 0, 1, 2, …, n-[...]

  • Page 115

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-80 Part 3: NI-DSP Function Reference Amplitude 0 0 Delay (s) W idth (s) delta t (s) The following figure illustrates how the pattern can vary with different values for the parameters. W idth (s) delta t (s ) delta t (s) 0 0 Delay = 0 Delay = delta t Notice that when th e De[...]

  • Page 116

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-81 NI-DSP SRM for LabVIEW for Windows DSP Triangular Train Generates a train of triangular pattern crossing value zero a t delay with positive slope. If the triangular train is represented by the sequence Y, the pattern is generated according to the following formula: y i [...]

  • Page 117

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-82 Part 3: NI-DSP Function Reference DSP Triangular Window Applies a triangular window to the input sequence X . If Y represents the output sequence Triangle{X} , the elements of Y are obtained from the formula: y i = x i tri(w) for i = 0, 1, 2, …, n-1 , w = 2i-n n , wher[...]

  • Page 118

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-83 NI-DSP SRM for LabVIEW for Windows DSP Uniform White Noise Generates a uniformly distributed pseudorandom pattern whose values are in the range [-a:a], where a is the absolute value of amplitude . The pseudorandom sequence is generated using a modified version of the Ve[...]

  • Page 119

    Chapter 2 NI-DSP Analysis VI Reference NI-DSP SRM for LabVIEW for Windows 2-84 Part 3: NI-DSP Function Reference DSP Unwrap Phase Unwraps the Phas e array by eliminating discontinuities whose absolute values exceed π . X is a DSP Handle Cluster that indicates the memory buffer on the DSP board that contains the input signal array. Y in is a DSP Ha[...]

  • Page 120

    NI-DSP Analysis VI Referenc e Chapter 2 Part 3: NI-DSP Function Referenc e 2-85 NI-DSP SRM for LabVIEW for Windows DSP Zero Padder Pads the input array with zero from starting index to the end of the input array. This VI is useful when the size of the acquired data buffers is not a power of two and you want to take advantage of fast processing algo[...]

  • Page 121

    NI-DSP SRM for LabVIEW for Windows 1-1 Part 4: NI-DSP Interface Utilities Chapter 1 Introduction to the NI-DSP Interface Utilities This chapter contains an overview of the NI-DSP Interface Utilities, installation instructions, and explains how to use the NI-DSP Interface Utilities. You should familiarize yourself with the material in this chapter b[...]

  • Page 122

    Introduction to the NI-DSP Interface Utilities Chapter 1 Part 4: NI-DSP Interface Utilities 1-2 NI-DSP SRM for LabVIEW for Windows The Examples directory contains the files used in Part 4, Chapter 2, Getting Started with the NI-DSP Interface Utilities , to build a custom DSP Library. The LIB directory contains LIBLVDSP.a , the archived library of o[...]

  • Page 123

    NI-DSP SRM for LabVIEW for Windows 2-1 Part 4: NI-DSP Interface Utilities Chapter 2 Getting Started with the NI-DSP Interface Utilities This chapter contains a step-by-step example for building a custom DSP Library, creating a LabVIEW interface to a custom function, and executing the custom function from the LabVIEW environment. The chapter demonst[...]

  • Page 124

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-2 NI-DSP SRM for LabVIEW for Windows long *n,*imin,*imax; { long i,j; float *x, small; float localmin ,localmax; if ((*n)<= 0) return(0); x = z; localmin = *x; localmax = localmin; *imax = 0; *imin = 0; for (i=0;i< *n;i++,*x++) { if (localmax &l[...]

  • Page 125

    Chapter 2 Getting Started with the NI-DSP Interface Utilities NI-DSP SRM for LabVIEW for Windows 2-3 Part 4: NI-DSP Interface Utilities • Parameters must be 32-bit floating-point, 32-bit integer scalars, or pointers to arrays of data (any type) – Supported parameter types are 32-bit floating-point scalars and multidimensional arrays, and 32-bit[...]

  • Page 126

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-4 NI-DSP SRM for LabVIEW for Windows • Return a 16-bit short integer error code–Every function should return an integer error code. A list of error codes that the existing DSP Library returns is given in Appendix A, Error Codes . If any of these e[...]

  • Page 127

    Chapter 2 Getting Started with the NI-DSP Interface Utilities NI-DSP SRM for LabVIEW for Windows 2-5 Part 4: NI-DSP Interface Utilities 2. Compile and/or Assemble Source Code Compile all new C source files and assemble all new assembly source files using the WE DSP32C C compiler and assembler. Remember to use only float and long data types for scal[...]

  • Page 128

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-6 NI-DSP SRM for LabVIEW for Windows Notice that functions accepted by the Dispatch application should have acceptable C syntax, that is, names may contain letters, numbers, and the underscore character but must start with a letter or underscore. A fu[...]

  • Page 129

    Chapter 2 Getting Started with the NI-DSP Interface Utilities NI-DSP SRM for LabVIEW for Windows 2-7 Part 4: NI-DSP Interface Utilities 5. Run the Build Dispatch Application to Generate an Assembly Dispatch File The next step is to generate an assembly dispatch file. In the current directory, run dispatch.exe . You can find the executable file unde[...]

  • Page 130

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-8 NI-DSP SRM for LabVIEW for Windows 6. Compile, Assemble, and Link Your Custom Library The last step in building a custom DSP Library is to compile, assemble, and link your custom library using the WE DSP32C tools. You must have installed those tools[...]

  • Page 131

    Chapter 2 Getting Started with the NI-DSP Interface Utilities NI-DSP SRM for LabVIEW for Windows 2-9 Part 4: NI-DSP Interface Utilities The makelib.bat batch file performs the following: 1. makelib.bat assembles the file stackbld.s in the current directory using the AT&T d3as.exe assembler. You need to assemble this file because it includes the[...]

  • Page 132

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-10 NI-DSP SRM for LabVIEW for Windows The array of DSP Handle Clusters holds all the references to arrays of data used by the custom DSP functions. You should bundle the DSP Handle Clusters together to an array in the order they appear in the first gr[...]

  • Page 133

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-1 1 NI-DSP SRM for LabVIEW for Windows 2. Call the Custom VI After you bundle all of the parameters to arrays, connect each array to the corresponding terminals of the Custom VI. Figure 2-7 shows how to connect to the Custom VI for the gmaxmin. c . Fi[...]

  • Page 134

    Chapter 2 Getting Started with the NI-DSP Interface Utilities NI-DSP SRM for LabVIEW for Windows 2-1 2 Part 4: NI-DSP Interface Utilities Figure 2-8. Block Diagram–How to Index the Output Arrays of the Custom VI to Obtain Results o f gmaxmin.c Figure 2-9 shows the whole block diagram that uses the Custom VI to call the custom function gmaxmin. c [...]

  • Page 135

    Getting Started with the NI-DSP Interface Utilities Chapter 2 Part 4: NI-DSP Interface Utilities 2-1 3 NI-DSP SRM for LabVIEW for Windows Figure 2-10. Front Panel–Using the Custom VI to Call gmaxmin.c on the DSP Board from LabVIEW At this point, finish creating the VI interface to call your custom function on the DSP board from LabVIEW. You can c[...]

  • Page 136

    NI-DSP SRM for LabVIEW for Windows 3-1 Part 4: NI-DSP Interface Utilities Chapter 3 DSP Board Function Overview This chapter contains an overview of the prototypes of the C-callable NI-DSP Analysis functions on the DSP board that you can use in your custom programs. Every NI-DSP Analysis VI calls a function on the DSP board. When you write your own[...]

  • Page 137

    DSP Board Function Overview Chapter 3 Part 4: NI-DSP Interface Utilities 3-2 NI-DSP SRM for LabVIEW for Windows Time Domain short DSP_Convolution (float * x, long n, float * y, long m, float * cxy) short DSP_Correlation (float * x, long n, float * y, long m, float * rxy) short DSP_Decimate (float * x, long n, long decFact, long ave, float * y) shor[...]

  • Page 138

    Chapter 3 DSP Board Function Overview NI-DSP SRM for LabVIEW for Windows 3-3 Part 4: NI-DSP Interface Utilities short DSP_Sqrt (float * x, long n, float * y) short DSP_Sub (float * x, float * y, long n, flaot * z) short DSP_Subset (float * x, long n, long index, long length, float * y) short DSP_Sum (float * x, long n, float * sum) short DSP_Unwrap[...]

  • Page 139

    NI-DSP SRM for LabVIEW for Windows 4-1 Part 4: NI-DSP Interface Utilities Chapter 4 Using the DMA VIs ____________________________________________________________________________________________ This chapter describes two special VIs that transfer data between the host computer and the DSP board without interfering with the DSP board. Most VIs in t[...]

  • Page 140

    Using the DMA VIs Chapter 4 Part 4: NI-DSP Interface Utilities 4-2 NI-DSP SRM for LabVIEW for Windows The first example is a simple spectral analyzer. The main VI is called Analyzer VI. It uses the DSP Custom Function VI to call a custom function running on the board. The scheme is as follows: • Custom function on the board: 1. Set the data acqui[...]

  • Page 141

    Chapter 4 Using the DMA VIs NI-DSP SRM for LabVIEW for Windows 4-3 Part 4: NI-DSP Interface Utilities DSP DMA Copy(DSP to LV) Copies a buffer of size elements from source(DSP Address) on the DSP board to one of the destination arrays in LabVIEW using the onboard DMA transfer method. This VI uses only the DMA controller on the DSP board to transfer [...]

  • Page 142

    Using the DMA VIs Chapter 4 Part 4: NI-DSP Interface Utilities 4-4 NI-DSP SRM for LabVIEW for Windows DSP DMA Copy(LV to DSP) Copies the data in the LabVIEW array source to the destination(DSP Address) on the DSP board using the onboard DMA method. This VI uses only the DMA controller on the DSP board to transfer data. Therefore, it does not interf[...]

  • Page 143

    © National Instruments Corporation A-1 NI-DSP SRM for LabVIEW for Windows Appendix A Error Codes This appendix contains a list of the error codes returned by the NI-DSP Analysis VIs and the corresponding error messages. Error Conditions If an error condition occurs during execution of any of the VIs in the NI-DSP Analysis, the VI returns an error [...]

  • Page 144

    Error Codes Appendix A NI-DSP SRM for LabVIEW for Windows A-2 © National Instruments Corporation Table A-1. NI-DSP Analysis Library Error Codes (Continued) Error Number Error Name Description -21218 WinDutyCyclesErr The window duty cycle value must be between 0.0 and 100.0. -21219 dtGTZero dt must be greater than zero. -21220 DutyCycleErr The duty[...]

  • Page 145

    Appendix A Error Codes © National Instruments Corporation A-3 NI-DSP SRM for LabVIEW for Windows Table A-1. NI-DSP Analysis Library Error Codes (Continued) Error Number Error Name Description -21308 TransferSizeErr The size of requested block transfer does not have enough space allocated for it on the board. -21309 NotDSPHandle The DSP Handle spec[...]

  • Page 146

    Error Codes Appendix A NI-DSP SRM for LabVIEW for Windows A-4 © National Instruments Corporation Table A-1. NI-DSP Analysis Library Error Codes (Continued) Error Number Error Name Description -21343 IndexSizeOffsetErr The size+offset should be less than or equal to the size of the DSP Handle Cluster that you index into. -21344 InvalidDataType The [...]

  • Page 147

    © National Instruments Corporation B-1 NI-DSP SRM for LabVIEW for Windows Appendix B Customer Communication For your convenience, this appendix contains forms to help you gather the information necessary to help us solve technical problems you might have as well as a form you can use to comment on the product documentation. Filling out a copy of t[...]

  • Page 148

    Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware, and use the completed copy of this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions m[...]

  • Page 149

    NI-DSP for LabVIEW for Windows Hardware and Software Configuration Form Record the settings and revisions of your hardware and software on the line located to the right of each item. Complete this form each time you revise your software or hardware configuration, and use this form as a reference for your current configuration. Completing this form [...]

  • Page 150

    Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: NI-DSP ™ Software Reference Manual for LabVIEW ® for Windows Edition Date: December 1993 Part Number: 320571-01 Please comment on the completeness[...]

  • Page 151

    © National Instruments Corporation Glossary-1 NI-DSP SRM for LabVIEW for Windows Glossary ___________________________________________________ Prefix Meaning Value n- nano- 10 -9 µ - micro- 10 -6 m- milli- 10 -3 k- kilo- 10 3 M- mega- 10 6 1D one-dimensional 2D two-dimensional Cx complex dB decibels DFT Discrete Fourier Transform DMA direct memory[...]

  • Page 152

    © National Instruments Corporation Index- 1 NI-DSP SRM for LabVIEW for Windows Index A Alloc_Mem function, Part 4: 2-3 array VIs DSP Absolute, Part 3: 2-4 DSP Add, Part 3: 2-5 DSP Clip, Part 3: 2-11 DSP Divide, Part 3: 2-20 DSP Linear Evaluation, Part 3: 2-50 DSP Log, Part 3: 2-51 DSP Max & Min, Part 3: 2-52 DSP Multiply, Part 3: 2-54 DSP Pola[...]

  • Page 153

    Index NI-DSP SRM for LabVIEW for Windows Index- 2 © National Instruments Corporation indexing output arrays to obtain results, Part 4: 2-10 to 2-12 linking, Part 4: 2-7 to 2-8 makelib.bat file, Part 4: 2-8 memory management, Part 4: 2-3 parameter guidelines, Part 4: 2-2 to 2-3 prototypes for customizable functions, Part 4: 3-1 to 3-3 source code c[...]

  • Page 154

    Index © National Instruments Corporation Index- 3 NI-DSP SRM for LabVIEW for Windows DSP Ramp Pattern VI, Part 3: 2-61 DSP Random Pattern VI, Part 3: 2-62 DSP Rectangular to Polar VI; Part 3: 65 DSP ReFFT VI, Part 3: 2-63 DSP Reset VI, Part 3: 2-63 DSP Reverse VI, Part 3: 2-64 DSP Sawtooth Pattern VI, Part 3: 2-65 DSP Set VI, Part 3: 2-66 DSP Shif[...]

  • Page 155

    Index NI-DSP SRM for LabVIEW for Windows Index- 4 © National Instruments Corporation L LabVIEW software. See NI-DSP for LabVIEW for Windows. Linear Constant Coefficient Difference Equation, Part 3: 1-5 linker file (ifile), Part 4: 2-4 linking custom libraries, Part 4: 2-7 to 2-8 lowpass filters. See filter VIs. M makelib.bat file, Part 4: 2-8 manu[...]

  • Page 156

    Index © National Instruments Corporation Index- 5 NI-DSP SRM for LabVIEW for Windows DSP Reset, Part 3: 2-63 DSP Reverse, Part 3: 2-64 DSP Sawtooth Pattern, Part 3: 2-65 DSP Set, Part 3: 2-66 DSP Shift, Part 3: 2-66 DSP Sinc Pattern, Part 3: 2-67 DSP Sine Pattern, Part 3: 2-68 DSP Sort, Part 3: 2-71 DSP Square Pattern, Part 3: 2-69 DSP Square Root[...]

  • Page 157

    Index NI-DSP SRM for LabVIEW for Windows Index- 6 © National Instruments Corporation O object filenames, adding to linker file, Part 4: 2-4 output arrays, indexing, Part 4: 2-10 to 2-12 output data buffers, Part 2: 1-5 P parameters creating LabVIEW interface, Part 4: 2-8 to 2-9 guidelines for custom functions, Part 4: 2-2 prototypes for customizab[...]