# Determining Size and Sample Frequency for Analyzing Analog Signals

Updated Apr 25, 2018

## Reported In

### Software

• LabVIEW Base
• LabVIEW Professional
• LabVIEW Full

• NI-DAQmx

## Issue Details

I have an analog signal that I would like to analyze, and I might want to perform frequency measurements on this signal, such as a Fourier Transform or a Fast Fourier Transform (FFT). How do I choose the sampling rate or frequency of the analog signal? How long should I sample for?

## Solution

The sampling rate of the signal will change based on the desired measurement being the frequency or the shape of the signal. To accurately measure the frequency of a signal, we need a sampling rate of at least twice the highest frequency in the signal. This concept is known as Nyquist's theorem. To get the shape of the signal, you will need a sampling rate of at least ten times higher than the highest frequency in the signal.
• The equation for frequency measurement is found below:
• where:
fmax is the maximum resolvable frequency
fNyquist is the Nyquist frequency
fs is the sampling frequency
To measure the shape of the signal, fwill need to be divided by 10 instead of 2.

To get a full picture of the signal, sample for at least one full period of the waveform. The number of samples that corresponds to can be shown through frequency resolution:

The  frequency resolution (df) is dictated by the acquisition time:
where:
T is the period of the signal
N is the number of samples acquired
fs is the sampling frequency

For example, a signal with frequency 50 Hz, there will need to be at least 0.02(1/50) seconds of data for a full period of the signal. At a sampling rate of 100 Hz for a frequency measurement, N will be 5000.