Measuring the frequency response of electronics

The magnitude and phase response, with respect to frequency, can be measured for external electronics using a simple digital oscilloscope application of the component software. See the digital oscilloscope page for more details of this application.

To measure the frequency response of amplifier #4, a signal generator is hooked directly to channel #1 of the Mac sound input port, and to channel #2 of the input through the electronics. Since the overall gain of the amplifier is about 2500x, the output of the signal generator is first run through a simple voltage attenuator made from a a 1M resistor and a 1K potentiometer. The resistance of the potentiometer is set so that the magnitude of the amplified signal at a specific frequency (10 Hz in this case) is the same as that coming straight from the signal generator. Thus, all magnitude measurements are made with respect to full gain at 10 Hz. Even at that frequency, however, there is still a significant phase shift from the amplifier. Below that frequency, the AC coupling of the Mac sound port begins to attenuate the signal slightly.

To perform the measurement, the signal generator is manually set to frequencies from 2-80 Hz at 5 Hz intervals (2, 5, 10, etc...). At each frequency, 3 measurements are made, which will be averaged together in the binning process. The statistics/trigger component outputs the frequency, the relative magnitude of channel #2 to channel #1, and the relative phase of channel #2 to channel #1, both of which are accumulated in 2d plots. Here is the overall response of amplifier #4:

Each plot consists of a set of 2d points, 3 at each frequency. To convert the 2d plots into 1d plots suitable for construction of a magnitude/phase filter, the 2d points are accumulated and averaged into a set of 80 equal-width bins from 0 to 80 Hz. Here is the result of binning the gain points:

In order to create a continuous 1d curve, the bin component can automatically perform linear interpolation of empty bins between bins which contain points. Here is the overall gain/phase result for this amplifier:

Note that the gain of the amplifier is down about 20 db at 60 Hz, due to the 4th order lowpass filter at 30 Hz. Thus, much (but not all) of the AC line noise present in the signal will be attenuated. Also note that in order to avoid aliasing of the discretized signal, a sampling rate of at least 120 Hz or more is required for this amplifier. The next page will show the construction of a Fourier filter to correct the gain and phase response of this amplifier.

©Copyright Sky Coyote, 2001-2002.