Sampling frequency and square waves

Click For Summary
To accurately capture a 10Hz square wave without aliasing, the Nyquist rate should be at least 20Hz, but using higher sampling rates may improve the waveform's shape. When summing harmonics, the maximum frequency used for sampling should be based on the highest harmonic present in the signal, not just the fundamental frequency. A square wave consists of an infinite number of odd harmonics, and capturing its characteristics typically requires at least the fundamental and the third harmonic. The rise time of the square wave is also crucial for accurate reconstruction, and sampling at least twice the highest harmonic frequency is necessary. Understanding the specific requirements of the signal will determine the appropriate sampling strategy.
Deathfish
Messages
80
Reaction score
0

Homework Statement



Lets say I have a square wave of 10Hz. I want a good sampling frequency or the Nyquist rate (minimum) to accurately capture its characteristics without aliasing. Is it enough to use 10Hz x 2 as nyquist rate, or must I break it down into harmonic frequencies? and use maximum harmonic frequency as the sampling rate?

What if I do not use the square wave function, but instead sum together harmonic frequencies? Do i still use Fmax as 10 Hz, or use the highest harmonic frequency as Fmax?

Homework Equations



sin 2πft + 1/3 sin 2π3ft + 1/5 sin 2π5ft +1/7 sin 2π7ft ...

am asking that if i use eg. 4 harmonics, must I use Fmax = 70Hz ?
or if i sum together 20 harmonics and use Fmax = 10Hz can i still preserve the signal.
(not necessarily using 2 x Fmax - nicer shape plot may use 10 x Fmax.)

The Attempt at a Solution



something to do with too few sampling points not being able to reproduce shape of square waves and instead getting it wrong. But not sure whether this affects the frequency information extracted during plotting. not sure how summing together harmonics affects result.
 
Physics news on Phys.org
I'm afraid I don't think that your question is well specified. The answer depends very much on what information you have and what information you need to know.

For example, if you already know you've got a 10Hz square wave, the only question remaining is when the discontinuities occur (i.e. the phase, if that's a well defined term for a square wave). Off the top of my head, I can think of two ways to do that.

If you know you've got a 10Hz wave, but don't know the form then you need a different strategy.

If you don't know the frequency but do know that it's a square wave then you need a different strategy; if you have an idea of the frequency (<100Hz, for example), there's a different strategy again.

If you can specify your question more precisely, the answer might come to you and/or we might be able to help more.
 
In theory a square wave is made up of an infinite number of odd harmonics. So the issue is determining how many you need to meet your definition of "accurately capture its characteristics".

http://en.wikipedia.org/wiki/Square_wave

For a reasonable approximation to the square-wave shape, at least the fundamental and third harmonic need to be present, with the fifth harmonic being desirable

You can probably find (or plot using a spreadsheet) a picture of what a square wave looks like when built from only "n" harmonic sine waves.

If the rise time of the square wave is known and important it should be possible to calculate how the accurately the rise time of a reconstruction built from n harmonics matches. At least over say 10-90% of the amplitude. You could probably also calculate the magnitude of any under/overshoot. Been 35 years since I did anything like that.

You will need to sample at at least twice the required highest harmonic.

Sampling theory is a subject in it's own right.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K