A fast cosine transform in one and two dimensions | Synapse