# Understanding the H1 and H2 estimators

So the $$H_1$$ and $$H_2$$ frequency response estimators for SISO systems are defined according to:

\begin{align} H_1 &= \frac{P_{yx}}{P_{xx}}\\ H_2 &= \frac{P_{yy}}{P_{xy}} \end{align}

Where $$\frac{A}{B}$$ is an element-wise division of vectors $$A$$ and $$B$$. The $$H_1$$ estimator should be used when the noise is uncorrelated with the input, and $$H_2$$ should be used when the noise is uncorrelated with the output. I've been trying to experiment with estimating frequency responses but I end up getting the same result regardless of which of the estimators I use. I first define the cross-spectral density according to:

\begin{align} P_{xy} &= X\odot \bar{Y}\\ P_{yx} &= Y\odot \bar{X}\\ P_{yy} &= Y\odot \bar{Y}\\ P_{xx} &= X\odot \bar{X} \end{align}

Where $$\bar{A}$$ denotes the complex conjugate of $$A$$, $$\odot$$ denotes element-wise multiplication. Here $$Y$$ and $$X$$ are vectors of the same length and the Fourier transformation of the signals $$x$$ and $$y$$.

If the definition of cross-spectral density is inserted into the $$H_1$$ and $$H_2$$ estimator formulations as described at the beginning of this post I get:

\begin{align} H_1 &= \frac{Y\odot \bar{X}}{X\odot \bar{X}} = \frac{Y}{X}\\ H_2 &= \frac{Y\odot \bar{Y}}{X\odot \bar{Y}} = \frac{Y}{X} \end{align} And, therefore, $$H_1 = H_2 = \frac{Y}{X}$$

The $$H_1$$ and $$H_2$$ estimators should yield different results as one is supposed to be used when the noise is uncorrelated with the input and the other with the output (as mentioned above).

However, according to my methodology, they are equivalent, at least according to my definitions and calculations. There must, therefore, be something wrong with my approach, but I can't seem to understand what.

EDIT: I realised that if one estimates the PSD or CSD without any averaging, i.e., welch or similar the $$H_1$$ and $$H_2$$ estimators are equivalent when I implement them. However, when I use welch averaging they are not equivalent. Although the $$H_1$$ estimator is better than the $$H_2$$ estimator regardless if there's noise on the input or output.

• Your distinction between $H_1$ and $H_2$ is based on different properties of "noise" but you have no representation of noise in your models. Add some noise to your input or output and see what happens. Commented Dec 5, 2020 at 0:50
• @Hilmar Even if I add noise, I still don't see that the equations change. Let's say that there's noise on the output such that $\hat{y} = y + \gamma$ where $\gamma$ is sampled from some random distribution. After I've measured $\hat{y}$ I still get the same result from both estimators. And I don't see how the equations above would change. Commented Dec 5, 2020 at 14:53
• I think that my starting post proves that the estimators are equivalent for any $X$ and $Y$, regardless of system properties such as noise or similar. However, there must be something wrong as they are obviously not equivalent. I just can't seem to figure out what assumptions I've done wrong. Commented Dec 5, 2020 at 15:00
• @Pontus | I would be interested to know if you have since reached any solid conclusions here. I have been looking at a very similar question, for a couple of different real-data situations. e.g. dsp.stackexchange.com/questions/74836 With my data, I can't do time averaging, but even using ensemble averaging (repeat experiments) I dont really see significant differences between H0, H1, H2. I am wondering if it is because my data (non-stationary, non-random) are totally unsuitable for this type of analysis. I would greatly appreciate any real-data experiences you could report. Commented May 29, 2021 at 0:20
• Is there a textbook that covers all this material? Commented Nov 7, 2022 at 23:24

Let's define the true transfer function $$H_0=P_{xy}/P_{xx}=P_{yy}/P_{yx}$$.

$$H_1$$: The transfer function is computed as the ratio of the cross spectrum between the input and output signals, to the input autospectrum: $$P_{xy}/P_{xx}$$.

The $$H_1$$ estimator assumes that there is no noise on the input and consequently that all the input measurements are accurate. By calculating the cross spectrum $$P_{xy}$$, it eliminates the influence of uncorrelated noise at the output. However, when noise exists at input,

$$H_1 = \frac{P_{xy}}{P_{xx}'} = \frac{P_{xy}}{P_{xx}+P_{nn}} = \frac{P_{xy}}{P_{xx}}\frac{1}{1+P_{nn}/P_{xx}} = H_0 \frac{1}{1+\varepsilon_1}$$

where $$P_{nn}$$ is the autospectrum of noise at input, and $$\varepsilon_1 = P_{nn}/P_{xx}$$ is the input noise-to-signal ratio. Thus $$H_1\leq H_0$$.

$$H_2$$: The transfer function is computed as the ratio of the output autospectrum to the cross spectrum between the output and input signals: $$P_{yy}/P_{yx}$$, and $$P_{yx}=P^*_{xy}$$.

The $$H_2$$ estimator assumes that there is no noise on the output. Noise is assumed to be only on input. $$H_2$$ has the ability, by averaging, to eliminate the influence of uncorrelated noise at the input. But if there exists noise at output,

$$H_2 = \frac{P_{yy}'}{P_{yx}} = \frac{P_{yy}+P_{nn}}{P_{yx}} = \frac{P_{yy}}{P_{yx}}(1+P_{nn}/P_{yy}) = H_0 (1+\varepsilon_2)$$

where $$\varepsilon_2=P_{nn}/P_{yy}$$ is the output noise-to-signal ratio. Hence $$H_2\geq H_0$$.

$$H_1$$ equals to $$H_2$$ when their respective assumptions are met, that is there is no noise at input when calculating $$H_1$$, and there is no noise at output when calculating $$H_2$$. If the assumptions are not met, they give different results.

Proving that the H1 estimator ignores noise on the output:

If we assume that the output is the input processed by the transfer function plus some output noise, we have $$Y = H(f)X(f) + N$$, where everything is in the freq domain.

So, $$S_{xy}(f) = E[X(f)^*Y(f)] = E[X(f)^*(H(f)X(f) + N(f))]$$. where E[] denotes expectation and * denotes complex conjugate.

If you multiply this out, you get

$$S_{xy}(f) = H(f)E[X(f)^*X(f)] + E[X(f)^*N(f)] = H(f)S_{xx}(f)$$

Crucially, we assume that the input is uncorrelated with the noise so the expectation of the noise term cancels to zero. Rearranging, we get the H1 estimator, which is not affected by noise on the output:

$$H1 = \frac{S_{xy}}{S_{xx}}$$

If you try this with noise on the input, the answer isn't as clean - this is because the H1 estimator is not immune to noise on the input. If you repeat a similar proof for the H2 estimator you will be pleasantly surprised :-)