Professional Documents
Culture Documents
CSE-471 Lab 06
CSE-471 Lab 06
CSE-471 Lab 06
MAX MARKS
Q. No. CLOs
MARK OBTAINED
1
2
3
4
5
6
7
TOTAL MARKS
PERFORMANCE OBJECTIVES:
Upon completion of this laboratory exercise, the student technicians/engineers will be able to:
1. Write VIs to perform the statistical calculations.
2. Perform data analysis using LABVIEW.
EQUIPMENT:
1 LABVIEW equipped PC
DISCUSSION:
MEAN defines the arithmetic average value.
MEDIAN is the central value when values are arranged in a sorted list.
STANDARD DEVIATION describes the extent of variability in the values.
VARIANCE is the square of the standard deviation.
INTERPOLATION is a method of constructing new data points within the range of a discrete
set of known data points. Various methods that are available in LABVIEW are as follows:
• Nearest (no interpolation, just the closest value in the data set)
• Linear (default)
• Cubic spline
• Cubic hermite
• Lagrange
CURVE FITTING
The general term curve fitting means getting some sort of a curve through a set of data points.
There are two general approaches to curve fitting, with different goals:
Method 1: Get a curve on a graph that goes through each data point; no model (mathematical
equation) is needed.
Method 2: Find the coefficients of a mathematical model (regression equation) that best fits the
model to the data. It is not required that the plotted regression equation go through each data
point.
Method 1 is intrinsically related to interpolation, because the same methods are used for
interpolation and for Method 1 curve fitting. To use LABVIEW Interpolation 1D function for
curve fitting, there are two options:
1. Supply an array of xi values that spans the range of the X values in the data set.
2. Do not supply the xi array at all, but set the ntimes value to tell LABVIEW how many
times to interpolate between the values.
The meaning of ntimes may not be immediately obvious; it indicates how many times
LABVIEW will go through the data set interpolating between each current value of X. This is
illustrated in figure 6.1.The original data points are represented by stars, and with each pass
new stars are added between the original points.
TASK-1
STATISTICAL CALCULATION
In this task the following statistical operations will be performed on the given data to determine
• Minimum and maximum value from the ensemble
• The median
• Mean and standard deviation
PROCEDURE:
1. On the front panel, create an array and name it as sensor data.
2. On the block diagram insert the following VI functions.
a. Funtions>> Mathematics >> Probability an Statistics >>Std Deviation and Variance
b. Funtions>> Mathematics >> Probability an Statistics >> Median
c. Funtions>> Programming >> Array >> Array max and min
3. Connect each block with the sensor data array.
4. Place numerical indicators and connect them to respective output of the each block as shown
in following block diagram as shown in figure 6.2.
5. Execute the VI to insert sensor data manually on the front panel with senor data and observe
its statistical result is shown in figure 6.3.
Figure 6.2 Front Panel (top) and Block Diagram (bottom) for Task 1
TASK-2
INTERPOLATION
In this task the sine value of an angle will be calculated using interpolation operation on the
given data set..
PROCEDURE:
1. On the front panel create the following 1D arrays:
a. Sine
b. Angle
c. Unknown
d. Result (Indicator)
2. Select ring constant in the numeric sub palette and edit its element according to the following
table:
Serial Nr. Type Value
1 Nearest 0
2 Linear (default) 1
3 Cubic Spline 2
4 Cubic Hermite 3
5 Lagrange 4
TASK-3
REGRESSION FOR A LINEAR FIT
The coefficient of determination (R2): If the best fit regression curve goes through every data
point perfectly, R2 = 1. The more distance, there is between the data points and the regression
curve, the smaller the value of R2.
For the following set of data points estimate the slope, intercept, R2.
X Y
1 2.0
2 7.5
3 8.2
4 12.8
5 15.9
6 19.1
7 22.3
8 22.5
PROCEDURE:
1. Construct the block diagram as shown in the figure 6.4. Use search command to find the
functions, the name of which is written in rectangle. The value indicating the intercept and
slope is directly calculate from the curve fitting, whereas for R2 goodness of fit function is
used which requires best fit and value of Y.
2. On the front panel enter the given data to see the actual data and fitted points. (see figure 6.5)
Analytical instruments typically need to be calibrated for one or both of the following
reasons:
• To ensure that the instrument is still reporting correct values.
• To correlate the measurement units to the units output by the instrument.
2. As an example of the latter, consider a meter that measures pH but outputs a voltage
signal suitable for automated data acquisition. A calibration curve is used to correlate
pH and voltage. To calibrate the pH meter, solutions of known pH are prepared and
used with the meter. The output voltages (in triplicate) corresponding to the known pH
values are recorded. The calibration data are listed below.
pH Voltage
1.5 1.21 1.14 1.16
2.3 1.76 1.70 1.76
3.3 2.32 2.39 2.40
4.1 2.89 2.91 2.90
5.6 3.91 3.87 3.89
6.9 4.68 4.72 4.68
7.4 4.98 5.05 5.05
8.2 5.57 5.47 5.57
10.4 7.01 6.98 6.95
11.8 7.96 7.88 7.91
Read the data into LABVIEW, plot it to see if a linear fit is reasonable, and then
regress the data to determine the calibration equation. The calibration equation should
allow you to calculate a pH given a voltage value.
FINAL CHECKLIST
All the students must make sure, before they leave the Lab:
1. Clean your equipment, materials, and work benches before you leave.
2. Return all equipment and materials to their proper storage area.
3. Submit your lab report and answers to the questions, together with your data,
calculations (if any) and results before the next laboratory sessions.