Click here to load reader
Upload
hanga
View
212
Download
0
Embed Size (px)
Citation preview
Chapter 6Data Acquisition and Spectral
Analysis System
6.1 Introduction
This chapter will discuss the hardware and software involved in developing the
data acquisition and spectral analysis system. The system uses a National Instruments NI
5112 high-speed digitizer card for acquiring time-domain data. The digitizer is used in
conjunction with a software package written in Microsoft Visual Basic 6.0 for interfacing
with the card. The software package fetches the data acquired by the digitizer, displays
the data in a graphical user interface, and performs spectral analysis on the data. The
next section will discuss the fundamental specifications of the digitizer.
6.2 NI 5112 High-Speed Digitizer
The National Instruments NI 5112 is a high-speed digitizer with a maximum real-
time sampling rate of 100 MHz and random interleaved sampling rates from 200 MHz to
2.5 GHz. The random interleaving function obtains multiple sets of samples over several
periods each shifted slightly. The resulting data is used to reconstruct a waveform that
appears to be sampled at a rate higher than what is normally capable by the card. To use
random interleaving the waveform being sampled must be periodic or the reconstructed
signal will not represent the original signal. In contrast, transient signals and periodic
signals can be sampled by using the real-time sampling.
53
54
The NI 5112 has two channels which can sample simultaneously at 8-bits per
sample. Therefore, the digitizer is capable of distinguishing between 256 or 28 different
voltage levels across the dynamic range. This is a direct limitation of the ADC (analog-
to-digital converter) within the card.
The NI 5112 has an input range from 25 mVolts to 25 Volts and a maximum
DC offset of 37 Volts. The input impedance of the digitizer is user selectable and
software controlled for either 50 or 1 M. The voltage seen by the digitizer is
expressed by equation (6.1):
(6.1)
where Vm is the voltage measured by the digitizer, Vs is the voltage of the source, Rs is the
output impedance of the source, and Rin is the input impedance of the digitizer. If the 50
impedance is selected, then the input voltage to the digitizer should be limited to 1 V rms
in order to achieve accurate results from the data acquisition.
All of the functions and settings of the digitizer are software controlled. The NI
5112 is compatible with Visual Basic, Visual C and C++, Labview, LabWindows/CVI,
and Measurement Studio for Visual C++. In this thesis, Visual Basic 6.0 was used to
control and interface with the NI 5112.
6.3 Software Functionality
As discussed in section (6.1), the software package is used to acquire data either
from a data file or a signal source. After the data acquisition phase, the software is used
to display the time-domain information of the signal and to perform spectral analysis.
The frequency-domain information of the signal is acquired from the spectral analysis.
These results are then displayed in the form of magnitude and phase plots.
55
6.3.1 Data Acquisition
The software has the ability to acquire data from the NI 5112 digitizer, retrieve
previously acquired data from a binary (.bin) file, or retrieve data from a text (.txt) file.
The data acquired from the digitizer is the sampled and quantized, time-domain data from
the signal source on channel 0 (ch0). This data is stored in a text (.txt) file and a binary
(.bin) file with the directory and filename specified by the user. The user can later view
the time-domain data by opening the corresponding text (.txt) file in the specified
directory.
To acquire data from the NI 5112, the user must select the “Acquire waveform
and save to file” radio button. Figure (6.1) shows the initial screenshot upon program
execution. Next, a path and filename with the “.bin” extension used to store the acquired
data must be provided by the user in the “File Path” field. The software will also store
the acquired data in ASCII format in a text (.txt) file with the same path and filename.
Before acquiring the data, the user must specify a minimum sample rate and a
minimum record length in the “User Input” frame. The NI 5112 tries to achieve the
specified sample rate and record length. If either of these conditions cannot be met, the
NI 5112 will use a higher value for that certain parameter rather than a smaller value.
The maximum sample rate is 100 million samples/second.
The value of the “Resource Name” field should remain to be the default value
“DAQ::1” unless multiple NI 5112 digitizers are in the system. This parameter directs
the software to the correct digitizer.
56
Figure 6.1 Screen Shot upon Program Execution
As discussed in section (6.2), the input impedance of the NI 5112 is software
controlled. The input impedance can be specified in the “Input Impedance” drop-down
list. The possible values for this parameter are 50 or 1 M.
57
After the above parameters have been specified, the program is ready to acquire
the data from the NI 5112. At this point the user must select “Acquire Data” from the
“Tools” menu or click on the “Acquire Data” button on the startup screen. The time-
domain data will then be displayed on the plot at the bottom of the screen.
To retrieve data from a previously acquired data file, the user must select the
“Read waveform from .bin file and plot” radio button. Next, a path and filename with the
“.bin” extension must be specified by the user in the “File Path” field. After these
parameters have been specified, the program is ready to read in the data. The user must
now select “Read Data” from the tools menu or click the “Read Data” button on the
startup screen. The time-domain data will then be retrieved from the binary file and
displayed on the plot at the bottom of the screen.
To retrieve data from a text file, the user must select the “Read waveform
from .txt file and plot” radio button. Next the user should follow the same procedure for
retrieving data from a binary file. The user can create text files for input into the spectral
analysis software. To do this, the user must first open a new text file. The first line of
the file should contain the record length. The second line of the text file should contain
the sample rate. The third line and below should contain the actual time-domain data
values for input into the software.
After retrieving data from a binary or text file, the “File Feedback” frame displays
the sample rate and record length of the specified file.
6.3.2 Time-Domain Plot
After data acquisition/retrieval the time-domain data is plotted at the bottom of
the startup screen. This is shown in figure (6.2). The horizontal axis represents time and
58
the vertical axis represents volts. The scales for these two axes can be adjusted by
selecting values in the “Plot Controls” frame. If the entire waveform will not fit in the
window, then a horizontal scroll bar becomes visible. This allows the user to scroll in
order to view the entire waveform.
Figure 6.2 Screen Shot of Time-Domain Plot
59
Cursors can be placed on the waveform by left-clicking and right-clicking the
mouse at the desired location on the plot. The “Cursor Info” frame reports the data
values for both the left and right cursors. This can be seen in figure (6.2). The first row
of text boxes displays the sample number for the left and right cursors. The second row
of text boxes displays the value in volts for both cursors. The third row of the “Cursor
Info” frame displays the change in time between the two cursors as well as the inverse of
the change in time between the two cursors. If the left and right cursors are placed one
period apart, then the frequency of the waveform is displayed as the inverse of the change
in time between the two cursors.
6.3.3 Additional Time-Domain Tools
After the data is acquired/retrieved the user can use the tools in the “Tools” menu
to further analyze the data. The user can find the maximum positive value in volts out of
the entire data set by selecting “Find Largest Value” from the “Tools” menu. To find the
largest absolute value, the user can select “Find Largest abs(Value)” from the “Tools”
menu.
Window functions as discussed in Chapter 5 can be applied to the entire input
data set by selecting “Apply Window Function” from the “Tools” menu. The user has
the option of selecting one of the following window functions: rectangular, triangular,
sine lobe, Hanning, Hamming, sine cubed, sine to the fourth, and Blackman. After a
window function is selected, the program then displays the modified data set (the input
data set multiplied by the window function). If a window function has been applied, the
original data set can be reloaded by selecting “Rectangular” window function from the
“Tools/Apply Window Function” menu.
60
The user can perform spectral analysis on the input data by selecting “FFT” or
“Selective FFT” from the “Tools” menu. The “FFT” function performs a fast Fourier
transform algorithm on the entire input data set. The “Selective FFT” function extracts
the data between the two cursors and performs an FFT algorithm on the extracted data. If
a window function is applied, then the “FFT” function performs an FFT algorithm on the
modified data set. After the FFT algorithm has been performed on the input data set, a
new window will open displaying the frequency content of the input data set.
6.3.4 Frequency Plots
The new window contains plots of both the magnitude and phase of the FFT
output coefficients. This is shown in figure (6.3). The upper graph displays the
magnitude spectrum while the lower graph displays the phase spectrum. The horizontal
axis represents the base-10 logarithm of the frequency. The vertical axis on the
magnitude plot can either be displayed in volts or decibels (dB) by selecting the “Vertical
axis in dB” check box in the “Plot Controls” frame. The vertical axis on the phase plot
has units of degrees ranging from (-180 to +180 degrees).
The scales of the plots can be adjusted using the controls within the “Plot
Controls” frame. The “Vertical axis in dB” check box determines the units for the
magnitude plot’s vertical axis. The drop-down list determines the number of volts or
decibels to use per vertical division. The “Expand X-axis” arrow keys are used to zoom
in or out on the magnitude and phase plots’ x-axes. The “Scroll X-axis” horizontal scroll
bar is used to shift the magnitude and phase spectrum to the left or right in order to view
information that is not currently displayed on the plots. The “Vertical Shift” arrow keys
are used to shift the magnitude spectrum up or down along the vertical axis.
61
Figure 6.3 Screen Shot of Frequency Plots
Left-clicking the mouse button on the magnitude or phase plots will place a cursor
at the nearest point. The cursor will appear on both plots corresponding to the same
output coefficient. The cursor information is displayed in the “Cursor Information”
frame. The magnitude in volts or decibels is displayed as well as the phase, the sample
number and the frequency. If the x-axis is zoomed out, it can be hard to select the exact
data point that is desired since the data points will be concentrated in a small region. The
“Left” and “Right” buttons within the “Cursor Information” frame are used to increase or
decrease the cursor’s sample number in order to achieve the exact data point that is
desired by the user.
62
The DC component magnitude can be displayed by selecting “Find DC
Component” from the “Tools” menu.
6.3.5 Help
Brief help topics for using the software are available under the “Help” menu on
the startup window during runtime.