
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Assigned: Thur., Feb 12, 2009 Due: Thur., Feb 19, 2009
The waveform is defined by an array of (x,y) pairs, where each x value corresponds to a specific time value and the corresponding y value is a digitized sample of the signal’s voltage at that time instance. The (x,y) pairs representing the waveforms that I give you as examples will be pairs of floating point numbers. The file format includes two numbers per line separated by a space or tab, each represented in scientific notation.
Once you have the data value pairs read in using LABVIEW (as floating point numbers), you need to scale the y data to convert the floating point numbers to 8-bit integers. One approach is to multiply each of the y values by a constant. This simple approach does not make full use of the entire range that 8-bit integers provide, from -127 to 127. The proper way to scale the floating point values is to parse the array identifying the largest and smallest values. This gives the range of the original data. The ratio of the integer range to floating point range gives a scaling factor that you can use to multiply each of the floating point values. To make this work, you’ll also need to compute an offset that needs to be added to the scaled y value in order to center the waveform in the range of integers. When completed, the smallest and largest floating point y values will map to the smallest and largest integer values given above. See formula below.
Grading: LABVIEW coding style: 20% Proper operation: 80%
zero = (largest + smallest)/2; mult = (largest - smallest)/(2^8 - 2);
y_int[i] = (y_float[i] - zero)/mult;
Parse the floating point y values in LABVIEW, save largest and smallest values and compute two constants:
To convert the array of floating point values to integers: