Lab8.Instructions

advertisement

MECH 322r Instrumentation

Lab 8 Differentiation and Spectral Analysis of Discretely Sampled

Signals

In this lab students:

Measure the time-dependent voltage of sine and triangle signals using the myDAQ and

LabVIEW software,

Determine the time derivatives and spectral content of these signals, and

Demonstrate errors that can occur and solution methods.

Instructions:

1.

Construct a LabVIEW virtual instrument (VI) to sample one channel of voltage data from the myDAQ using the ±10 volt scale. Use front panel adjustments to set the sample rate f

S

and the total sampling time T

T

. Perform a spectral analysis of the measured signal, and display the frequency with the maximum amplitude on the front panel. In the properties of the spectral analysis icon, set the Spectral Measurement to magnitude (RMS) and the Result to linear scale.

Plot the time dependent voltage signal and its spectral analysis on the front panel, and write these files to a file (you will remove one or the other of these write to spreadsheet icons in different parts of the experiment). Put the front panel and block diagram of the VI in Figs. 1 and 2 , respectively. Include the spectral measurement settings.

2.

Connect the output of an analog function generator to the inputs of a Scope/Frequency Counter and a myDAQ. A picture of the set-up is at the end of these instructions.

3.

Adjust the function generator to produce a sine wave with frequency of approximate 100 Hz and peak-to-peak amplitude between 1 and 4 volts.

4.

Use the Scope/Frequency Counter to measure the actual peak-to-peak voltage V pp

and frequency f

M

of the signal. What is an expression for the maximum slope of an ideal sinewave,

(dV/dt)

Ideal,Max

, based on these values. Present the results for V pp

, f

M

and (dV/dt)

Ideal,Max

in Table

1 . For the N = 16 bit myDAQ with input range of V

R

= ±10 volts, what is the voltage input resolution error, IRE, absolute voltage uncertainty w

V

.

5.

Set the data acquisition system to measure voltage at a sampling frequency of f

S

= 48,000 samples per second, and a total sampling time T

T

that covers four cycles. Save the voltage versus time data to a file.

6.

Open the file using a spreadsheet program. Determine the sampling time step

 t

S

= 1/f

S

.

Calculate the time derivative of the voltage as a function of time using the first-order centered finite-difference method dT dt

( t ,

 t

D

)

T ( t

  t

D

)

T

2

 t

D

( t

  t

D

)

with two derivative time steps,

 t

D

= m

 t

S

= m/f

S

, m = 1 and 10. Place these results in the two columns next to the time and voltage data columns.

7.

In Fig. 3 , plot two cycle of the voltage signal. Using a secondary y-scale (on the right-hand side of the plot), plot two traces for the derivative (calculated using m = 1 and 10 described above). Also plot horizontal lines showing the maximum and minimum ideal slopes

±(dV/dt)

Ideal,Max

(from Table 1). How do the two methods for calculating the derivatives compare to each other? Are the maximum and minimum finite difference slopes close to

±(dV/dt)

Ideal,Max

?

8.

Repeat steps 3 – 7 for a triangle wave. Present V pp

, f

S

and (dV/dt)

Ideal,Max

in Table 1 . Present the signal and its derivatives in Fig. 4 .

Spectral Analysis

9.

Return the function generator settings to produce a sine wave with approximately f

M

= 100 Hz and V pp

= 1-4 V.

10.

Determine the spectral content of the signal using sampling rates f

S

= 5000, 300, 150 and 70

Hz, and save them to files. Use a sampling time of 1 sec for all four measurements.

11.

In Fig. 5 plot the spectral content for f

S

= 5000, 300, 150 and 70 Hz. Use 0 to 200 Hz on the x-axis. What is the smallest non-zero spectral frequency for a total sampling time of T

T

= 1 sec. Which sampling frequencies f

S

do not give accurate indications of the true peak frequency f p

?

12.

In Table 2 , for all four sampling frequencies f

S

= 5000, 300, 150 and 70 Hz, present the frequency from Fig. 3 with the peak spectral content f

P

. Describe how the frequency of the peak in the spectral content changes with the sampling frequency. Are these results in agreement with sampling theory?

13.

Set the data acquisition sampling rate to f

S

= 48,000. What is the folding frequency for this sampling frequency f

N

? Adjust the sine wave signal to roughly 14 different frequencies signal frequencies f m

as measured by the scope, between 10 and 100 kHz. For each frequency find the frequency indicated by spectral analysis, f a

. In Table 3 present the dimensional and dimensionless signal and indicated frequencies, f m

, f a

, f m

/f

N

, and f a

/f

N

.

14.

In Fig. 6 , plot f a

/f

N

versus f m

/f

N

. Are the characteristics of this plot similar to those of the folding chart in our textbook? What do you conclude about the number of actual signal frequencies that possibly exist for a given indicated frequency?

Lab 8 Preparation Problem (L8PP)

(a) Construct the LabVIEW VI described in step 9 (which starts with step 2) and turn in a paper copy with your home work. Save an electronic copy and bring it to lab.

(b) Sample data for this lab are in a spreadsheet on its web page. Use this data to construct Tables

1 and 2 and Figures 1, 2 and 3. Turn in a paper copy of these items with your homework.

Please bring an electronic copy of your spreadsheet to lab to help process the data you acquire.

Lab 8 Set-up

Download