DSPRelated.com
Forums

Nyquist rate

Started by Sharan123 January 23, 2016
On Sat, 23 Jan 2016 03:25:59 -0600, 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?
If you know it's exactly a triangle wave and you know it's at exactly one hertz, and if you don't care about the phase, then, all you need to do is measure the amplitude with a good peak-reading or RMS voltmeter. If you DO care about phase then use a good phase-locked loop to find the zero-crossings and a sample-and-hold amplifier to capture the peak amplitude. A middle road says that if you know it's a repetitive signal and you know roughly what it's frequency is, you can sample it at a _much lower_ frequency than "Nyquist" and accurately reconstruct the original signal -- but only to the degree that it's perfectly repetitive.
> 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.
Yes, any signal that is not a pure sine wave contains components at multiple frequencies. Even a pure sine wave that starts at some point in time and goes on forever does. A repetitive signal contains components at all integer multiples of the signal's frequency -- in the case of your triangle wave that's 0, 1, 2, etc. (and, depending on how you hold your mouth, possibly -1, -2, etc.).
> 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?
Well, you don't. If someone gives you a black box with connector on it and tells you to measure _everything_ about the signal on the connector then you either know that (1) the effort is futile because you'll never get there, or (2) you've just found your career (assuming that they'll pay you by the hour). So you have to measure what's _important_ about the signal, and what's important is a matter of opinion and circumstance.
> 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.
Well, here again... If you know it's a sine wave at 1Hz and you don't care about phase, you can just measure the amplitude. Or you can capture phase and amplitude, or you can sample at much lower than 1Hz.
> 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?
Not without having some idea of what the signal is, and even then reality can surprise you. This should help you understand the issues. It doesn't really answer any of your questions directly, but I think you'll find it useful none the less: http://wescottdesign.com/articles/Sampling/sampling.pdf -- www.wescottdesign.com
>On Sat, 23 Jan 2016 03:25:59 -0600, Sharan123 wrote: > >If you know it's exactly a triangle wave and you know it's at exactly one
>hertz, and if you don't care about the phase, then, all you need to do is
>measure the amplitude with a good peak-reading or RMS voltmeter. > >www.wescottdesign.com
in fact if so and you know all that about analogue signal then assuming no importance for peak measurement, you might just generate a triangular signal in digital domain at given frequency clean, easy and cheap. Kaz --------------------------------------- Posted through http://www.DSPRelated.com
On Sat, 23 Jan 2016 15:36:47 -0600, kaz wrote:

>>On Sat, 23 Jan 2016 03:25:59 -0600, Sharan123 wrote: >> >>If you know it's exactly a triangle wave and you know it's at exactly >>one > >>hertz, and if you don't care about the phase, then, all you need to do >>is > >>measure the amplitude with a good peak-reading or RMS voltmeter. >> >>www.wescottdesign.com > > in fact if so and you know all that about analogue signal then assuming > no importance for peak measurement, you might just generate a triangular > signal in digital domain at given frequency clean, easy and cheap.
True. And if your goal is to measure all the important quantities you could go a step farther and just write "triangle wave" in your notes. -- www.wescottdesign.com
On 1/23/2016 3:21 PM, kaz wrote:
>> >> 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
*DISASTER* lurks for #3 we'' not mention ... ;/
On 1/23/2016 4:11 PM, Tim Wescott wrote:
> 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.
The filtering depends on the desired frequency content. -- Rick
On 1/23/2016 2:24 PM, Sharan123 wrote:
>> 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.
What is your point? -- Rick
On 1/23/2016 4:21 PM, kaz wrote:
>> >> 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
About the last one, I guess I knew that, but I didn't know I knew it. -- 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. > >What is your point?
Dear Rick, My question is, if I just sample at twice the frequency of triangle wave, we would end up losing information. The fact is that one can easily misconstrue Nyquist rate as I mentioned above and think he/she is good. A lot of textbooks too don't use such corner case waveforms to explain Nyquist theory. Anyway, just my 2 cents ... --------------------------------------- Posted through http://www.DSPRelated.com
> >My question is, if I just sample at twice the frequency of triangle
wave,
>we would end up losing information. The fact is that one can easily >misconstrue Nyquist rate as I mentioned above and think he/she is good.
A
>lot of textbooks too don't use such corner case waveforms to explain >Nyquist theory. >
you should understand that frequency in the context of sampling and in general means that of sinusoids (not just any repeating waveforms). Do Fourier on any signal and will tell you what frequencies it contains. Kaz --------------------------------------- Posted through http://www.DSPRelated.com
On 1/23/2016 11:08 PM, Sharan123 wrote:
>>>> 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. >> >> What is your point? > > Dear Rick, > > My question is, if I just sample at twice the frequency of triangle wave, > we would end up losing information. The fact is that one can easily > misconstrue Nyquist rate as I mentioned above and think he/she is good. A > lot of textbooks too don't use such corner case waveforms to explain > Nyquist theory. > > Anyway, just my 2 cents ...
I don't follow your reasoning. Nyquist doesn't talk about triangle waves, it talks about signals and frequency content. If you don't understand the frequency content of a triangle wave, you won't be able to use Nyquest theory with triangle waves. I have no understanding of what you were saying about square waves, but they also have infinite frequency content. -- Rick