# Nyquist rate

Started by January 23, 2016
```Hello All,

if I know that the signal I am going to sample (coming from Analog domain)
is a triangular wave which repeats itself every 1 second (1 Hz signal)
then I am a bit confused if I have to sample this signal at slightly more
than 2*1 Hz (to satisfy Nyquist rate) or something else?

Looking at some worked out examples which show FFT transform of a
triangular signal, it seems that 2*1. The triangular wave seems to consist
of multiple frequencies.

So, question is how do I know at what rate I should sample without
analyzing the triangular waveform first and I cannot analyze if I don't
sample?

This also lead me to think if I have understood sampling theorem
correctly. That is, one has to sample > twice the highest frequency in
order to retain proper information of constituent frequencies. If I had a
sine waveform at 1 Hz as input then I would simply sample this at > 2 Hz
and I would meet Nyquist rate. The same does not seem to hold good for
other wave shapes like triangle.

The other question is, whether it is always possible to know a-priori the
max. frequency component in the input signal so as to sample at the right
rate?

---------------------------------------
Posted through http://www.DSPRelated.com
```
```On 23.1.16 11:25, Sharan123 wrote:
> Hello All,
>
> if I know that the signal I am going to sample (coming from Analog domain)
> is a triangular wave which repeats itself every 1 second (1 Hz signal)
> then I am a bit confused if I have to sample this signal at slightly more
> than 2*1 Hz (to satisfy Nyquist rate) or something else?
>
> Looking at some worked out examples which show FFT transform of a
> triangular signal, it seems that 2*1. The triangular wave seems to consist
> of multiple frequencies.
>
> So, question is how do I know at what rate I should sample without
> analyzing the triangular waveform first and I cannot analyze if I don't
> sample?
>
> This also lead me to think if I have understood sampling theorem
> correctly. That is, one has to sample > twice the highest frequency in
> order to retain proper information of constituent frequencies. If I had a
> sine waveform at 1 Hz as input then I would simply sample this at > 2 Hz
> and I would meet Nyquist rate. The same does not seem to hold good for
> other wave shapes like triangle.
>
> The other question is, whether it is always possible to know a-priori the
> max. frequency component in the input signal so as to sample at the right
> rate?

The sampling rate minimum depends on the pre-sampling analog
low pass filtering. You need a rate more than twice of the
filter's stopband boundary frequency.

--

-TV

```
```On 1/23/2016 3:25 AM, Sharan123 wrote:
> Hello All,
>
> if I know that the signal I am going to sample (coming from Analog domain)
> is a triangular wave which repeats itself every 1 second (1 Hz signal)
> then I am a bit confused if I have to sample this signal at slightly more
> than 2*1 Hz (to satisfy Nyquist rate) or something else?
>
> Looking at some worked out examples which show FFT transform of a
> triangular signal, it seems that 2*1. The triangular wave seems to consist
> of multiple frequencies.

Take a look at the figures at the bottom of these pages (I did
http://fourier.eng.hmc.edu/e59/lectures/e59/node11.html
http://fourier.eng.hmc.edu/e59/lectures/e59/node17.html

I've seen references in this group to a site that uses JavaScript
sum sine waves with adjustable amplitude and phase. I can't
recall the appropriate key words to find it. After 50 yrs I still
remember seeing a similar presentation using a bank of
oscillators and an oscilloscope (I was the technician who had to
maintain it.)

HTH
```
```On 1/23/2016 4:06 AM, Tauno Voipio wrote:
> On 23.1.16 11:25, Sharan123 wrote:
>> Hello All,
>>
>> if I know that the signal I am going to sample (coming from
>> Analog domain)
>> is a triangular wave which repeats itself every 1 second (1 Hz
>> signal)
>> then I am a bit confused if I have to sample this signal at
>> slightly more
>> than 2*1 Hz (to satisfy Nyquist rate) or something else?
>>
>> Looking at some worked out examples which show FFT transform of a
>> triangular signal, it seems that 2*1. The triangular wave seems
>> to consist
>> of multiple frequencies.
>>
>> So, question is how do I know at what rate I should sample without
>> analyzing the triangular waveform first and I cannot analyze if
>> I don't
>> sample?
>>
>> This also lead me to think if I have understood sampling theorem
>> correctly. That is, one has to sample > twice the highest
>> frequency in
>> order to retain proper information of constituent frequencies.
>> sine waveform at 1 Hz as input then I would simply sample this
>> at > 2 Hz
>> and I would meet Nyquist rate. The same does not seem to hold
>> good for
>> other wave shapes like triangle.
>>
>> The other question is, whether it is always possible to know
>> a-priori the
>> max. frequency component in the input signal so as to sample at
>> the right
>> rate?
>
>
> The sampling rate minimum depends on the pre-sampling analog
> low pass filtering. You need a rate more than twice of the
> filter's stopband boundary frequency.
>

I don't think that addresses his quandary.
Consider the infinite Fourier *series* of his waveform.
Pass that summation through a "brick wall" filter.
Observe the quality of reproducing the original as the cutoff
frequency is varied for integer multiple of the fundamental.

```
```Yes an exact triangle wave has infinite bandwidth and you cannot
Sample it.  You need to low pass filter
Your triangle wave which will cause
Some amount of distortion.  You have to
M
```
```Thanks, everyone, for putting things in perspective ...

---------------------------------------
Posted through http://www.DSPRelated.com
```
```On 1/23/2016 4:25 AM, Sharan123 wrote:
> Hello All,
>
> if I know that the signal I am going to sample (coming from Analog domain)
> is a triangular wave which repeats itself every 1 second (1 Hz signal)
> then I am a bit confused if I have to sample this signal at slightly more
> than 2*1 Hz (to satisfy Nyquist rate) or something else?
>
> Looking at some worked out examples which show FFT transform of a
> triangular signal, it seems that 2*1. The triangular wave seems to consist
> of multiple frequencies.
>
> So, question is how do I know at what rate I should sample without
> analyzing the triangular waveform first and I cannot analyze if I don't
> sample?

Knowing and doing are two different things.  The sampling theorem has to
do with the mathematical relationships of sampling and say nothing about
any specific real world signal.  How you apply the theorem is up to you.

> This also lead me to think if I have understood sampling theorem
> correctly. That is, one has to sample > twice the highest frequency in
> order to retain proper information of constituent frequencies. If I had a
> sine waveform at 1 Hz as input then I would simply sample this at > 2 Hz
> and I would meet Nyquist rate. The same does not seem to hold good for
> other wave shapes like triangle.

Sine waves are just one frequency.  Any other waveform can be decomposed
into multiple frequency sine waves.

> The other question is, whether it is always possible to know a-priori the
> max. frequency component in the input signal so as to sample at the right
> rate?

There are the things we know we know, the things we know we don't know
and the things we don't know we don't know.  Any given signal fits into
one of these three categories.

--

Rick
```
```>Sine waves are just one frequency.  Any other waveform can be decomposed

>into multiple frequency sine waves.

Dear Rick,

I am not trying to argue but sine wave being just one frequency is only in
the context of fourier transform?

Because even a square wave has specific frequency in the sense that there
are given repetitions within a given time period.

---------------------------------------
Posted through http://www.DSPRelated.com
```
```On Sat, 23 Jan 2016 12:06:36 +0200, Tauno Voipio wrote:

> On 23.1.16 11:25, Sharan123 wrote:
>> Hello All,
>>
>> if I know that the signal I am going to sample (coming from Analog
>> domain)
>> is a triangular wave which repeats itself every 1 second (1 Hz signal)
>> then I am a bit confused if I have to sample this signal at slightly
>> more than 2*1 Hz (to satisfy Nyquist rate) or something else?
>>
>> Looking at some worked out examples which show FFT transform of a
>> triangular signal, it seems that 2*1. The triangular wave seems to
>> consist of multiple frequencies.
>>
>> So, question is how do I know at what rate I should sample without
>> analyzing the triangular waveform first and I cannot analyze if I don't
>> sample?
>>
>> This also lead me to think if I have understood sampling theorem
>> correctly. That is, one has to sample > twice the highest frequency in
>> order to retain proper information of constituent frequencies. If I had
>> a sine waveform at 1 Hz as input then I would simply sample this at > 2
>> Hz and I would meet Nyquist rate. The same does not seem to hold good
>> for other wave shapes like triangle.
>>
>> The other question is, whether it is always possible to know a-priori
>> the max. frequency component in the input signal so as to sample at the
>> right rate?
>
>
> The sampling rate minimum depends on the pre-sampling analog low pass
> filtering. You need a rate more than twice of the filter's stopband
> boundary frequency.

But the pre-sampling low-pass filtering depends on the frequency content
of the incoming signal.

--
www.wescottdesign.com
```
```>
>There are the things we know we know, the things we know we don't know
>and the things we don't know we don't know.  Any given signal fits into
>one of these three categories.

>Rick

I really like these statements but one case is missing (seriously):

To sum up There are
1)things we know we know
2)things we know we don't know
3)things we don't know we don't know
4)things we don't know we know

Kaz

---------------------------------------
Posted through http://www.DSPRelated.com
```