# Gibbs Phenomenon

Started by June 26, 2008
Hi,
explaining about what is gibbs phenomenon but none of them epxlained the
reason behind the phenomenon.
Can anyone please explain the reason for the gibbs phenomenon or send me

On Jun 26, 7:52 pm, "vasindagi"  wrote:
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.
> Can anyone please explain the reason for the gibbs phenomenon or send me

For a periodic waveform it can be made of of sine-waves of various
harmonic frequencies.
If you miss out the higher frequencies you end up with a "bad-fit" -

K.

On 26 Jun, 09:52, "vasindagi"  wrote:
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.

The Fourier transform is defined for *piecewise* continuous
functions, which are continuous everywhere except in some
discrete points where there are jumps. One example is
a rectangular pulse, where the leading and trailing flanks
are jump discontinuities.

The FT, on the other hand, represents the function in terms
of functions that are continuous. The Gibbs phenomenon is
a consequence from trying to represent discontinuous
functions in terms of continuous ones.

Rune

On Thu, 26 Jun 2008 02:52:20 -0500, "vasindagi"
wrote:

>Hi,
>explaining about what is gibbs phenomenon but none of them epxlained the
>reason behind the phenomenon.

Gibbs phenomenon happens when one tries to represent a signal with
discontinuities with Fourier series. If the number of components used
in the expansion is finite, it can't represent the discontinuity as a
finite sum continuous functions is by definition continuous so there
will always be an error.

vasindagi schrieb:
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.
> Can anyone please explain the reason for the gibbs phenomenon or send me

Depends on "how deep" you want to dig to understand the reason. I would
say, the reason for this phenomenon is the "uncertainty relation of
signal processing", meaning that you cannot represent a signal that is
sharp both in the frequency (Fourier) space and in the spatial
(regular/time) domain. Specifically, spikes or edges (depending on
whether that's audio or visual information) representing localized
objects or phenomena relate to "unlocalized" data in the Fourier domain
(e.g. the spectrum of a sharp spike covers more or less all
frequencies), and also vice versa.

That is, as soon as you represent data in the Fourier domain, and then
introduce some kind of loss in this domain by, for example, dropping
small coefficients or band-limiting the signal, you end up with
"sharpness loss" and the typical Gibbs artifacts near edges; to describe
them precisely, an infinite Fourier spectrum is required.

Mathematically, one can show that the Fourier series (or the Fourier
integral) converges for continuous functions, and converges to the
average of the two values at the discontinuity, but the closer you get
to the discontinuity, the slower the rate of convergence will become.
Specifically, one can also see that for every finite number of terms in
the Fourier series approximating a square wave, there is always a point
near the edge where the series differs by a constant term from the
source signal - mathematically, the convergence is only in l^2 sense
(mean square error) and not in the pointwise (l^infinity) sense. This
difference is exactly the Gibbs phenomenon.

So long,
Thomas


On Jun 26, 3:52 am, "vasindagi"  wrote:
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.
> Can anyone please explain the reason for the gibbs phenomenon or send me

They explanation about the limitation of not using higher frequencies
isn't really correct - even though it displays the same type of
behaviour. Even if you used an infinite number of frequencies the
result does not converge at  that point i.e. the discontinuity.

So what you're seeing is the limitation of sum of sinusoids
representation - it does not form a complete basis. It is like trying
to represent 3D space with only 2 vectors. A linear combination of 2
vectors can only map out a plane and so you can only get so close to
representing any point in 3D space.

Hope that helps.

Cheers,
Dave

"vasindagi"  wrote in message
news:E--dnXOJr4Yp1_7VnZ2dnUVZ_orinZ2d@giganews.com...
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.
> Can anyone please explain the reason for the gibbs phenomenon or send me

http://en.wikipedia.org/wiki/Gibbs_phenomenon

This makes it pretty clear along with the explanations given by others.

My 2 cents:  You are trying to represent a waveform of infinite frequency
content - and the series doesn't converge as was pointed out.

You may want to ask: "How do I get rid of it?"  The answer is to *not* try
to represent discontinuities that are as sharp as a pure theorectical square
wave would be.  In the real world they don't exist anyway - although you can
certainly generate a waveform that has noticeable Gibbs phenomenon which is
a bandlimited signal.  Use a lowpass filter of some reasonable bandwidth to
smooth out those edges and the ringing goes away.

Fred


On 26 Jun., 14:43, Dave  wrote:
> On Jun 26, 3:52 am, "vasindagi"  wrote:
>
> > Hi,
> > explaining about what is gibbs phenomenon but none of them epxlained the
> > reason behind the phenomenon.
> > Can anyone please explain the reason for the gibbs phenomenon or send me
>
> They explanation about the limitation of not using higher frequencies
> isn't really correct - even though it displays the same type of
> behaviour. Even if you used an infinite number of frequencies the
> result does not converge at �that point i.e. the discontinuity.
>
> So what you're seeing is the limitation of sum of sinusoids
> representation - it does not form a complete basis.

You are right in that those do not form a complete basis. However,
finite sums of sinusoids approximation to periodic functions don't
necessarily display Gibbs ringing at points of discontinuity.

Truncating the Fourier series of a periodic function after the first N
terms is the best N-bandlimited approximation in the L2 sense (and
results in Gibb's). However, using windowing one can reduce or do away
with Gibbs ringing altogether for N term sum of sinusoids
approximation - one of the points in windowed FIR design is to reduce
Gibbs ringing in the approximation of ideal frequency responses. The
resulting windowed N term approximation won't be optimal in the L2
sense, but you can suppress the Gibbs ringing.

Regards,
Andor

vasindagi wrote:
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.
> Can anyone please explain the reason for the gibbs phenomenon or send me

Do you want an explanation apart from the mathematics, which you say you
understand? How about "Nature abhors abrupt discontinuities"?

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������

On Jun 26, 3:52�am, "vasindagi"  wrote:
> Hi,
> explaining about what is gibbs phenomenon but none of them epxlained the
> reason behind the phenomenon.
> Can anyone please explain the reason for the gibbs phenomenon or send me

Depending on how deep you wish to get into this, you may want to look
1848 long before Gibbs. In short the Gibb's phenominom arises from
trying to approximate a discontinuous function with a uniformly
continuous one. And sinusoids on an interval are uniformly continuous
and a sum of uniformly continuous functions is also uniformly
continuous. Hence a finite sum of sinusoids is uniformly continuous.
Also a uniformly continuous function has a bounded derivative. Thus
the problem with trying to approximate a discontinuous function.

Clay

"Dave"  wrote in message
> On Jun 28, 4:41 pm, Thomas Richter  wrote:
>
>> I afraid you don't understand - they *do* form a (Schauder-) basis of
>> L^2, provably. But this only implies convergence in L^2 (mean-square
>> error) sense, and not in pointwise sense. If you say "basis", you also
>> need to define "norm". Actually, elements in L^2 are *not* functions,
>> but equivalence classes of them where, specifically, function values
>> *at* a point do not make sense, so to say that it "does not converge
>> pointwise" makes little sense in an L^2 space.
>>
>> All this sounds like mathematical nit-picking, but it is important to
>> use a proper definition of words specifically in the
>> infinite-dimensional cases or you get lost easily.
>
> I will admit that this area is not my forte, so I am a bit out of my
> depth - so take what I say with a grain of salt. I agree with
> everything you've said., but  I specifically didn't mention a norm.
> All I meant to do was point out that it doesn't converge at the one
> particular point i.e. the discontinuity.
>
> I'm sure there must exist some  norm for which the fourier transform
> doesn't form a basis. Perhaps the infinity norm? Perhaps you can tell
> me?
>
> Cheers,
> Dave

It's the "basis set" that "forms the basis".  I don't know if the norm
determines.  To me it's always been about whether you can construct and
uniquely solve a set of equations on a set of points using that basis.  The
objective of the equations / the norm / may not be important.  But I'd not
want to comment on L3, L4, etc.

For example, you can use the Fourier cos/sin basis along with the infinity
norm - that's what the Remez exchange algorithm does or can do as in the
Parks-McClellan implementation... well, at least the cos basis.

So, the Fourier Transform yields an L2 approximation and the Remez exchange
and L(inf) approximation, etc.

Fred


On Jun 28, 4:41 pm, Thomas Richter  wrote:

> I afraid you don't understand - they *do* form a (Schauder-) basis of
> L^2, provably. But this only implies convergence in L^2 (mean-square
> error) sense, and not in pointwise sense. If you say "basis", you also
> need to define "norm". Actually, elements in L^2 are *not* functions,
> but equivalence classes of them where, specifically, function values
> *at* a point do not make sense, so to say that it "does not converge
> pointwise" makes little sense in an L^2 space.
>
> All this sounds like mathematical nit-picking, but it is important to
> use a proper definition of words specifically in the
> infinite-dimensional cases or you get lost easily.

I will admit that this area is not my forte, so I am a bit out of my
depth - so take what I say with a grain of salt. I agree with
everything you've said., but  I specifically didn't mention a norm.
All I meant to do was point out that it doesn't converge at the one
particular point i.e. the discontinuity.

I'm sure there must exist some  norm for which the fourier transform
doesn't form a basis. Perhaps the infinity norm? Perhaps you can tell
me?

Cheers,
Dave


Dave wrote:

>> Whether there are complete basis of function spaces is a matter of
>> believe (namely if you thrust the axiom of choice). For all practical
>> matters, Schauder bases like the free oscillations (cos/sin or exp(ix))
>> are good enough. IOW, you can approximate any function as close as you
>> wish with sinoids in the l^2 sense. They do not form a Schauder basis in
>> l^\infty sense of the piecewise continuous functions, that's true, but a
>> different statement.
>
> The fourier  series doesn't converge at  a the point  of the
> discontinuity and there is always a finite error, and it cannot be
> made infinitely small - atleast from what I remember.

Look, "convergence" requires a norm, otherwise this word makes no sense.
And yes, indeed, the cos/sin series *do* converge to any (non-continuous
or continuous) function *in L^2 sense*. I never claimed that they do
converge in a *pointwise* sense, which is something entirely different.

> I agree with you in mostcases the representation is sufficient.

This is not a matter of "what happens in most cases", it is really a
matter of picking the mathematically suitable function space. (-:

>>> It is like trying
>>> to represent 3D space with only 2 vectors.
>> No, not at all. In 3D space, you will always have a positive error for
>> arbitrary vectors. Here, you can make the error infinitely small.
>
>
> Since the sin/cos bases doesn't form a basis for discontinuous
> functions my analogy still stands. To represent the discontinuous
> functions you start getting into the theory of distributions.

I afraid you don't understand - they *do* form a (Schauder-) basis of
L^2, provably. But this only implies convergence in L^2 (mean-square
error) sense, and not in pointwise sense. If you say "basis", you also
need to define "norm". Actually, elements in L^2 are *not* functions,
but equivalence classes of them where, specifically, function values
*at* a point do not make sense, so to say that it "does not converge
pointwise" makes little sense in an L^2 space.

All this sounds like mathematical nit-picking, but it is important to
use a proper definition of words specifically in the
infinite-dimensional cases or you get lost easily.

So long,
Thomas

>Hi,
>explaining about what is gibbs phenomenon but none of them epxlained the
>reason behind the phenomenon.
>Can anyone please explain the reason for the gibbs phenomenon or send me
>

Here's some reading on the Gibbs effect.
Steve

http://www.dspguide.com/ch11/4.htm

detailed enough.


On Jun 27, 2:49 am, Thomas Richter  wrote:
> Dave schrieb:
>
> > On Jun 26, 3:52 am, "vasindagi"  wrote:
> >> Hi,
> >> explaining about what is gibbs phenomenon but none of them epxlained the
> >> reason behind the phenomenon.
> >> Can anyone please explain the reason for the gibbs phenomenon or send me
>
> > They explanation about the limitation of not using higher frequencies
> > isn't really correct - even though it displays the same type of
> > behaviour. Even if you used an infinite number of frequencies the
> > result does not converge at  that point i.e. the discontinuity.
>
> It doesn't converge *pointwise* at the discontinuity, but it does
> converge in l^2 sense, and it also converges pointwise at every epsilon
>
> > 0 around the discontinuity.
> > So what you're seeing is the limitation of sum of sinusoids
> > representation - it does not form a complete basis.
>
> Whether there are complete basis of function spaces is a matter of
> believe (namely if you thrust the axiom of choice). For all practical
> matters, Schauder bases like the free oscillations (cos/sin or exp(ix))
> are good enough. IOW, you can approximate any function as close as you
> wish with sinoids in the l^2 sense. They do not form a Schauder basis in
> l^\infty sense of the piecewise continuous functions, that's true, but a
> different statement.

The fourier  series doesn't converge at  a the point  of the
discontinuity and there is always a finite error, and it cannot be
made infinitely small - atleast from what I remember.

I agree with you in mostcases the representation is sufficient.

> > It is like trying
> > to represent 3D space with only 2 vectors.
>
> No, not at all. In 3D space, you will always have a positive error for
> arbitrary vectors. Here, you can make the error infinitely small.

Since the sin/cos bases doesn't form a basis for discontinuous
functions my analogy still stands. To represent the discontinuous
functions you start getting into the theory of distributions.

Cheers,
David

Nils schrieb:
> vasindagi schrieb:
>> Hi,
>> explaining about what is gibbs phenomenon but none of them epxlained the
>> reason behind the phenomenon.
>
> You've got lots of reactions about Gibbs phenomeon over the last two days.
>
> I'd like to give a different perspective from the graphical point of
> view. At last: The Gibbs phenomeon is often percieved used when it comes
> to images, rarely if ever if you talk about sound.
>
>
> The sole reason why it is important in graphics is the fact that our
> eyes and brain is trained to detect edges. Whatever your mind makes up
> for you is one thing. What really drives your vision are the edges of
> what you see.
>
> Mathematical spoken: The brain/eyes does a high-pass filer on what you
> see and the vision pays attention on those things that have the highest
> derivation from the mean. What you see however is often an illusion made

Well, not really, Nils. The Gibbs phenomenon is real in the sense that
you can measure it. The visibility is actually not *at* the edge, where
visual masking will appear - I can show images where this type of
masking makes the phenomenon invisible, which is one of the reasons why
JPEG works so well.

However, the problem with Gibbs appears as soon as the oscillations
caused by it are well away from the edge, in an otherwise flat terrain
where no structure can mask them, and *then* they become very visible.

> The gibbs pheonomen is simply ringing in the passband. However, it
> creates something like a halo around the objects, and that effect
> triggers the edge-detection part of your brain. It does pay much more
> attention to it than it ought to.

That's a different part of the story - a matter of the contrast
sensitivity function - (or a passband filter, if you want to say so),
which visually amplifies specific frequencies. Gibbs becomes visible,
too, whenever its "implied" frequencies are low enough to fit into this
passband.

> A similar effect yet kinda different is the marching band effect that
> you'll percieve if you quantize an image from lets say 8 bit to 4 bit.
> You'll get ridges/steps in smooth gradients and you eye will - no matter
> what you do - focus on them.

Yup, that's quantization noise, a different structure and a different
origin. Here, artificial edges are created, and they are again very
visible because there is no structure around them that could mask the
edges away.

> Both things are well explained from a perceptive point of view. The
> gibbs pheonomeon in images is one of those cases where a lower per pixel
> error has a higher percieved error than it ought to.

Not really - it depends on *where* the phenomenon occurs. Typically, it
is masked by the edge itself, unless you see the oscillations too far
away from the edge. That's at least my experience (I've looked at too
many images, probably... :-)

So long,
Thomas

On 27 Jun., 04:33, Ron N  wrote:
> On Jun 26, 7:02�pm, "Fred Marshall"

> wrote:
>
>
>
>
>
> > "Ron N"  wrote in message
>
> > On Jun 26, 7:00 am, Andor  wrote:
>
> > Typical windowing only helps remove the ringing near
> > discontinuous boundary conditions at the sides of the window.
> > You will still get ringing from discontinuities in the middle
> > of the window.
>
> > It might be possible to reduce or eliminate the Gibb's
> > phenomena by approaching the limit of the sinusoidal series
> > in a different manner. �Instead of just adding terms, one can
> > replace the discontinuity with a short continuous function
> > segment (trapezoidal edge, or other higher order polynomial),
> > and approach the limit by simultaneously both increasing the
> > number of terms and decreasing the span of the replaced
> > segment being approximated by those terms in proportion to
> > the number of terms, thus decreasing the L2 error of both
> > approximations together.
>
> > Ron,
>
> > I have never seen a "discontinuous window" unless you want to include the
> > gate function as a window as we always do. �But that's a limiting
case of
> > really "no window".
>
> I was talking about the "temporal" gating of
> non-periodic-in-aperture-width signals, and
> discontinuities in the middle of the waveform,
> before applying an additional "window function".
>
> There needs to be a more widespread and commonly
> used glossary of the terminology.

Ron

I explicitely said that I was using the term "windowing" as in
"windowed FIR design". The discontinuous periodic function is the
frequency response, and we window the Fourier series exapansion of the
frequency response (the impulse response) to smooth the frequency
response.

This is equivalent to convolving the periodic function with a
smoothing kernel, so the ringing is removed everywhere, not only at
the "sides" (whatever that means).

Regards,
Andor

Dave schrieb:
> On Jun 26, 3:52 am, "vasindagi"  wrote:
>> Hi,
>> explaining about what is gibbs phenomenon but none of them epxlained the
>> reason behind the phenomenon.
>> Can anyone please explain the reason for the gibbs phenomenon or send me
>
>
> They explanation about the limitation of not using higher frequencies
> isn't really correct - even though it displays the same type of
> behaviour. Even if you used an infinite number of frequencies the
> result does not converge at  that point i.e. the discontinuity.

It doesn't converge *pointwise* at the discontinuity, but it does
converge in l^2 sense, and it also converges pointwise at every epsilon
> 0 around the discontinuity.

> So what you're seeing is the limitation of sum of sinusoids
> representation - it does not form a complete basis.

Whether there are complete basis of function spaces is a matter of
believe (namely if you thrust the axiom of choice). For all practical
matters, Schauder bases like the free oscillations (cos/sin or exp(ix))
are good enough. IOW, you can approximate any function as close as you
wish with sinoids in the l^2 sense. They do not form a Schauder basis in
l^\infty sense of the piecewise continuous functions, that's true, but a
different statement.

> It is like trying
> to represent 3D space with only 2 vectors.

No, not at all. In 3D space, you will always have a positive error for
arbitrary vectors. Here, you can make the error infinitely small.

So long,
Thomas

On Jun 26, 7:02�pm, "Fred Marshall"
wrote:
> "Ron N"  wrote in message
>
> On Jun 26, 7:00 am, Andor  wrote:
>
> Typical windowing only helps remove the ringing near
> discontinuous boundary conditions at the sides of the window.
> You will still get ringing from discontinuities in the middle
> of the window.
>
> It might be possible to reduce or eliminate the Gibb's
> phenomena by approaching the limit of the sinusoidal series
> in a different manner. �Instead of just adding terms, one can
> replace the discontinuity with a short continuous function
> segment (trapezoidal edge, or other higher order polynomial),
> and approach the limit by simultaneously both increasing the
> number of terms and decreasing the span of the replaced
> segment being approximated by those terms in proportion to
> the number of terms, thus decreasing the L2 error of both
> approximations together.
>
> Ron,
>
> I have never seen a "discontinuous window" unless you want to include the
> gate function as a window as we always do. �But that's a limiting case
of
> really "no window".

I was talking about the "temporal" gating of
non-periodic-in-aperture-width signals, and
discontinuities in the middle of the waveform,
before applying an additional "window function".

There needs to be a more widespread and commonly
used glossary of the terminology.

rhn


"Ron N"  wrote in message
On Jun 26, 7:00 am, Andor  wrote:

Typical windowing only helps remove the ringing near
discontinuous boundary conditions at the sides of the window.
You will still get ringing from discontinuities in the middle
of the window.

It might be possible to reduce or eliminate the Gibb's
phenomena by approaching the limit of the sinusoidal series
replace the discontinuity with a short continuous function
segment (trapezoidal edge, or other higher order polynomial),
and approach the limit by simultaneously both increasing the
number of terms and decreasing the span of the replaced
segment being approximated by those terms in proportion to
the number of terms, thus decreasing the L2 error of both
approximations together.

Ron,

I have never seen a "discontinuous window" unless you want to include the
gate function as a window as we always do.  But that's a limiting case of
really "no window".  I've certainly not seen one with discontinuities in the
middle.

Some supergained theoretical windows have spikes at the edges but they
aren't very practical anyway.  Others of this sort have sinusoidal
properties.  But these are *way* out there......

Most practial windows go to zero at the edges and maybe have a discontinuous
first derivative.  Many have their first derivative zero as well.

Typical windowing is a type of lowpass filter (in frequency) and does reduce
the ringing at temporal discontinuities.

Fred