Goertzel from ADC+Streamer
cgracey
Posts: 14,152
I'm done proving out all the pads on the latest test chip. Everything was spot-on, except the PLL, which I believe is in good shape now.
The last thing to try out was the Goertzel circuit. This brings all kinds of capability together. It uses an ADC on a pin, in conjunction with the streamer and CORDIC solver to perform frequency-power measurements. It can even output a sine and cosine on separate DAC pins, while some echoed version of either comes back in through an ADC pin. It resolves phase difference and power.
In my test, since I know the output already works, I tried out the input, never minding the output potential. I let it accumulate sine and cosine samples multiplied by the ADC bit stream, treating 0's as -1 and 1's as 1 coefficients. In my test, after 16 complete target-frequency cycles, I grab the sine and cosine accumulations and perform a cartesian-to-polar conversion on them to render power level of the target frequency in the ADC bitstream. Then, I get the power into a byte and output it onto a DAC pin which the scope shows. It's looking for 3.33MHz:
(pictures in next post, due to modern computer problems)
The last thing to try out was the Goertzel circuit. This brings all kinds of capability together. It uses an ADC on a pin, in conjunction with the streamer and CORDIC solver to perform frequency-power measurements. It can even output a sine and cosine on separate DAC pins, while some echoed version of either comes back in through an ADC pin. It resolves phase difference and power.
In my test, since I know the output already works, I tried out the input, never minding the output potential. I let it accumulate sine and cosine samples multiplied by the ADC bit stream, treating 0's as -1 and 1's as 1 coefficients. In my test, after 16 complete target-frequency cycles, I grab the sine and cosine accumulations and perform a cartesian-to-polar conversion on them to render power level of the target frequency in the ADC bitstream. Then, I get the power into a byte and output it onto a DAC pin which the scope shows. It's looking for 3.33MHz:
(pictures in next post, due to modern computer problems)
Comments
Here's the code that does it:
The CORDIC makes some otherwise-extremely-tedious things super easy and fun in assembly language.
Now to dissect the code... think there's a lot of help going on with streamer and smart pin
Voice projects I see on Youtube tend to demonstrate mere connectors back to Google's voice system. Bringing in the cloud is so anticlimactic. They only tell you what they want you to know, and they harvest every bit of information they gather. Then, they interpret what you say through their lens, which does things like apply capitalization on incidental words and phrases that happen to be trademarks. And someday, when they determine that they really don't like you for some secret reason, your system won't work. Not cool.
Having analog functionality on P2 will be a game changer IMO.