Skip to content

Commit 0e299da

Browse files
VeraEspors
authored andcommitted
Revision Welch method
1 parent 60772a8 commit 0e299da

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

spectral_estimation_random_signals/welch_method.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"source": [
1818
"## The Welch Method\n",
1919
"\n",
20-
"In the previous section it has been shown that the [periodogram](periodogram.ipynb), as a non-parametric estimator of the power spectral density (PSD) $\\Phi_{xx}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ of a random signal $x[k]$, is not consistent. This is due to the fact that its variance does not converge towards zero even when the length of the random signal is increased towards infinity. In order to overcome this problem, the [Bartlett method](https://en.wikipedia.org/wiki/Bartlett's_method) and [Welch method](https://en.wikipedia.org/wiki/Welch's_method) \n",
20+
"In the previous section it has been shown that the [periodogram](periodogram.ipynb) as a non-parametric estimator of the power spectral density (PSD) $\\Phi_{xx}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ of a random signal $x[k]$ is not consistent. This is due to the fact that its variance does not converge towards zero even when the length of the random signal is increased towards infinity. In order to overcome this problem, the [Bartlett method](https://en.wikipedia.org/wiki/Bartlett's_method) and [Welch method](https://en.wikipedia.org/wiki/Welch's_method) \n",
2121
"\n",
2222
"1. split the random signal into segments, \n",
2323
"2. estimate the PSD for each segment, and \n",
@@ -32,13 +32,13 @@
3232
"source": [
3333
"### Derivation\n",
3434
"\n",
35-
"The random signal $x[k]$ is split into into $L$ overlapping segments of length $N$, starting at multiples of the stepsize $M \\in {1,2, \\dots, N}$. These segments are windowed by the window $w[k]$ of length $N$, resulting in a windowed $l$-th segment $x_l[k]$ with $0\\leq l\\leq L-1$. The discrete time Fourier transformation (DTFT) $X_l(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ of the windowed $l$-th segment is then given as \n",
35+
"The random signal $x[k]$ is split into into $L$ overlapping segments of length $N$, starting at multiples of the step size $M \\in {1,2, \\dots, N}$. These segments are windowed by the window $w[k]$ of length $N$, resulting in a windowed $l$-th segment $x_l[k]$ with $0\\leq l\\leq L-1$. The discrete-time Fourier transformation (DTFT) $X_l(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ of the windowed $l$-th segment is then given as \n",
3636
"\n",
3737
"\\begin{equation}\n",
3838
"X_l(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega}) = \\sum_{k = 0}^{N-1} x[k + l \\cdot M] \\, w[k] \\; \\mathrm{e}^{\\,-\\mathrm{j}\\,\\Omega\\,k}\n",
3939
"\\end{equation}\n",
4040
"\n",
41-
"where the window $w[k]$ defined within $0\\leq k\\leq N-1$ should be normalized as $\\frac{1}{N} \\sum\\limits_{k=0}^{N-1} | w[k] |^2 = 1$. The stepsize $M$ determines the overlap between the segments. In general $N-M$ number of samples overlap between adjacent segments. For $M = N$ no overlap occurs. The overlap is sometimes given as ratio $\\frac{N-M}{N}\\cdot 100\\%$. \n",
41+
"where the window $w[k]$ defined within $0\\leq k\\leq N-1$ should be normalized as $\\frac{1}{N} \\sum\\limits_{k=0}^{N-1} | w[k] |^2 = 1$. The stepsize $M$ determines the overlap between the segments. In general, $N-M$ number of samples overlap between adjacent segments. For $M = N$ no overlap occurs. The overlap is sometimes given as ratio $\\frac{N-M}{N}\\cdot 100\\%$. \n",
4242
"\n",
4343
"Introducing $X_l(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ into the definition of the periodogram yields the periodogram of the $l$-th segment\n",
4444
"\n",
@@ -63,7 +63,7 @@
6363
"source": [
6464
"### Example\n",
6565
"\n",
66-
"The following example is equivalent to the previous [periodogram example](periodogram.ipynb#Example---Periodogram). We aim at estimating the PSD of a random process which draws samples from normal distributed white noise with zero-mean and unit variance. The true PSD is consequently given as $\\Phi_{xx}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega}) = 1$."
66+
"The following example is equivalent to the previous [periodogram example](periodogram.ipynb#Example---Periodogram). We aim at estimating the PSD of a random process which draws samples from normally distributed white noise with zero-mean and unit variance. The true PSD is consequently given as $\\Phi_{xx}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega}) = 1$."
6767
]
6868
},
6969
{
@@ -130,7 +130,7 @@
130130
"**Exercise**\n",
131131
"\n",
132132
"* Compare the results to the periodogram example. Is the variance of the estimator lower?\n",
133-
"* Change the number of segments `L` and check if the variance reduces further\n",
133+
"* Change the number of segments `L`. What changes?\n",
134134
"* Change the segment length `N` and stepsize `M`. What changes?\n",
135135
"\n",
136136
"When comparing both the estimates of the PSD in the previous periodogram and above example, it is obvious that the variance of the Welch estimator is lower. Increasing the number of segments `L` lowers the variance further. Increasing the segment length `N` increases the total number of discrete frequencies in the estimated PSD. Since in above example the total number of segments is kept constant, the variance increases. Lowering the stepsize `M` has the same result, since the total number of samples is reduced for a fixed number of segments."
@@ -144,7 +144,7 @@
144144
"\n",
145145
"It is shown in [[Stoica et al.](../index.ipynb#Literature)] that Welch's method is asymptotically unbiased. Under the assumption of a wide-sense stationary (WSS) random process, the periodograms $\\hat{\\Phi}_{xx,l}(e^{j \\Omega})$ of the segments can be assumed to be approximately uncorrelated. Hence, averaging over these reduces the overall variance of the estimator. It can be shown formally that in the limiting case of an infinitely number of segments (infintely long signal) the variance tends towards zero. As a result Welch's method is an asymptotically consistent estimator of the PSD. \n",
146146
"\n",
147-
"Note, for a finite segment length $N$ the properties of the estimated PSD $\\hat{\\Phi}_{xx}(e^{j \\Omega})$ depend on the length $N$ of the segments and the window function $w[k]$ due to the [leakage effect](../spectral_analysis_deterministic_signals/leakage_effect.ipynb)."
147+
"Note, that for a finite segment length $N$ the properties of the estimated PSD $\\hat{\\Phi}_{xx}(e^{j \\Omega})$ depend on the length $N$ of the segments and the window function $w[k]$ due to the [leakage effect](../spectral_analysis_deterministic_signals/leakage_effect.ipynb)."
148148
]
149149
},
150150
{
@@ -160,8 +160,9 @@
160160
}
161161
],
162162
"metadata": {
163+
"anaconda-cloud": {},
163164
"kernelspec": {
164-
"display_name": "Python 3",
165+
"display_name": "Python [default]",
165166
"language": "python",
166167
"name": "python3"
167168
},

0 commit comments

Comments
 (0)