Download me 365 experiment 4 - Purdue Engineering

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Heterodyne wikipedia , lookup

Multidimensional empirical mode decomposition wikipedia , lookup

Opto-isolator wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Transcript
ME 365 EXPERIMENT 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
Objectives:
There are four objectives for this Laboratory:
To gain an understanding of the PC data acquisition system, and how to use it well,
To practice using LABVIEW to do data acquisition,
To gain an understanding of how data from different sampled signals is distributed,
To practice calculating simple statistics and confidence intervals for the mean.
After this lab you should:
Be able to acquire signals using the PC system that have low quantization noise
effects and are not clipped or aliased,
Be able to calculate confidence intervals and understand how many significant figures
should be retained,
Have a basic understanding of distributions of simple signals.
Procedure:
A. GETTING THE DATA ACQUISITION AND SIMPLE STATISTICS VI TO WORK
We'll begin by preparing a simple LabVIEW VI which obtains signals from the data
acquisition system and sorts the data into bins for the chi-squared test. Some of the work
in developing this VI has been done for you, and may be found in the
Desktop\ME365\me365.llb library as a file labeled Distribution.VI. Start LabVIEW,
and load this partial VI now. Save a copy of Distribution.VI to your network
directory (R: Drive) and make all changes to that.
The front panel of this VI has been completed for you, and looks similar to Figure 1.
Note that the items labeled: "Number of Samples," "Sample Rate," and "Number of Bins"
are numeric controls which must be filled in properly with the text tool before meaningful
results may be obtained. The "Input Range" item is a text ring control, and may be
cycled through a range of values by clicking on its arrows.
1
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
Figure 1: Distribution.VI Front Panel
If you haven't already, take a look at the incomplete wiring diagram for this VI by
selecting Show Diagram from the Windows menu. All of the items from the front panel
are present, as are some additional components. Of particular interest are the
"365_DAQ_Acquire_multisample_single_channel" and "Histogram" blocks. Just as you
might expect, these components are responsible for acquiring data and sorting the data
into bins. Also notice the "case" component near the lower left-hand corner of the
diagram. This component converts the text ring control output into input range values
depending on which of the choices is selected. You may look at the different cases by
clicking on the left and right arrows.
Complete the wiring diagram as shown in Figure 2 by adding the “Xo” numeric constant
and the “STD. Deviation and Variance” block. The “STD. Deviation and Variance”
block is located by expanding the drop down menu by pressing the double down arrow,
followed by the Mathematics menu, and finally the Prob and Stat menu. Now select the
wiring tool and complete any unfinished connections between the diagram components.
2
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
When you have finished, use the "save as" option under the file menu to save a copy of
the completed VI to your own network drive (R: drive) for safekeeping.
Important note: Take care to position the wiring tool correctly when making
connections. Components like the "365_DAQ_Acquire_multisample_single_channel"
block require several connections which must be made in the precise location shown in
the figure. If you are having trouble wiring a component, it may be useful to enable the
help window by pressing <CTRL>h and then clicking on the component in question.
Once you've finished constructing the diagram and corrected any bad or missing
connections, return to the front panel. If you find you cannot wire the „Histrogram Data‟
element to the „build array‟ element, right click on the „build array‟ element and de-select
„Concatenate inputs‟ option.
Figure 2: Distribution.VI Wiring Diagram
B. USING THE VI TO EXPLORE THE ADC
(i) Set the signal generator to produce a triangular wave: zero DC, frequency
exactly 100 Hz, and amplitude 3 volts (6 Volts peak to peak). This signal can be
generated using “Ramp” wave with the “Symmetry” setting of 50%. Input this
signal into channel 3 of ADC board. Set the VI to capture 5,000 samples at 10,000
samples/second, with the input range set to
10 volts.
Before running the VI sketch what you think the Histogram should look like.
3
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
Set the VI to split the data into 10 equi-spaced bins.
Run the VI and superimpose a sketch of the VI output on your previous graph.
Make a note of bin values, (either print front panel or write down by hand). You
may want to set Input Signal window to show 0 to 0.05 seconds.
Run the VI again. How different are the results?
(ii) Now, leaving the signal generator on the same setting switch the ADC input
range to 1 volt. Sketch what you expect the signal on the computer to look
like.
Run the VI. Set the input signal window time axis to show 0 to 0.05 seconds.
Does it look like your sketch?
4
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
What happened to the distribution?
(iii)
Now reset the sample rate to 5000 samples per second and the ADC input to 10
volts. Reduce the amplitude of the triangular wave to 0.01 volts, you may need
to use a voltage divider to get an amplitude this low. Set the frequency to 2 Hz.
What is the quantization interval at the current settings of the ADC?
note: DAQ hardware uses a 16bit AD converter.
Q
2R
2n
_____________________?
How many of these intervals (Q) fit into the range
0.01 volts?
Increase the number of histogram bins to at least 100. Run the VI and sketch the
histogram below. Explain the appearance of the histogram.
5
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
C. USING THE VI TO EXPLORE DISTRIBUTIONS FROM DIFFERENT SIGNALS
(i) Distribution of a Sampled Sine Wave
Set the signal generator to 3 volts, 100 Hz sinewave. Sample the signal at 5000
samples/second and capture 2,500 samples. Run the VI with the number of bins
set to 12. Sketch the resulting histogram. Sketch the signal with the bin
boundaries (approx.) and try to explain why the histogram looks as it does.
What would the distribution of data coming from a sampled cosine with a DC
shift look like? (Sketch)
(ii) Distribution of a Sampled Square Wave
Repeat step (i), but make the signal a square wave.
(iii) Distribution of a Random Signal
Connect the microphone to the scope and blow across the microphone. From
6
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
observations of the maximum and minimum voltage, choose an appropriate
input range for the ADC.
What ADC input range did you choose and why?
Now connect the output of the microphone to channel 3 of the ADC. Choose a
sample rate of 20,000 samples/second and acquire 0.25 seconds of data. You do
not need to make a note of the number of values in each bin the histogram or of
the estimated mean and standard deviation.
Sketch the histogram.
(iv) Repeatability and Effect of Bin Size
Repeat the microphone measurement several times and comment on the
repeatability of the test.
7
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
Now choose 5 bins and repeat the experiment. Note down the bin centers, the
number of values in each bin and the mean and standard deviation.
Superimpose the histogram sketch on the one above. Now repeat the
experiment with 10 bins and 30 bins (no need to note values in each bin or bin
centers). Comment on the differences between the three plots (10 bins, 5 bins
and 30 bins).
(v) Is the Microphone Data Gaussian?
Sketch the distribution based on the X and
x
calculated when the data was
distributed into 5 bins. You should calculate
for x values equal to the bin centers, to help you draw the sketch.
Superimpose on this p( xi )
th
ni / ( B N ) where B is the bin size, ni the number of
values in the i bin and N the number of points used to form the histogram.
Do you think that the data is Gaussian distributed? Explain your answer.
8
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
D. p( x ) AND CONFIDENCE INTERVALS BASED ON X CALCULATIONS.
(i) Estimates of the Mean Value and Confidence Intervals for the True Mean Value
Reset the number of bins to 10. Repeat the microphone measurement 5 times,
and be careful to repeat so that the range of the input is similar in each
measurement. Note the center of bin 1 and bin 10 as well as the estimated mean
and standard deviation of the data. Calculate the standard deviation of the
estimated mean.
Table 1: Calculations
Measurement
Bin 1 center
Bin 10 center
,X
x
1
2
3
4
5
Now calculate the 99% confidence interval for the true mean for each of the 5
measurement sets. Plot x and the intervals on the line below.
1)
2)
3)
4)
5)
If you repeated the measurement 4000 times, approximately how many 99%
confidence intervals would contain the true mean value?
9
x
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
ME365
Also calculate the 68% confidence intervals and plot them on the line below. Use
the same scale as on the line plot above.
1)
2)
3)
4)
5)
(ii) Distribution of the Mean Estimate
Assume that X are Gaussian distributed:
1
p( x )
1
2
e
2
2
x
x
2
x
which is a good assumption because N > 60. If the measurement is
repeated 2000 times, how many of the estimated means do you expect to lie in
1
the interval
to
x?
2
Assume X is Gaussian distributed and sketch the distributions of x and x on the
same graph.
10
Laboratory 4
Exploring the PC Acquisition System and
Examining Statistics of Sampled Signals
What is the difference between
What happens to
x
x
and
as N
11
x?
ME365