# Given input and output time series, obtaining filter design

Say I have 5 minutes of input and output audio. One method I know is to do FFT on windows from input and output. Then divide FFT output into bins and find average energy in various bands for all the windows. After this, take ratio of energy bands from output windows with corresponding energy bands from input windows. And then take average of all these ratios. This will give an approximation to FFT(Y)/FFT(X) i.e. transfer function of the filter.

Are there any other methods to find transfer function given input and output time series?

If your system is linear, then you can find the impulse response $h(n)$ of the system using the convolution sum $y(n)=\sum_{k=0}^{N} h(k)x(n-k)$, which can be written in matrix-vector form as $y=Xh$, where $X$ is a convolution matrix of the input data and $N$ is the order of the system, say $N=10$ for example. Since you know $X$ and $y$, you can find $h$ via the Pseudo inverse, assuming you have created an over-determined system $y=Ah$. The pseudo-inverse is $h=(X^T X)^{-1}X^T y$. After finding $h$, find the FFT of $h$ or take the Laplace transform of $h$ to get the transfer function. I hope this helps you.