HEM Data Support: Helpful Hints
Navigation

Visualizing Filter Response

The Snap-Master Waveform Analysis module provides a number of filter types and variations for user application. These designs are discussed in the User’s Guide. To assist in the selection and design process, Snap-Master provides two techniques for displaying the frequency characteristic of specific filter designs of interest to the user.

The Filter Preview technique is the simplest to use but has the most limited capability, providing log magnitude vs. frequency only, with preselected y- and x-axis display ranges. The Transfer Function technique is more complex to set up but provides both magnitude and phase angle vs. frequency, and affords the full capabilities of the Snap-Master Display element (e.g., linear and log ranges, cursor/marker, zoom, text, etc.).

Filter Preview

Filter Preview – A simplified graph of magnitude vs. frequency for an FIR or IIR filter design can be observed using the Preview Filter Response provision in the Analysis element function builder dialog window. The filter previews are FFTs of impulse responses as discussed below, but are simplified in procedure and display format for the convenience of the user.

To use the Filter Preview, go to the Analysis Equation Builder window and select Category: Filters. Double click on Function: FIR Filter (or IIR Filter, if desired). The function builder window titled FIR Filter will appear. Select the Filter Response parameters being evaluated and click on the Preview Filter Response box. Enter the sample rate to be used (if different than 1000 samples/second), press Plot, and the filter response will be displayed.

An example dialog window and the resulting response preview for an IIR (Butterworth) filter are shown in Figures 1a and 1b. The display x-axis automatically sets to one-half the sample rate, the maximum frequency which can be used in the instrument without aliasing. Low frequency detail can be observed by reducing the sample rate selected in the dialog window. The y-axis is in dB (20log10 of the magnitude), with prefixed scale.

Transfer Function

Transfer Function – The magnitude and phase vs. frequency of a digital filter can be obtained directly by using the Transfer Function in the FFT element of the Waveform Analysis module. Use of the Transfer Function, though more complex than the Filter Preview, allows display of both magnitude and phase of the filter characteristic. Additionally, the user has full control over display parameters as in any Snap-Master instrument.

If an impulse is used as the input to the filter, the transfer function will be computed at all frequencies in the impulse spectrum. The result, plotted over the frequency range of interest, is the desired characteristic. The procedure is as follows:

Set up an instrument in Snap-Master as shown in Figure 2a.

The unit impulse can be developed in the Analysis element using the format R0 = pulse(A0), where A0 is any time channel available for pacing information, with sample rate set as required for the intended filter application. (In the example of Figure 2a, a sine wave in Wave Generator Channel A0 is used, with 1000 samples/second and a frame length of 1 second.)

The unit impulse (R0) is then filtered using the function to be analyzed (in this case, the IIR filter of Figure 1), using the equation R1 = IIR[20,L,100,B](R0).

The output and input to the filter, R1 and R0, respectively, are then used as Ch 1 – Output and Ch 2 – Input for the Frequency Domain Calculation in the Transfer Function dialog of the FFT Equation Builder. The Window Width should be the same as the number of points used in the impulse function (pacing sample rate times frame length). Other settings are default.

The magnitude and phase vs. frequency curves for the example IIR filter are displayed in Figure 2b through 2e. The Plot Type in the display table must be set for “mag. Vs f” and “phase vs. f”, as appropriate. Figure 2d duplicates the log magnitude format of the Filter Preview display of Figure 1b; Figure 2e illustrates the use of the log frequency x-axis.