We can consider a digital filter as a black box that inputs discrete samples and outputs filtered discrete samples.
As shown in the following figure, difference equations are often used to represent the action of a filter. In such equations, it is common to use x[n] to describe our discrete input samples and y[n] to describe our discrete, filtered output samples.
Most common digital filters are linear and shift invariant in that they compute new output samples as a function of some combination of current input, past input, and past output samples. When a filter output relies on a history of past input samples, you can expect transient effects seen at the output of a filter when the signal is first applied. This example illustrates these initial effects, known as transients, when the signal is first applied to the filter.
Demonstrating Filter Transients
1. Create an input sine wave signal by selecting ‘Sine’ from the ‘Input Signal Type’ menu. Make the sine wave have a frequency of 10Hz by setting the sampling rate to 500 samples/second, setting the total number of samples to generate to 750 samples, and setting the number of cycles to generate to 15 cycles. Note that the 500 samples/second sampling rate is divided by the 750 samples and multiplied by the 15 cycles to give the 10 cycles/second or 10Hz shown by the ‘Input Signal Frequency’ indicator.
2. Create a low pass filter by setting the ‘Filter Type’ to ‘Lowpass’, the ‘Filter Structure’ to ‘Butterworth’, and the ‘Filter Order’ to 50. Set the ‘Low Cut-Off Frequency’ to 10.75 or a value just higher than the input signal frequency.
3. Show the transient of the input signal as it passes through a low pass filter. Set the ‘Output Signal Display’ to show ‘transient.’ Since the low cut-off frequency is higher than the input signal frequency, in theory, the signal should pass through unaffected. The output waveform graph shows the filter algorithm used in this example and in most real world applications requires some time to settle.
3. Set the ‘Filter Structure’ to one of the other filter algorithms like ‘Chebyshev’ or ‘Elliptic’ and notice how the different algorithms have different transient affects. Also, change the ‘Filter Order’ to see how the filter order affects transient performance.
4. Repeat the demonstration with different filter types by setting the ‘Filter Type’ menu. Observe how each filter structure performs when both the low cut-off and high cut-off frequencies matter according to the filter type.