4
\$\begingroup\$

Since a square pulse has very high harmonics how to obtain a good resolution of pulses? For example if we have pulse train around 500 Hz could we treat it as a typical analog signal and sample it with 1500 Hz? But if we do it I suspect that we will not have clear rising edges since it square pulse has very high component. Of course we cannot sample with infinity but I!m wondering if there is a standard sampling rate for sampling square pulses to obtain a clear pulse shape for each pulse?

\$\endgroup\$
4
\$\begingroup\$

Assumption: The pulse timing and frequency are desired as input, not the actual waveform.

If the pulse train is known to be essentially just pulses, i.e. with nearly vertical rising and falling edges, then an analog waveform acquisition mechanism is sub-optimal.

Greater precision would be obtained by using a comparator or a Schmitt trigger, sending its output to a GPIO, and using interrupts on the GPIO to capture the rising and falling transitions against a high precision timer.

To avoid false triggering in case the pulse stream edges are noisy, use a comparator with a fair bit of hysteresis. That way, brief noise pulses on the rising and falling edges will not falsely trigger the GPIO interrupts.

\$\endgroup\$
  • \$\begingroup\$ could it be done with a DAQ board? \$\endgroup\$ – user16307 Oct 18 '13 at 8:20
  • \$\begingroup\$ That would depend on the DAQ board: Some DAQ units support both digital inputs with edge timer capture, and analog inputs. If yours does, then use the digital input port(s). If not, a basic microcontroller will do an excellent job for capturing a modest precision of say 0.1 millisecond, which would be more than ample for an approximately 500 Hertz pulse stream signal. \$\endgroup\$ – Anindo Ghosh Oct 18 '13 at 8:24
0
\$\begingroup\$

It all depends on what you are going to use the sampled square wave for. The pictures below should give you an idea what you would get should you sample and then convert back to an analogue signal via a DAC: -

enter image description here

The above picture is rather idealistic in that it has an exact number of samples per period of the square wave - should you sample on the edge of the input squarewave it'll look worse, probably more like this: -

enter image description here

The faster you sample the better it will look but we can't decide for you.

\$\endgroup\$
0
\$\begingroup\$

The sample rate for a binary signal depends very much on what you know up front about the signal (from its definition), and what features of the signal you need to measure and preserve.

At the very least, the sample period needs to be strictly less than both the minimum high time and the minimum low time of the signal; otherwise you might miss a high pulse or a low pulse altogether.

But it's usually the timing of the edges that's the key feature of any pulse train. You need to decide for your application which timing measurements are crucial and what resolution you need on those measurements. That's what will ultimately determine the sample rate required.

\$\endgroup\$
  • \$\begingroup\$ how is that implemented timing of the edges? should one use a digital input instead of analog input for counting and sampling pulses? thnx \$\endgroup\$ – user16307 Oct 18 '13 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.