Learning a Fourier Transform for Linear Relative Positional Encodings in Transformers