# Basic Sampling Theory Question

Started by August 17, 2015
```Hi,

If I have a sine wave with period T. The sampling theory says I can
recover it by sampling at T/2. That is two points, barely enough to draw a
straight line.

What am I missing here?

---------------------------------------
Posted through http://www.DSPRelated.com
```
```old_ee <107864@DSPRelated> wrote:

>If I have a sine wave with period T. The sampling theory says I can
>recover it by sampling at T/2. That is two points, barely enough to draw a
>straight line.

>What am I missing here?

I think the sampling theorem says that the (uniform) sampling interval
must be strictly less than T/2 to capture the nformation in the
sine wave with period T; T/2 itself does not work.

Steve
```
```On 17/08/2015 11:29, old_ee wrote:
> Hi,
>
>     If I have a sine wave with period T. The sampling theory says I can
> recover it by sampling at T/2. That is two points, barely enough to draw a
> straight line.
>
>     What am I missing here?
>

Reconstruction does not use straight lines. Setting aside all the maths
involved, reconstruction (as in principle done by all DACs) in effect
(re)generates the required curves between the sample points. With those
two sample points right on the limit, in theory the DAC (and its
reconstruction filter) converts them into a nice sinusoid. In practice,
the reconstruction filter may be a little more 'powerful' than that, as
it has to be, right on the Nyquist limit, so that you will probably end
up not getting a signal at all.

The soundfile editor Adobe Audition (nee Cool Edit Pro) draws the
"proper" quasi-analogue curve between sample points, when zoomed in
sufficiently closely. It is good enough to be useful for demonstrating
how each single digital sample gets reconstructed ("in theory...") as a
appropriately scaled and shifted "windowed sinc" waveform.

Richard Dobson

```
```On Mon, 17 Aug 2015 05:29:31 -0500, "old_ee" <107864@DSPRelated>
wrote:

>Hi,
>
>   If I have a sine wave with period T. The sampling theory says I can
>recover it by sampling at T/2. That is two points, barely enough to draw a
>straight line.
>
>   What am I missing here?

The reconstruction with the assumption that the signal is bandlimited
makes all the difference.   Once the bandlimiting is performed during
the reconstruction process the straight lines go away.

Eric Jacobsen
Anchor Hill Communications
http://www.anchorhill.com
```
```On Mon, 17 Aug 2015 05:29:31 -0500, old_ee wrote:

> Hi,
>
>    If I have a sine wave with period T. The sampling theory says I can
> recover it by sampling at T/2. That is two points, barely enough to draw
> a straight line.
>
>    What am I missing here?

Two things:  First, if you have a sine wave with period T then you can
recover it by sampling at a period that is strictly T_s < T/2.  Second,
in your reconstruction you must assume that the sampled signal was
strictly bandlimited.

There are two difficulties with this:

First, in the original expressions of the sampling theory that I have
seen by Nyquist and Shannon, they played a bit fast and loose with the
strictness of T_s < T/2 -- I suspect that this is because they were
experienced engineers who were quite familiar with the point that's
coming up.

Second, in practice, you just can't sample at T_s = T/2 - t_e, where t_e
is arbitrarily small.  If you try, you find that the amount of time you
need to observe your signal tends to infinity as t_e tends to zero,
because observing your signal for a shorter period is tantamount to
chopping off your signal, which creates sidebands.

Generally, unless you have some really compelling reason to get close to
it (like if you're designing CD formats), you want to sample 2x or more
of the "Nyquist rate" -- in fact, in closed-loop control systems where
delay matters, 10x of the intended loop closing frequency is a common
rule of thumb, and for high-precision control there are advantages to be
had in pushing up to 100x the intended loop closing frequency.

http://wescottdesign.com/articles/Sampling/sampling.pdf

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
```
```old_ee wrote:
> Hi,
>
>     If I have a sine wave with period T. The sampling theory says I can
> recover it by sampling at T/2. That is two points, barely enough to draw a
> straight line.
>
>     What am I missing here?
>
>
> ---------------------------------------
> Posted through http://www.DSPRelated.com
>

Sampling theory.

--
Les Cargill
```
```On Tuesday, August 18, 2015 at 5:26:05 AM UTC+12, Tim Wescott wrote:
> On Mon, 17 Aug 2015 05:29:31 -0500, old_ee wrote:
>
> > Hi,
> >
> >    If I have a sine wave with period T. The sampling theory says I can
> > recover it by sampling at T/2. That is two points, barely enough to draw
> > a straight line.
> >
> >    What am I missing here?
>
> Two things:  First, if you have a sine wave with period T then you can
> recover it by sampling at a period that is strictly T_s < T/2.  Second,
> in your reconstruction you must assume that the sampled signal was
> strictly bandlimited.
>
> There are two difficulties with this:
>
> First, in the original expressions of the sampling theory that I have
> seen by Nyquist and Shannon, they played a bit fast and loose with the
> strictness of T_s < T/2 -- I suspect that this is because they were
> experienced engineers who were quite familiar with the point that's
> coming up.
>
> Second, in practice, you just can't sample at T_s = T/2 - t_e, where t_e
> is arbitrarily small.  If you try, you find that the amount of time you
> need to observe your signal tends to infinity as t_e tends to zero,
> because observing your signal for a shorter period is tantamount to
> chopping off your signal, which creates sidebands.
>
> Generally, unless you have some really compelling reason to get close to
> it (like if you're designing CD formats), you want to sample 2x or more
> of the "Nyquist rate" -- in fact, in closed-loop control systems where
> delay matters, 10x of the intended loop closing frequency is a common
> rule of thumb, and for high-precision control there are advantages to be
> had in pushing up to 100x the intended loop closing frequency.
>
> http://wescottdesign.com/articles/Sampling/sampling.pdf
>
> --
>
> Tim Wescott
> Wescott Design Services
> http://www.wescottdesign.com

Just a small correction, sampling theory was not due to Nyquist and Shannon but Whittaker and a Russian gentleman. Shannon just put it in an engineering framework.
```
```gyansorova@gmail.com wrote:
> On Tuesday, August 18, 2015 at 5:26:05 AM UTC+12, Tim Wescott wrote:
(snip)
>> Generally, unless you have some really compelling reason to get close to
>> it (like if you're designing CD formats), you want to sample 2x or more
>> of the "Nyquist rate" -- in fact, in closed-loop control systems where
>> delay matters, 10x of the intended loop closing frequency is a common
>> rule of thumb, and for high-precision control there are advantages to be
>> had in pushing up to 100x the intended loop closing frequency.

(snip)

> Just a small correction, sampling theory was not due to Nyquist
> and Shannon but Whittaker and a Russian gentleman. Shannon just
> put it in an engineering framework.

And Nyquist had what seems to be a completely different problem.

He wanted to know how fast he could send telegraph pulses through
a cable, and still see them at the other end.  Turns out to be
the dual problem for sampling theory.

-- glen
```
```On Tue, 18 Aug 2015 19:01:05 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:

>gyansorova@gmail.com wrote:
>> On Tuesday, August 18, 2015 at 5:26:05 AM UTC+12, Tim Wescott wrote:
>(snip)
>>> Generally, unless you have some really compelling reason to get close to
>>> it (like if you're designing CD formats), you want to sample 2x or more
>>> of the "Nyquist rate" -- in fact, in closed-loop control systems where
>>> delay matters, 10x of the intended loop closing frequency is a common
>>> rule of thumb, and for high-precision control there are advantages to be
>>> had in pushing up to 100x the intended loop closing frequency.
>
>(snip)
>
>> Just a small correction, sampling theory was not due to Nyquist
>> and Shannon but Whittaker and a Russian gentleman. Shannon just
>> put it in an engineering framework.
>
>And Nyquist had what seems to be a completely different problem.
>
>He wanted to know how fast he could send telegraph pulses through
>a cable, and still see them at the other end.  Turns out to be
>the dual problem for sampling theory.
>
>-- glen

That's why the pulse-shaping filters in a communication system are
called Nyquist filters.

Eric Jacobsen
Anchor Hill Communications
http://www.anchorhill.com
```
```Eric Jacobsen <eric.jacobsen@ieee.org> wrote:

>On Tue, 18 Aug 2015 19:01:05 +0000 (UTC), glen herrmannsfeldt

>>And Nyquist had what seems to be a completely different problem.

>>He wanted to know how fast he could send telegraph pulses through
>>a cable, and still see them at the other end.  Turns out to be
>>the dual problem for sampling theory.

>That's why the pulse-shaping filters in a communication system are
>called Nyquist filters.

Okay, so that's what a Nyquist filter is.

I had always figured it meant a filter that bandlimits a
signal such that it falls within the Nyquist limiq.

Steve
```