We introduce a Fourier-based harmonic analysis for a class of discrete dynamical systems which arise from Iterated Function Systems. Our starting point is the following pair of special features of these systems. (1) We assume that a measurable space
X
X
comes with a finite-to-one endomorphism
r
:
X
→
X
r\colon X\rightarrow X
which is onto but not one-to-one. (2) In the case of affine Iterated Function Systems (IFSs) in
R
d
\mathbb {R}^d
, this harmonic analysis arises naturally as a spectral duality defined from a given pair of finite subsets
B
,
L
B, L
in
R
d
\mathbb {R}^d
of the same cardinality which generate complex Hadamard matrices.
Our harmonic analysis for these iterated function systems (IFS)
(
X
,
μ
)
(X, \mu )
is based on a Markov process on certain paths. The probabilities are determined by a weight function
W
W
on
X
X
. From
W
W
we define a transition operator
R
W
R_W
acting on functions on
X
X
, and a corresponding class
H
H
of continuous
R
W
R_W
-harmonic functions. The properties of the functions in
H
H
are analyzed, and they determine the spectral theory of
L
2
(
μ
)
L^2(\mu )
. For affine IFSs we establish orthogonal bases in
L
2
(
μ
)
L^2(\mu )
. These bases are generated by paths with infinite repetition of finite words. We use this in the last section to analyze tiles in
R
d
\mathbb {R}^d
.