How does one get the frequency response of a filter, given an input signal and the signal output by the filter?

  • $\begingroup$ If you have access to MATLAB, then you can use tfestimate. If not but you do have access to fft then you can write an equivalent function yourself. $\endgroup$
    – fibonatic
    Commented May 6, 2016 at 19:54

3 Answers 3


What you are looking for is probably an empirical transfer-function estimate (ETFE). Several methods can be used, but Welch's averaged periodogram [1] is arguably the most used [2].

The plant output data is usually generated using Gaussian white-noise excitation, although more informative input signals can be generated by experiment design, if prior information about the plant is known [3]. The ETFE of the plant $\widehat{G}(k)$ is found as the quotient of the cross power spectral density estimate of the input and the measured output $P_{yu}(k)$, and the power spectral density estimate of the input $P_{uu}(k)$, i.e., \begin{equation*} \widehat{G}(k) = \frac{P_{yu}(k)}{P_{uu}(k)} . \end{equation*} In Welch's method, the time-series data is divided into windowed segments, with an option to use overlapping segments. Then, a modified periodogram of each segment is computed and the results are averaged. Welch's method for generating an ETFE corresponds to the function tfestimate in MATLAB. One of the advantages of Welch's method is the flexibility in terms of the number of frequency samples and excitation signal used.


Frequency response is simply the ratio of the Fourier transforms of the output and input signals.

$$ H(e^{j\omega}) = \frac{Y(e^{j\omega})}{X(e^{j\omega})} $$

where $Y(e^{j\omega})$ is the Fourier transform of output $y[n]$:

$$ Y(e^{j\omega}) = \sum\limits_{n=-\infty}^{+\infty} y[n] e^{-j\omega n} $$

and $X(e^{j\omega})$ is the Fourier transform of input $x[n]$:

$$ X(e^{j\omega}) = \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j\omega n} $$

It might be a good idea to choose an input $x[n]$ such that $X(e^{j\omega}) \ne 0$ for all $\omega$ of interest in the frequency response.

  • 3
    $\begingroup$ Keep in mind that this equation for $H(\omega)$ only holds for linear systems. Also, if the input signal has zero energy at certain frequencies you cannot know the transfer function (i.e. frequency response in this context) at these frequencies. $\endgroup$
    – applesoup
    Commented May 15, 2016 at 17:43
  • 1
    $\begingroup$ @applesoup: You can get a "best linear approximation" to non-linear systems, which might be useful in some situations, such as when synthesizing a robust control law for a given steady-state operating point. $\endgroup$
    – Arnfinn
    Commented Aug 5, 2016 at 4:55
if you give an impulse as input , frequency response of output signal is equal to frequency response of filter. 
This technique is efficient only if you don't know filter specifications. 

So that I m assuming you know nothing about filter specifications. Here this matlab code implement the technique.

impulse=[1 zeros(1,999)];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.