  In this article, $q$-regular sequences in the sense of Allouche and Shallit
are analysed asymptotically. It is shown that the summatory function of a
regular sequence can asymptotically be decomposed as a finite sum of periodic
fluctuations multiplied by a scaling factor. Each of these terms corresponds to
an eigenvalue of the sum of matrices of a linear representation of the
sequence; only the eigenvalues of absolute value larger than the joint spectral
radius of the matrices contribute terms which grow faster than the error term.
  The paper has a particular focus on the Fourier coefficients of the periodic
fluctuations: They are expressed as residues of the corresponding Dirichlet
generating function. This makes it possible to compute them in an efficient
way. The asymptotic analysis deals with Mellin--Perron summations and uses two
arguments to overcome convergence issues, namely H\"older regularity of the
fluctuations together with a pseudo-Tauberian argument.
  Apart from the very general result, three examples are discussed in more
detail: sequences defined as the sum of outputs written by a transducer when
reading a $q$-ary expansion of the input; the amount of esthetic numbers in the
first~$N$ natural numbers; and the number of odd entries in the rows of
Pascal's rhombus. For these examples, very precise asymptotic formul\ae{} are
presented. In the latter two examples, prior to this analysis only rough
estimates were known.
