An angle sensor for determining an absolute angle signal of a first part (102, 302, 402) rotated with respect to a second part, the angle sensor comprising: - a first grating ring (345, 445) being constituted of a first plurality of first grating elements being arranged adjacent to each other constituting ring segments, each first grating element interacting with a first sensor (355, 455) for generating a first signal representative of a relative position of the first sensor (355, 455) along the corresponding ring segment of the first grating ring (345, 445), - a second grating ring (340, 440) being constituted of a second plurality of second grating elements being arranged adjacent to each other constituting ring segments, each second grating element interacting with a second sensor (350, 450) for generating a second signal representative of a relative position of the second sensor (350, 450) along the corresponding ring segment of the second grating ring, the first grating ring (345, 445) and the second grating ring (340, 440) being configured to rotate the same rotation angle as the first part (102, 302, 402) is rotated with respect to the second part, the first plurality and the second plurality being co-prime numbers and a difference between the first plurality and the second plurality being larger than 1, and - a calculator configured for calculating the absolute angle signal using a first linear combination of the first signal and the second signal, wherein the calculator is configured for determining a set of integer numbers C and D such that C*n1+D*n2=1, in which n1 is the first plurality and n2 is the second plurality, and wherein the calculator is configured for determining the absolute angle signal using the first linear combination of the first signal and the second signal using the set of integer number C and D such that C*A1+D*A2=AA, wherein A1 is the first signal, A2 is the second signal, and AA is the absolute rotational angle signal. - a first grating ring (345, 445) being constituted of a first plurality of first grating elements being arranged adjacent to each other constituting ring segments, each first grating element interacting with a first sensor (355, 455) for generating a first signal representative of a relative position of the first sensor (355, 455) along the corresponding ring segment of the first grating ring (345, 445), - a second grating ring (340, 440) being constituted of a second plurality of second grating elements being arranged adjacent to each other constituting ring segments, each second grating element interacting with a second sensor (350, 450) for generating a second signal representative of a relative position of the second sensor (350, 450) along the corresponding ring segment of the second grating ring, the first grating ring (345, 445) and the second grating ring (340, 440) being configured to rotate the same rotation angle as the first part (102, 302, 402) is rotated with respect to the second part, the first plurality and the second plurality being co-prime numbers and a difference between the first plurality and the second plurality being larger than 1, and - a calculator configured for calculating the absolute angle signal using a first linear combination of the first signal and the second signal, wherein the calculator is configured for determining a set of integer numbers C and D such that C*n1+D*n2=1, in which n1 is the first plurality and n2 is the second plurality, and wherein the calculator is configured for determining the absolute angle signal using the first linear combination of the first signal and the second signal using the set of integer number C and D such that C*A1+D*A2=AA, wherein A1 is the first signal, A2 is the second signal, and AA is the absolute rotational angle signal.