Transfer function from experimental time domain data I have two sets of time domain data.  One is the input to a system and the other is its corresponding output, both measured at the same sampling frequency.  How to calculate the system's transfer function from this experimental data?
assuming your sets of time-domain data begin with $n=0$, Z transform both the input data, $x[n]$ and the output data, $y[n]$.

$$ X(z) \triangleq \mathcal{Z}\{x[n]\} = \sum\limits_{n=0}^{\infty} x[n] \ z^{-n} $$
$$ Y(z) \triangleq \mathcal{Z}\{y[n]\} = \sum\limits_{n=0}^{\infty} y[n] \ z^{-n} $$

divide the Z transform of the output by the Z transform of the input.  the result of that division is your transfer function.

$$ H(z) \triangleq \frac{Y(z)}{X(z)} = \frac{\sum\limits_{n=0}^{\infty} y[n] \ z^{-n} }{\sum\limits_{n=0}^{\infty} x[n] \ z^{-n} } $$

i cannot guarantee that, if you were to factor numerator and denominator, there will not be identical poles with zeros that could cancel and make the transfer function simpler, but it's a transfer function.