In Werner's "Funktionalanaylsis" (which is one of the German standard functional analysis books) one finds the following example after the statement and proof of the spectral theorem for bounded self-adjoint operators:
Let $H := L^2([0,1])$, $$ T: H \to H, x(t) \mapsto t \cdot x(t). $$ Then $T$ is self-adjoint and it holds that $\sigma(T) = \sigma_c(T)= [0,1]$. The spectral decomposition looks as follows: For $A \in \Sigma$ (the set of Borel subsets of $\sigma(T)$) set $$ E_A x := \mathbb{1}_{A \cap [0,1]}(x). $$ It is easy to see that $E: \Sigma \to L(H)$, $A \mapsto E_A$ is a spectral measure with compact support.
We can see that $E$ represents $T$: $$ \int \lambda d\langle E_{\lambda} x, y \rangle = \int \lambda x(\lambda) \overline{y(\lambda)} d \lambda = \langle T x, y \rangle, $$ as $$ \langle E_A x, y \rangle = \int_{A \cap [0,1]} x(\lambda) \overline{y(\lambda)} d \lambda = \int_{0}^{1} \mathbb{1}_{A}(\lambda) x(\lambda) \overline{y(\lambda)} d \lambda. $$ Therefore, $d\langle E_{\lambda} x, y \rangle$ has the density $x \overline{y} \in L^1$ with respect to the Lebesgue measure. This shows $T = \int \lambda d E_{\lambda}$.
Questions This example helped me understand spectral measures better and the choice of $E_A$ seems very natural.
Can somebody please provide an example of an operator and its spectral decomposition which also has an uncountable spectrum (so we really need an integral instead of a sum) but a different choice of spectral measure?