| Author |
Message |
Fred Marshall
Guest
|
Posted:
Tue Jan 04, 2005 7:41 am Post subject:
Why is it bad to have spectral samples nonzero at fs/2? |
|
|
I'm working on a paper about interpolation that I threatened to do long ago.
I'm trying to say that a spectrum that has nonzero (or not small) samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
One thing one can say is that it's likely that the spectrum was not properly
bandlimited before sampling and spectral aliasing is likely to have
occurred.
Well, OK, but then the "new" spectrum is what it is. There's no backing
out.
Moving forward from that, why might measurable spectral content around fs/2
be problematic if one is considering subsequent processing?
The one example I have (and would like at least one other example) is that
multiplying a repeated spectrum by a spectral "gate" with edges at -fs/2 and
+fs/2 will cause sharp edges in the resulting spetrum and corresponding
temporal aliasing.
(The idea is that one might say "multiplying by a rectangular window always
causes aliasing" - but this is more a general / theoretical observation.
The more proper statement is that "multiplying by a rectangular window *may*
cause aliasing if the signal being windowed is nonzero at the edges of the
window". It's more likely to be an issue in the time domain. But, in the
frequency domain it may or may not be such an issue.
Any other examples would be appreciated.
Fred |
|
| Back to top |
|
 |
robert bristow-johnson
Guest
|
Posted:
Tue Jan 04, 2005 7:58 am Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
in article crd5i3$hif$1@seagoon.newcastle.edu.au, Heath Raftery at
hraftery@myrealbox.com wrote on 01/03/2005 23:20:
| Quote: | Fred Marshall <fmarshallx@remove_the_x.acm.org> wrote:
I'm working on a paper about interpolation that I threatened to do long ago.
I'm trying to say that a spectrum that has nonzero (or not small) samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
Just a WAG, but wouldn't non-zero samples at fs/2 be without magnitude
information? That is, energy at fs/2 could actually appear as DC, or be
much higher or lower in magnitude that where it is sampled. So the
problem is data at fs/2 gives us no phase or magnitude information.
Perhaps that wasn't what you were looking for though.
|
dunno if it was or not, but the problem with non-zero energy at Nyquist is
that you cannot reconstruct that frequency component unambiguously. there
is an infinite number of combinations of phase and magnitude of the Nyquist
component that would result in the exact same sampled data.
--
r b-j rbj@audioimagination.com
"Imagination is more important than knowledge." |
|
| Back to top |
|
 |
Heath Raftery
Guest
|
Posted:
Tue Jan 04, 2005 7:58 am Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
Fred Marshall <fmarshallx@remove_the_x.acm.org> wrote:
| Quote: | I'm working on a paper about interpolation that I threatened to do long ago.
I'm trying to say that a spectrum that has nonzero (or not small) samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
|
Just a WAG, but wouldn't non-zero samples at fs/2 be without magnitude
information? That is, energy at fs/2 could actually appear as DC, or be
much higher or lower in magnitude that where it is sampled. So the
problem is data at fs/2 gives us no phase or magnitude information.
Perhaps that wasn't what you were looking for though.
Heath
--
*--------------------------------------------------------*
| ^Nothing is foolproof to a sufficiently talented fool^ |
| Heath Raftery, HRSoftWorks _\|/_ |
*______________________________________m_('.')_m_________* |
|
| Back to top |
|
 |
Matt Timmermans
Guest
|
Posted:
Tue Jan 04, 2005 7:58 am Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:0PmdnQzusKr9n0fcRVn-oA@centurytel.net...
| Quote: | Moving forward from that, why might measurable spectral content around
fs/2 be problematic if one is considering subsequent processing?
|
It's only a problem if you need those frequencies to be processed
accurately. When that's so, it's mostly a problem for analog reconstruction
filters, because they have to be a lot sharper. Alternatively, of course,
you could do a digitial interpolation first, but interpolation filters also
suffer, because the requirment for a narrow transition region forces them to
be longer.
It can also be a problem for digital emulations of analog filters, where a
sloped response at fs/2 becomes a notch when to translate it from analog to
digital. Accurately reproducing that notch so that you can process
frequencies near fs/2 will also make your filters longer.
So all in all, the main problem is that if you have content near fs/2, many
of the filters you process it with will need to be longer, and that means
you'll need better hardware. Also, the tendency for long reconstruction or
interpolation filters spread the reconstructed effects of each sample out in
time may be a practical problems in certain applications, even when it is
theoretically irrelevant. Consider: by requiring a system to accurately
reconstruct all frequencies in [0, fs/2-e], you are saying that content at
fs/2-e is *important* to the consumer of the system's output, and that data
at fs/2 is *unimportant*. If e is very small, then this implies that the
consumer is a very accurate frequency discriminator. Real world consumers,
like ears, are not so accurate, so any such requirement usually represents a
disconnect between theory and practice.
--
Matt |
|
| Back to top |
|
 |
Jerry Avins
Guest
|
Posted:
Tue Jan 04, 2005 7:58 am Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
Fred Marshall wrote:
| Quote: | I'm working on a paper about interpolation that I threatened to do long ago.
I'm trying to say that a spectrum that has nonzero (or not small) samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
One thing one can say is that it's likely that the spectrum was not properly
bandlimited before sampling and spectral aliasing is likely to have
occurred.
Well, OK, but then the "new" spectrum is what it is. There's no backing
out.
Moving forward from that, why might measurable spectral content around fs/2
be problematic if one is considering subsequent processing?
The one example I have (and would like at least one other example) is that
multiplying a repeated spectrum by a spectral "gate" with edges at -fs/2 and
+fs/2 will cause sharp edges in the resulting spetrum and corresponding
temporal aliasing.
(The idea is that one might say "multiplying by a rectangular window always
causes aliasing" - but this is more a general / theoretical observation.
The more proper statement is that "multiplying by a rectangular window *may*
cause aliasing if the signal being windowed is nonzero at the edges of the
window". It's more likely to be an issue in the time domain. But, in the
frequency domain it may or may not be such an issue.
Any other examples would be appreciated.
Fred
|
Energy at fs/2 is bad if it bothers you and acceptable if it doesn't.
It's not unusual to use a cheap sloppy anti-alias filter and raise the
sampling frequency to compensate. A simple approach samples often enough
to avoid aliases. A more well thought out samples only often enough to
avoid aliases that matter. Consider a signal that has components as high
as 20 KHz we need to keep. It takes a mammoth filter to sample at 40 KHz
or a little higher, say 44.1. We want to end up at that sample rate for
compatibility, so we'll decimate after the signal is cleaned up
digitally. To make decimation easy, we sample at 88.2 KHz. How good does
the analog filter have to be?
Frequencies above 44.1 will alias. 66.15 will alias to 22.05; barely
acceptable. So we design our cheap analog filter to substantially remove
everything above 65 KHz, well above fs/2. The samples contain the clean
signal we want and a dirty stuff over it, some of which we just don't
want, and some that are aliases that we _really_ don't want. So what? We
filter it all out as we decimate by two, and achieve superior results
with cheap parts. After all, we're engineers, no?
Jerry
--
Engineering is the art of making what you want from things you can get
cheap.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
| Back to top |
|
 |
Rune Allnor
Guest
|
Posted:
Tue Jan 04, 2005 2:25 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
Fred Marshall wrote:
| Quote: | I'm working on a paper about interpolation that I threatened to do
long ago.
I'm trying to say that a spectrum that has nonzero (or not small)
samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
One thing one can say is that it's likely that the spectrum was not
properly
bandlimited before sampling and spectral aliasing is likely to have
occurred.
Well, OK, but then the "new" spectrum is what it is. There's no
backing
out.
Moving forward from that, why might measurable spectral content
around fs/2
be problematic if one is considering subsequent processing?
The one example I have (and would like at least one other example) is
that
multiplying a repeated spectrum by a spectral "gate" with edges at
-fs/2 and
+fs/2 will cause sharp edges in the resulting spetrum and
corresponding
temporal aliasing.
(The idea is that one might say "multiplying by a rectangular window
always
causes aliasing" - but this is more a general / theoretical
observation.
The more proper statement is that "multiplying by a rectangular
window *may*
cause aliasing if the signal being windowed is nonzero at the edges
of the
window". It's more likely to be an issue in the time domain. But,
in the
frequency domain it may or may not be such an issue.
Any other examples would be appreciated.
|
I have two main objections against getting too close to Fs/2. They may
or may not coincide with what you already said.
My first objection is based on a theoretical observation. The
coefficient
exactly at Fs/2 is (when dealing with real-valued signals) necessarily
real-valued. This is due to the spectrum symmetry where X(-f) =
conj(X(f))
and the periodic property of the sampled spectrum:
X(f) + X(-f + Fs) = {Real(X(f))+ Imag(X(f))} +
{Real(X(f))-Imag(X(f))}
= 2 Real(X(f))
so the coeffficient is only partially useful. A more striking example
would be to work out the Fourier coefficients for a sine and a cosine
with frequency exatcly Fs/2.
My second objection follows naturally from there. When we accept that
the coefficient at Fs/2 is "bad" we want some safety margin to avoid
problems. A very practical safety measure would be to design an ADC to
take jitter in the sampling clock into account. You have already
mentioned another problem in that steep flanks in filters and window
functions cause ringing in time domain.
Just my 2c, I'm sure you can expand a little from there.
Rune |
|
| Back to top |
|
 |
Jon Harris
Guest
|
Posted:
Tue Jan 04, 2005 10:17 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:0PmdnQzusKr9n0fcRVn-oA@centurytel.net...
| Quote: | I'm working on a paper about interpolation that I threatened to do long ago.
I'm trying to say that a spectrum that has nonzero (or not small) samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
|
Others have already covered the issues with frequency components at _exactly_
fs/2. Regarding frequencies near fs/2, consider the example of sample-rate
conversion (probably relevant since your topic is interpolation). When moving
to a higher sample rate, the more content you have close to fs/2, the sharper
your interpolation (low pass) filter will have to be. This means more
processing, more memory, longer delays/latency, etc.. If you have some safety
margin, your interpolation filter can be more gradual, hence easier to design.
That's why I like to avoid content near fs/2.
In audio, two commonly used sample rates are 44.1 and 48kHz. At first glance,
it may seem there is very little difference between them. But if you are trying
to accurately reproduce the content up to 20kHz (the commonly-accepted audio
bandwidth), 48kHz gives you almost twice the "safety margin" as 44.1. This
allows digital filters to be significantly shorter, or conversely they can
perform significantly better for the same number of taps. |
|
| Back to top |
|
 |
glen herrmannsfeldt
Guest
|
Posted:
Tue Jan 04, 2005 11:57 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
Jon Harris wrote:
(snip)
| Quote: | In audio, two commonly used sample rates are 44.1 and 48kHz. At first glance,
it may seem there is very little difference between them. But if you are trying
to accurately reproduce the content up to 20kHz (the commonly-accepted audio
bandwidth), 48kHz gives you almost twice the "safety margin" as 44.1. This
allows digital filters to be significantly shorter, or conversely they can
perform significantly better for the same number of taps.
|
It is a convenience of audio signals that, while commonly specified
to 20kHz, there really isn't much up there. (The higher harmonics
of a few notes on the piano, for example. Also, most people older
than a few years old can't hear above 15kHz or so. (Well, maybe
a few kHz more for a few years more.)
If you consider the spectrum as a continuous function, instead of
discrete points, then one has to wonder if it is non-zero close
to fs/2, if it really should be non zero past fs/2.
-- glen |
|
| Back to top |
|
 |
Fred Marshall
Guest
|
Posted:
Wed Jan 05, 2005 9:14 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
"Jerry Avins" <jya@ieee.org> wrote in message
news:33uip3F40taljU1@individual.net...
| Quote: | Fred Marshall wrote:
Energy at fs/2 is bad if it bothers you and acceptable if it doesn't.
|
Jerry,
Right. I was trying to ask: "under what circumstances that you can describe
is it *not* acceptable?" ... in the context of wanting to do subsequent
processing.
Fred |
|
| Back to top |
|
 |
Fred Marshall
Guest
|
Posted:
Wed Jan 05, 2005 9:48 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message
news:BDFF93CA.3929%rbj@audioimagination.com...
| Quote: | in article crd5i3$hif$1@seagoon.newcastle.edu.au, Heath Raftery at
hraftery@myrealbox.com wrote on 01/03/2005 23:20:
Fred Marshall <fmarshallx@remove_the_x.acm.org> wrote:
I'm working on a paper about interpolation that I threatened to do long
ago.
I'm trying to say that a spectrum that has nonzero (or not small)
samples at
or near fs/2 is problematic.
But I'm having a bit of trouble saying why it's bad necessarily.
Just a WAG, but wouldn't non-zero samples at fs/2 be without magnitude
information? That is, energy at fs/2 could actually appear as DC, or be
much higher or lower in magnitude that where it is sampled. So the
problem is data at fs/2 gives us no phase or magnitude information.
Perhaps that wasn't what you were looking for though.
dunno if it was or not, but the problem with non-zero energy at Nyquist is
that you cannot reconstruct that frequency component unambiguously. there
is an infinite number of combinations of phase and magnitude of the
Nyquist
component that would result in the exact same sampled data.
--
r b-j rbj@audioimagination.com
|
Good answer Robert! Not one I'd thought of but one that's clear when you
think about it.
Re Heath's response:
I don't think it has anything to do with DC - that would match with fs.
Fred |
|
| Back to top |
|
 |
Fred Marshall
Guest
|
Posted:
Wed Jan 05, 2005 10:05 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
OK - thanks everyone.
I am tempted to suggest this:
If there is a sampled time sequence,
and we want to do subsequent processing,
might it not be a good idea to lowpass filter the sequence first just to
make sure?
I think a good example might go like this:
I want to do some subsequent processing, like interpolation.
For a variety of reasons I want to make sure that the coefficients around
fs/2 are zero, so I pass the data through a lowpass filter first. Maybe
this would be something like a FIR notch filter at fs/2.
Or, if I'm going to interpolate anyway, I increase the sample rate by a
factor of two and apply a halfband filter before doing anything else.
So, now I turn the question around and ask: "is this *ever* a good idea and
why?"
The one example of why? that I can think of is this:
"After this filtering, you can apply a rectangular lowpass filter in
frequency without temporal aliasing - or at least with temporal aliasing
quite attenuated".
Fred |
|
| Back to top |
|
 |
Jerry Avins
Guest
|
Posted:
Wed Jan 05, 2005 10:22 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
Fred Marshall wrote:
| Quote: | "robert bristow-johnson" <rbj@audioimagination.com> wrote in message
news:BDFF93CA.3929%rbj@audioimagination.com...
|
...
| Quote: | the problem with non-zero energy at Nyquist is
that you cannot reconstruct that frequency component unambiguously. there
is an infinite number of combinations of phase and magnitude of the
Nyquist
component that would result in the exact same sampled data.
|
...
| Quote: | Good answer Robert! Not one I'd thought of but one that's clear when you
think about it.
|
...
The argument that a signal at Fs/2 can't be reconstructed properly
doesn't grab me. Hey: if it's filtered out before sampling, it can't be
reconstructed at all. You know that the reconstruction might be too
small, but it can't be too large. What's the harm?
The real practical problem is elsewhere. How many sample periods would
it take to reconstruct a signal at .499*Fs?
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
| Back to top |
|
 |
robert bristow-johnson
Guest
|
Posted:
Wed Jan 05, 2005 11:11 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
in article 342m1sF4425asU1@individual.net, Jerry Avins at jya@ieee.org wrote
on 01/05/2005 12:22:
| Quote: | Fred Marshall wrote:
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message
news:BDFF93CA.3929%rbj@audioimagination.com...
...
the problem with non-zero energy at Nyquist is that you cannot
reconstruct that frequency component unambiguously. there is an
infinite number of combinations of phase and magnitude of the Nyquist
component that would result in the exact same sampled data.
|
....
| Quote: | The argument that a signal at Fs/2 can't be reconstructed properly
doesn't grab me.
|
all's i am saying is that if you sample:
x(t) = A/cos(theta) * cos(2*pi*(Fs/2)*t + theta)
for -pi/2 < theta < pi/2
at t = n/Fs, you get
x[n] = A * (-1)^n
no matter what theta is as long as -pi/2 < theta < pi/2 .
| Quote: | Hey: if it's filtered out before sampling, it can't be
reconstructed at all.
|
that's the point. if you abhor ambiguity, then lose that component in the
first place
| Quote: | You know that the reconstruction might be too
small, but it can't be too large. What's the harm?
|
there was a thread a while back about what would happen if you tried to
ideally reconstruct a non-zero Nyquist component, specifically what does
+inf
y(t) = sum{ A * (-1)^n * sinc(Fs*t - n) }
n=-inf
where sinc(u) = sin(pi*u)/(pi*u)
add up to?
i don't remember. did it add up to
y(t) = A * cos(pi*Fs*t) ?
or was it nasty?
| Quote: | The real practical problem is elsewhere. How many sample periods would
it take to reconstruct a signal at .499*Fs?
|
to within what tolerance of error? to get it (or any other frequency <
Fs/2) right on the money, you need an infinite number of samples. sinc(u)
goes on for a long way in both directions.
--
r b-j rbj@audioimagination.com
"Imagination is more important than knowledge." |
|
| Back to top |
|
 |
Jerry Avins
Guest
|
Posted:
Wed Jan 05, 2005 11:52 pm Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
robert bristow-johnson wrote:
...
| Quote: | The real practical problem is elsewhere. How many sample periods would
it take to reconstruct a signal at .499*Fs?
to within what tolerance of error? to get it (or any other frequency
Fs/2) right on the money, you need an infinite number of samples. sinc(u)
goes on for a long way in both directions.
|
The closer to Nyquist, the longer it takes to get a meaningful answer.
I've seen it supposed that energy at Nyquist is intolerable, but energy
at .9999 Nyquist is just dandy. Whatever theory leads to that conclusion
is woefully incomplete.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
| Back to top |
|
 |
Andor
Guest
|
Posted:
Thu Jan 06, 2005 12:47 am Post subject:
Re: Why is it bad to have spectral samples nonzero at fs/2? |
|
|
Hi Fred,
I'm not sure if I agree with you that is a useful procedure (even if
you want to interpolate afterwards):
"
I want to do some subsequent processing, like interpolation.
For a variety of reasons I want to make sure that the coefficients
around
fs/2 are zero, so I pass the data through a lowpass filter first. Maybe
this would be something like a FIR notch filter at fs/2.
"
However, if you want an arbitrary tight notch filter with just one
second order IIR, you can simply design an analog lowpass filter with a
cutoff frequency below fs/2 and use the bilinear transform to get the
time discrete version. The warping of the bilinear transform will make
sure that the filter frequency response at fs/2 is 0, and if you have
the cutoff frequency close enough to fs/2, phase should not be an
issue. This way you can achieve an arbitrary small transition bandwidth
with just one single biquad. |
|
| Back to top |
|
 |
|
|
|
|