First, we write the equality of mixed derivatives
$$
(u_x)_t = (u_t)_x \, .
$$
Second, we rewrite the wave equation as
$$
(u_t)_t = a^2 (u_x)_x + f \, .
$$
Therefore, setting ${\bf c} = (u_x, u_t)^\top$ and ${\bf f} = (0, f)^\top$, we have ${\bf c}_t = {\bf A} {\bf c}_x + {\bf f}$, where
$$
{\bf A} =
\left(
\begin{array}{cc}
0 & 1 \\
a^2 & 0
\end{array}
\right) .
$$
For Dirichlet boundary conditions $u(x_0,t) = \alpha$, we set $u_t(x_0,t) = 0$. Neumann boundary conditions $u_x(x_0,t) = \beta$ are unchanged. The initial value $u(x,0)=g(x)$ is accounted for by setting $u_x(x,0)=g'(x)$.
Let us diagonalize ${\bf A}$ as follows:
$$
{\bf A} =
\underbrace{
\left(
\begin{array}{cc}
-1/a & 1/a \\
1 & 1
\end{array}
\right)
}_{\bf P}\;
\underbrace{
\left(
\begin{array}{cc}
-a & 0 \\
0 & a
\end{array}
\right)
}_{\bf \Lambda}\;
\underbrace{
\frac{1}{2}
\left(
\begin{array}{cc}
-a & 1 \\
a & 1
\end{array}
\right)
}_{{\bf P}^{-1}}
.
$$
Now, setting ${\bf d} = {\bf P}^{-1}{\bf c}$ and ${\bf h} = {\bf P}^{-1}{\bf f}$, one has ${\bf d}_t = {\bf \Lambda} {\bf d}_x + {\bf h}$.