Close

Cosine, it goes to zero

A project log for Keeping Time with Turing

Decoding WWVB with a Turing Machine

darrin-bDarrin B 06/08/2026 at 01:570 Comments

Seems that I should brush up on my trig. identities. I was so pleased to eliminate one multiply by using a three to one frequency to sample rate ratio that I did not bother to see what four to one could do. Until today. At four to one, a lot of the equation disappears. Two multiplies and one add are gone!

// variable initialization
coeff = 2.0 * cos(2.0 * PI * ((FREQ / SAMPLE_RATE)))

// in the processing loop:
result = prev[0] * prev[0] + prev[1] * prev[1] - (coeff * prev[0] *sprev[1])

The "coeff" variable initializes to zero (more likely, epsilon), so that line goes away. In the loop, the entire subtract part of the line disappears, leaving an easy a^2 + b^2.

With the number crunching so minimized, this is the approach I will use in this project. Containing an independent divide by six section, a 7492 will be useful. Has anyone ever seen one? Me neither. Rather than a chain of 7474s, I'll skip straight to the PLD. The necessary division does not fit in a 16V8, but with the help of a 7474, I have a circuit to test until the 22V10s arrive.

The one-chip wonder circuit has been steadily improving, most recently reaching S9+36 while tuned to WWVB. This iteration also has a wide(-ish) band output stage and Quisk was showing two signals in addition to WWVB. One is at 69.2 KHz and is either east or west of my location. The other signal appears every three seconds just long enough for a beep-beep and then it is gone for three more seconds.

Discussions