If the supply voltage is fixed at 5 Volts, it is easy to extend the bandwidth tenfold by using a monostable, or the following circuit: The flip-flop is reset at the rate of 1KHz, and pulse trains of a lower frequency may not be detected. However, such frequencies are audible when the mark to space ratio is not wildly different from one, and therefore do not require a pulse indicator at all.
Now, this next circuit should have been called a phase detector, but this name is already taken up by half a PLL section; for want of a better name, we 'll call it an edge comparator: It will tell you whether the two positive going edges in pulse trains of the same frequency occur within a few nanoseconds of each other; if they don't, which one comes first.
The pulse signals are tested twice, once after interchanging the A and B inputs. If the Led goes on both times, the positive edges are essentially coincident; if it stays off both times, every positive edge laggs the negative in the other signal, or they are essentially coincident. (If the mark to space ratio is one for both signals, they are essentially in antiphase.) The following table shows what happens when the Led only comes on once. By switching in the inverters, you can test negative edges, as well. You can also test pulse trains of different mark to space ratios, as long as the frequency is the same:
A into Data, B into Clock | B into Data, A into Clock | State |
On | On | ![]() |
On | Off | ![]() |
Off | On | ![]() |
Off | Off | ![]() |
For my own code up to this point: Valid XHTML 1.0!