Jim Kelley said:
You seem to be laboring under the impression that, like you, this subject
matter is new to me. It is difficult to resolve the changes in period
when the frequencies are close. Could even lead one to believe that it
doesn't change and post claims accordingly on a newsgroup.
jk
It is difficult to resolve changes that don't exist. Your generalization on
changing frequency/period isn't correct.
Here is a perl script to look at
#!/usr/bin/perl
use strict;
###############################################################################
&main;
###############################################################################
sub main
{
my $f1 = 46;
my $f2 = 55;
my $nSteps = 10000000;
my $stepSize = 0.000001;
my $i;
my $ta;
my $tb;
my $prevZero = 0;
my $diffSteps;
my $sumValue;
my $prevSum;
my $zeroFreq;
for ($i=0; $i < $nSteps; $i++)
{
$ta = $i * $stepSize * $f1 * 2 * 3.1415926535;
$tb = $i * $stepSize * $f2 * 2 * 3.1415926535;
$sumValue = sin($ta) + sin($tb);
if (($sumValue*$prevSum)<0)
{
$diffSteps = $i - $prevZero;
$zeroFreq = 0.5/($diffSteps*$stepSize);
printf "zero found at step %8d, steps from prev zero %6d, inferred freq
%8.1f\n",$i,$diffSteps,$zeroFreq;
$prevZero = $i;
}
$prevSum = $sumValue;
# print "$i $sumValue \n";
}
}
Some of the output:
zero found at step 9901, steps from prev zero 9901, inferred freq
50.5
zero found at step 19802, steps from prev zero 9901, inferred freq
50.5
zero found at step 29703, steps from prev zero 9901, inferred freq
50.5
zero found at step 39604, steps from prev zero 9901, inferred freq
50.5
zero found at step 49505, steps from prev zero 9901, inferred freq
50.5
zero found at step 55556, steps from prev zero 6051, inferred freq
82.6
zero found at step 59406, steps from prev zero 3850, inferred freq
129.9
zero found at step 69307, steps from prev zero 9901, inferred freq
50.5
zero found at step 79208, steps from prev zero 9901, inferred freq
50.5
zero found at step 89109, steps from prev zero 9901, inferred freq
50.5
zero found at step 99010, steps from prev zero 9901, inferred freq
50.5
zero found at step 108911, steps from prev zero 9901, inferred freq
50.5
zero found at step 118812, steps from prev zero 9901, inferred freq
50.5
zero found at step 128713, steps from prev zero 9901, inferred freq
50.5
zero found at step 138614, steps from prev zero 9901, inferred freq
50.5
zero found at step 148515, steps from prev zero 9901, inferred freq
50.5
zero found at step 158416, steps from prev zero 9901, inferred freq
50.5
zero found at step 166667, steps from prev zero 8251, inferred freq
60.6
zero found at step 168317, steps from prev zero 1650, inferred freq
303.0
zero found at step 178218, steps from prev zero 9901, inferred freq
50.5
zero found at step 188119, steps from prev zero 9901, inferred freq
50.5
zero found at step 198020, steps from prev zero 9901, inferred freq
50.5
zero found at step 207921, steps from prev zero 9901, inferred freq
50.5
zero found at step 217822, steps from prev zero 9901, inferred freq
50.5
zero found at step 227723, steps from prev zero 9901, inferred freq
50.5
zero found at step 237624, steps from prev zero 9901, inferred freq
50.5
zero found at step 247525, steps from prev zero 9901, inferred freq
50.5
zero found at step 257426, steps from prev zero 9901, inferred freq
50.5
zero found at step 267327, steps from prev zero 9901, inferred freq
50.5
zero found at step 277228, steps from prev zero 9901, inferred freq
50.5
zero found at step 277778, steps from prev zero 550, inferred freq
909.1
zero found at step 287129, steps from prev zero 9351, inferred freq
53.5
zero found at step 297030, steps from prev zero 9901, inferred freq
50.5
zero found at step 306931, steps from prev zero 9901, inferred freq
50.5
zero found at step 316832, steps from prev zero 9901, inferred freq
50.5
zero found at step 326733, steps from prev zero 9901, inferred freq
50.5
zero found at step 336634, steps from prev zero 9901, inferred freq
50.5
zero found at step 346535, steps from prev zero 9901, inferred freq
50.5
zero found at step 356436, steps from prev zero 9901, inferred freq
50.5
zero found at step 366337, steps from prev zero 9901, inferred freq
50.5
zero found at step 376238, steps from prev zero 9901, inferred freq
50.5
zero found at step 386139, steps from prev zero 9901, inferred freq
50.5
The input frequencies were 46 and 55 Hz, Note that the inferred frequency
from the zero crossings is the average of the two and is very consistent.
The indications other than 50.5 are form the zeo crossings added by the
difference frequency components.
You can try other frequencies, but the zero crossings are defined by the sin
and cos terms in the trig identity that has been previously posted.