> Interesting! You're detecting simultaneous tones! I'd always > thought of splitting the tones into high and low groups, then timing the > period of each. Are you doing this with no band splitting? Just a > comparator or schmitt driving a port? Ah-yupper. The way the algorithm works, in simple terms, is that I generate three phases each of the different tones (120 degrees apart) and count how often the comparator is high during each of the three phases. Then after doing that for 240/14400's of a second, I do some other strange and mysterious (but actually pretty simple) maths to filter out DC and third harmonics. Then I take the absolute value of each of the three buckets. If a bucket is large-positive or large-negative, then the tone exists in abundance. If all of the buckets for a tone are nearly zero then it doesn't.