Subtracting a phase-shifted frequency from the original signal is not likely to have the desired effect. In fact, if the absolute phase shift is greater than 60°, subtracting the phase-shifted frequency component from the original signal will actually result in amplifying that frequency component, rather than attenuating it. So one could conceivably create a low-pass filter which had the side-effect of phase shifting low frequencies, and then attempt to modify it into a high-pass filter by subtracting the low-pass output from the input, and actually end up with a filter that amplified low frequencies rather than cutting them out! This can be seen in Figure 8, where the difference between the input and output signals actually has a greater magnitude than the original input signal.

Now, despite the existence of phase shift, it is still possible to use this technique. There is just one condition that is required for it to work perfectly: The original filter must either introduce no phase shift, or must introduce a constant delay that does not vary between the different frequency components of this signal (a property known as “linear phase”), and the input signal must be delayed by the same amount before subtracting the original filter’s output.

IIR filters like our 1P-LP filter can reasonably be assumed to introduce non-linear phase shifts, meaning that the delays that these filters introduce are not constant, but rather they vary with frequency. Fortunately, however, the result of breaking this condition is not necessarily catastrophic, rather it merely means that the resulting filter will not have a frequency magnitude response that is a perfect inversion of the original filter. In this case, it does actually still yield a high pass filter, just not one whose filtering is the exact opposite of the low pass filter from which it was derived. Specifically, the the sum of the response magnitudes of the mid-range frequencies of the low-pass filter and those of the high-pass filter would be a little greater than one, but the lowest and highest frequencies still behave as desired, due to the fact that the lowest frequency, being constant rather than periodic, cannot be phase shifted, and the highest frequency, having a period of only two samples, could only possibly be phase shifted by zero or 180°, and in the case of the 1P-LP filter, the phase shift at the highest frequency happens to be zero. (This can be seen in Figure 3.)

The filter that is formed by this operation is called a one (or single) pole, one (or single) zero high-pass filter, or 1P1Z-HP for short. (Again, the reason for this name is beyond the scope of this article.) Merely subtracting the 1P-LP filter output from the input signal does however give a somewhat naive implementation of this filter, due to the inadequate high frequency attenuation of the 1P-LP filter (as seen in Figures 3, 4 and 7) being passed on to this new filter, which results in the high frequencies being partially attenuated, rather than maintaining the same magnitude, as one would expect from a high-pass filter. Luckily, this inadequacy can be compensated for by amplifying the output of the high-pass filter to ensure no gain or attenuation at the highest frequency. The high frequency attenuation of the 1P-LP filter was given in Equation 2.2, and if this attenuated magnitude is subtracted from the input, then the resulting attenuation in the high-pass filter will be one minus the high frequency attenuation of the low-pass filter. We can compensate for this by dividing the high-pass output by this attenuation factor, as long as we do not use the resulting output as a feedback input into the high-pass filter. (If the naive high-pass filter were implemented by feeding its own output back into itself, rather than using the output of the 1P-LP filter, then that implementation would expect to receive the naive output through feedback, rather than the amplified output. Supplying the amplified output instead would cause subsequent outputs to be incorrectly calculated.) That gives the following equation for an improved high-pass filter.