I am a newbie and looking for solutions to convert sine/cos encoder signals to digital resolution of 12 bits or 360/4095=.087 degrees/LSB. Shaft rotates maximum to 1rps. I have external adc with arduino and scanning at 1.2 KHz. I tried arc tangent method and I have to get 4095 counts in one second (for 1 rps), ( attached is the csv file). my doubt is that I have to take into account of time resolution of incoming signal, LSB changes at 244 us. So should I scan at 4.096KHz to get angle resolution of .087degrees?
Knowing the sign of each I'd know the quadrant and knowing the quadrant, either sine or cosine gives me the angle.
When cosine or sine are zero it's even quicker.
i'd put a table in flash with 4096 entries, 1 for every sine or cosine value (becomes the index) with the degrees for each in the table.
Lookup takes less than a microsecond. Calculating, given that most duinos don't have FPU's (I know of one, Teensy 3.6) the calculation will be slowwww.