# LabVIEW

cancel
Showing results for
Did you mean:

## sampling rate and no. of samples per channel

hi

I wanted to know if there is any relationship b/w 'sample rate' and 'no. of samples per channel'. sample rate is set in DAQmx base timing(sample clock).vi and no. of samples per channel in DAQmxbase Read (Analog 2D DBL Nchan Nsamp).vi. My job is to acquire data from two acclerometers, calculate phase lag, max frequency, amplitude ratio & inturn find the velocity of wave travelling in the media (ex: concrete). I'm able to complete the FFT part and get the peak frequency. Could someone help me in calculating the other parameters! And the other thing, in the FFT display(waveform graph on Front panel) I had to use a multiplier constant equal to that of 'sample rate' for the x-axis. Is this correct?

Attached is the vi used to acquire the data

regards
Ajit
Message 1 of 6
(3,290 Views)

## Re: sampling rate and no. of samples per channel

I think you're on the right track:

1. Calculate Phase Lag: Use the Tone Measurements Express VI. Calculate the Phase of one signal, then of the other, subtract and find the lag.
2. Measure Frequency: You can use the information from the FFT like you are using now or you could use the Tone Measurements Express VI and it will calculate the frequency for you. You could also find the frequency by using the Timing and Transition Measurements Express VI.
3. Amplitude Ratio: This can be found by simply dividing the amplitude of one measurement over the other. A simple Divide function work for you.
4. Find the Velocity: To find the velocity (distance/time) you should already know the distance between the sensors, then you could find the time it takes the signal to propagate by inverting the Frequency and multiply that by the Phase Lag (1/(1/s)*degrees = s).
I think these ideas should get you started.

One thing to keep in mind though, is with measurements where you are trying to find phase differences, you would be better using a simultaneous sampling board (Such as NI's S-Series Boards). A typical DAQ device (such as your USB device) multiplexes the signals onto an Analog-to-Digital chip. That means that each measurement is going to slightly out of phase with the next. If your system is large or the vibrations propagate slowly, this shouldn't matter; however, if you have a more quickly moving signal you may want to consider getting a different DAQ device for the most accurate measurements.
Message 2 of 6
(3,251 Views)

## Re: sampling rate and no. of samples per channel

As for the channels being out of phase due to the mux, this channel to channel error can be measured and then used as a calibration constant. If an identical signal is simultaneously applied to all the channels of interest the phase difference between channels should represent the channel delay due to the sampling method. It should remain constant as long as the sampling rate doesn't change.

Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5

LabVIEW Champion

Message 3 of 6
(3,242 Views)

## Re: sampling rate and no. of samples per channel

hi

thanks for the suggestions. I was wondering if I could integrate the time domain signal obtained from the first accelerometer(first integral-velocity & second integral-displacement). The idea of calculating the phase lag was also to calculate the velocity...so why not do this way! Any idea on how to integrate the time domain signal? can this be done just after data acquisition i.e., just after data capture it should calculate the velocity and display it.
Message 4 of 6
(3,229 Views)

## Re: sampling rate and no. of samples per channel

hi

thanks for the suggestions. I was wondering if I could integrate the time domain signal obtained from the first accelerometer(first integral-velocity & second integral-displacement). The idea of calculating the phase lag was also to calculate the velocity...so why not do this way! Any idea on how to integrate the time domain signal? can this be done just after data acquisition i.e., just after data capture it should calculate the velocity and display it.

Regards
Ajit
Message 5 of 6
(3,230 Views)

## Re: sampling rate and no. of samples per channel

Hi Ajit,

There are many ways for you to calculate the integral of a time domain signal in LabVIEW, but the easiest way to get started would be by using the Time Domain Math Express VI from the Arith/Compare palette. When setting up the Express VI settings for this VI, choose "Integral" to return the integral of the time signal.