AnsweredAssumed Answered

How to interpolate and compare 2 sine waves

Question asked by paul sauv on Feb 28, 2018
Latest reply on Mar 6, 2018 by dhenry

Hi everyone,


With my STM32F103C8T6 I would like to receive the 2 signals I1 and I2 from the picture below in order to convert to square signal .

All the square part is already coded and working great. 

Now I would like to learn how to use this sine waveform and cosine signal and interpolate them such as the file attached in order to have a decent precision. For example, in my case the step of the wave is 20 microns so I would like to interpolate it by 20 in order to have 20 pulses of 1 micron. 

This is an optical ruler on a milling machine so the ruler can travel in  both ways with numerous direction changes

I'm a hobbyist so any bite of code is very welcomed


Right now, I only use Std periph lib, not HAL libraries.


Thank you for your help