# [music-dsp] Near-nyquist signal representation

Dave Gamble signalzerodb at yahoo.co.uk
Tue Jan 28 08:22:00 EST 2003

```Hi,

I've been pondering a little about the fact that any
sub-nyquist sine can be uniquely represented, and
reconstructed (given ideal filters).

Now I'm well aware that it's a fact and not a
question, and I'm happy with the proof.

As time passes, I've become more interested in the
intuitive properties of things, and it struck me that
for a just-shy-of-nyquist sine, the fact that it CAN
be represented perfectly struck me as nonobvious.

Anyway, this is a rambly email to talk about my
conclusions, and provide a little insight into how
exciting life can be for the list newbies :)

So, my starting point was a sinewave around an axis.
_     _     _
_/_\___/_\___/_\_
\_/   \_/
[hopefully you all read you email in pine and have
monospaced fonts!]

I started out by plotting points along the axis to
simulate sampling it just a fraction faster than the
rate of the wave [i.e. the wave is just a touch slower
than the nyquist]

I like the fact that at the nyquist, /where/ you
sample relative to the period of the wave determines
the result you get (i.e. if you sample once every
intersection, it appears not to be there). So,
inspired by this, my first sample was at the
leftermost intersection.

Let's assume the scale is from 10 to -10... here is my
sampled signal:

0
-1
3
-6
10
-6
3
-1
0
1
-3
6
-10
6
-3
1
(and then it repeats) [16samples all in]
[these are not actual answers; they're guesses, ok!]
Hmm... not very sinusoidal, huh?
It looks like this:

_     /\     _      _/\    /\_
--/ \_  /  \  _/ \--\_/   \  /   \_/--
\/    \/             \/

[i REALLY hope you've got monospaced fonts!]

Anyway, that was enough to convince me that the
near-nyquist sampled signal had a unique amplitude
(i.e. that you couldn't mistakenly guess it had a
different amplitude)
It looks like it might be possible to construct from
sinewaves at other frequencies... It has a real
low-frequency tendency (i.e. it has bumps). But look
at the numbers... they alternate in sign; you'd need a
high frequency signal to do that; and guess what.
That's our sine :)

Another point is to multiply every second sample by
-1; then you get a really low frequency sinewave.
(well, in this example it's not -very- low
frequency...)
That should make you feel better about representation
and phase and level (well, it did for me.)
It's a fact that when you multiply a sinewave by a
sinewave at the nyquist (if it's at the nyquist then
it goes 1,-1,1,-1,1,-1,1,-1,... so by multiplying by
this wave, you get every second sample negated) the
resulting sinewave is at nyquist-original_rate

So, our new sinewave has a period of 16 samples
(because it's the same as before... check:
0,-1,3,-6,10,-6,3,-1,0,1,-3,6,-10,6,-3,1
becomes
0,1,3,6,10,6,3,1,0,-1,-3,-6,-10,-6,-3,-1
sinewave with period 16samples!)
Let's assume that the nyquist is 8Hz.
(i.e. in 1 second, we take 16 samples, meaning we get
a {1,-1} 8 times)
Then our new sinewave has frequency 1Hz. (because we
get one period every second)
So, 8-original=1Hz
So, original sinewave was at 7Hz! :)

Doesn't a 7/16ths-of-sample-rate sinewave look wierd!
:)

Still, this viewpoint convinced me! :)

However, let's get a little faster and look at a
sinewave at the nyquist..
It's gonna look like this:
\/\/\/\/\/\/\/\/\/\/\/\/\/\
If our A/D convertor samples at the right time, we get
{1,-1,1,-1,1,-1,...}
If it doesn't, we get:
{0,0,0,0,0,0,0,0,0,...}

This looks pretty mystical.

However; we know that if we're /below/ the nyquist, we
can represent it... we just get really REALLY slow
sinewaves with every second sample negated.
The only problem is when we're bang on the nyquist.

The solution to this wierdness (i.e. how can we
represent the nyquist component; since Shannon's
sampling theorem says we can, but we can see here the
problem) comes from a little information theoretic
analysis.

Now, information is like energy. It's always
preserved, unless you explicitly throw some away.

Suppose we take a fourier transform of our sampled
data; this will tell us about the frequency
components.

We know this: we have 16 samples (16 is a good number
for the sake of argument). However, we can only
represent signals up to 8Hz (nyquist). When we fourier
transform, for each frequency we get phase AND
amplitude information (that's two things)

So, we take 16 samples, divide by two, and get 8.
That means the fourier transform can split into 8
frequency bands, each with frequency and phase
information.

But wait... the lowest term of a fourier transform is
ALWAYS the DC component... (i.e. the amount of 0Hz)
and so the frequencies are:
0Hz,1Hz,2,3,4,5,6,7Hz...
No nyquist!!

But 0Hz is constant: It has no phase...
If the DC offset is 5, it doesn't matter where in time
you start sampling it.
The phase information for DC is meaningless, but the
amplitude is not.

This means that we have one piece of information
spare!

And what IS this information... It's half the
information we'd need to represent the nyquist (since
you need amplitude AND phase)! :)

So, we can represent anything BELOW nyquist, but we
can only HALF represent the nyquist! :)

Cool huh!

Thanks for listening! :)

Dave.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

```