This VI demonstrates how to use National Instruments high-speed digitizers to measure the frequency response
of a device using the step response method described below. The VI is set up to acquire the rising edge
of a step response, take the derivative to obtain the impulse response, and then take the FFT of the impulse response
to obtain the frequency response of the device.
Background information: Impulse response is a quick way to measure the frequency response of a device.
Because an impulse in the time domain is equivalent to all frequencies of a sine wave
in the frequency domain, we can use an impulse as an input to derive the frequency
response. In this case, you measure the effect of sine waves at all frequencies
at one time. To use the impulse response method, you input an impulse into the device
and measure the output. Then you take the output measurement and apply a
Fast Fourier Transform (FFT). The result is the frequency response of the device.
Because creating an impulse is difficult in the real word, finding the impulse response of
a device is very difficult. However, using the step response method you can derive
the impulse response. The basis of the step response method is that the derivative
of a step function is an impulse; the vertical portion of the step function has an infinite
derivative. To use the step response method, input a step pattern with a fast rising edge
(a slow square wave, 1 kHz will do) into the device. Next, measure the output waveform
and take the derivative. The result is the impulse response of the device. Now you can
apply the FFT to the impulse response and obtain the frequency response.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.