1
$\begingroup$

Using the figure below as an example, I wonder if it is possible that the small oscillations in the signal at the time of each step shift could be caused solely by the application of a low-pass filter to a pure square wave?

Signal image

$\endgroup$
5
$\begingroup$

These ringing artifacts are due to the Gibbs phenomenon. They are indeed caused by lowpass filtering a function with discontinuities. What you see is basically the oscillations of the step response of the lowpass filter. The oscillations can be reduced (or completely eliminated) by choosing a lowpass filter with less or no ringing in its step response. E.g. a Gaussian filter has no ringing at all. However, lowpass filters with well-behaved step responses perform worse in the frequency domain in terms of passband deviation, transition band roll-off, and stopband attenuation.

$\endgroup$
  • $\begingroup$ Matt - Not sure this is 100% correct. Please look at my answer - one of us must be slightly wrong. $\endgroup$ – Izhaki Jul 3 '13 at 21:11
  • 1
    $\begingroup$ @Izhaki: so where do you think we disagree? $\endgroup$ – Matt L. Jul 3 '13 at 21:50
  • $\begingroup$ In the statement " The oscillations can be reduced (or completely eliminated) by...". My claim is that the oscillations will happen regardless of the filter used. $\endgroup$ – Izhaki Jul 3 '13 at 22:04
  • 2
    $\begingroup$ Izhaki is claiming that the Gibbs phenomenon is fundamental to low pass filtering. Matt L is correctly pointing out that the Gibbs phenomenon is caused by ripples in the impulse response of the filter. Gaussian filters do not have ripples in their impulse response: dsp.stackexchange.com/questions/3002/…. $\endgroup$ – Wandering Logic Jul 3 '13 at 22:08
  • 1
    $\begingroup$ @WanderingLogic: Also dsp.stackexchange.com/q/9745/29 $\endgroup$ – endolith Jul 6 '13 at 6:14
0
$\begingroup$

I think it is worth pointing out that any lowpass filter will reshape a pure square wave to something like in your illustration, regardless of the filter being used.

Reason is that a pure square wave requires an infinite amount of harmonics (a square wave is made of a fundamental frequency and odd harmonics at a level of 1/h). The moment a lowpass filter is applied - you no longer have infinite amount of harmonics, thus these ripples start popping out.

In the following illustration, only 5 sine harmonics are shown, but the sum (resembling square wave) is that of 60. You can see the ripples there as well. The way to get rid of them is to carry on adding harmonics ad infinitum. If you do so and then apply a lowpass just above the 60th harmonic - you'll get something similar to the square in this illustration:

enter image description here

$\endgroup$
  • $\begingroup$ This is an interesting, if incomplete, argument. You are only considering the amplitude of the low passfilter. Many lowpass filters also have non-trivial phase and thus not only the amplitude but also the relative positions of the harmonics are changed. More often than not, this will reduce Gibbs phenomon. Your picture is also wrong since it doesn't show the alternating sign of the harmonics. If you add them all up with the same phase you get no square wave at all. $\endgroup$ – Hilmar Jul 4 '13 at 8:13
  • $\begingroup$ The graph was generated by presenting each of (1/h)*sin(hx), and the sum of which - how can it be wrong? Also, while I might be overlooking something big time, I didn't know that the harmonics of a squarewave alternate - seems by the illustration that they aren't. $\endgroup$ – Izhaki Jul 4 '13 at 9:05
  • $\begingroup$ Odd harmonics only, I should add. $\endgroup$ – Izhaki Jul 4 '13 at 9:37
  • $\begingroup$ Sorry, my bad. You only need to alternate signs if you use a cosine expansion that's symmetric around t = 0. For a sine expansion you just add the sines directly and get x(-t) = -x(t). $\endgroup$ – Hilmar Jul 4 '13 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.