DSPRelated.com
Forums

Why is it bad to have spectral samples nonzero at fs/2?

Started by Fred Marshall January 3, 2005
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 


Fred Marshall 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. > > 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. �����������������������������������������������������������������������
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message 
news:0PmdnQzusKr9n0fcRVn-oA@centurytel.net...
> 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
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. Heath -- *--------------------------------------------------------* | ^Nothing is foolproof to a sufficiently talented fool^ | | Heath Raftery, HRSoftWorks _\|/_ | *______________________________________m_('.')_m_________*
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 "Imagination is more important than knowledge."
Fred Marshall 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. > > 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
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:0PmdnQzusKr9n0fcRVn-oA@centurytel.net...
> 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.

Jon Harris wrote:

(snip)

> 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
"Jerry Avins" <jya@ieee.org> wrote in message 
news:33uip3F40taljU1@individual.net...
> 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
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:BDFF93CA.3929%rbj@audioimagination.com...
> 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