We present a novel, accurate and fast algorithm to obtain Fourier series coecients from an IC layer whose description consists of rectilinear polygons on a plane, and how to implement it using o-the-shelf hardware components. Based on properties of Fourier calculus, we derive a relationship between the Discrete Fourier Transforms of the sampled mask transmission function and its continuous Fourier series coecients. The relationship leads to a straightforward algorithm for computing the continuous Fourier series coecients where one samples the mask transmission function, compute its discrete Fourier transform and applies a frequency-dependent multiplicative factor. The algorithm is guaranteed to yield the exact continuous Fourier series coecients for any sampling representing the mask function exactly. Computationally, this leads to signicant saving by allowing to choose the maximal such pixel size and reducing the fast Fourier transform size by as much, without compromising accuracy. In addition, the continuous Fourier series is free from aliasing and follows closely the physical model of Fourier optics. We show that in some cases this can make a signicant dierence, especially in modern very low pitch technology nodes.