I will discuss applying the theory of harmonic analysis on the
fundamental domain of SL(2,Z) to partition functions of 2d conformal
field theories. As an application I will decompose the partition
function of c free bosons on a Narain lattice into eigenfunctions of the
Laplacians of worldsheet moduli space H/SL(2,Z) and of target space
moduli space O(c,c;Z)\O(c,c;R)/O(c)xO(c). This decomposition will make
certain properties of Narain theories including their ensemble averages
manifest. I will also discuss applying harmonic analysis to a general
irrational 2d CFT and its connection with gravity in AdS3. I will prove
that the primary spectrum of any 2d CFT is fully determined by a certain
subset of degeneracies.