Difference between revisions of "Signal Representation/Spectrum Analysis"

From LNTwww
 
Line 48: Line 48:
 
==Describing windowing from a system theory perspective==   
 
==Describing windowing from a system theory perspective==   
 
<br>
 
<br>
The occurrence of such unwanted side lobes is now to be explained using the following diagram. This graphic was also taken from the book&nbsp; [Söd93]<ref name='Söd93'>Söder, G.:&nbsp; Modellierung, Simulation und Optimierung von Nachrichtensystemen.&nbsp; In: Berlin – Heidelberg: Springer, 1993.</ref>
+
The occurrence of such unwanted side lobes is now to be explained using the following diagram.&nbsp; This graphic was also taken from the book&nbsp; [Söd93]<ref name='Söd93'>Söder, G.:&nbsp; Modellierung, Simulation und Optimierung von Nachrichtensystemen.&nbsp; In: Berlin – Heidelberg: Springer, 1993.</ref>
  
[[File:EN_Sig_T_5_4_S2.png|right|frame|Rectangular window (top) and Bartlett window (bottom)]]
+
[[File:EN_Sig_T_5_4_S2.png|right|frame|Rectangular window&nbsp; $($top$)$&nbsp; and Bartlett window&nbsp; $($bottom$)$]]
  
 
First consider the upper graph&nbsp; '''(a)'''&nbsp; for the&nbsp; &raquo;'''rectangular window'''&laquo;.
 
First consider the upper graph&nbsp; '''(a)'''&nbsp; for the&nbsp; &raquo;'''rectangular window'''&laquo;.
*The time limit implicit in the DFT corresponds to the multiplication of the signal&nbsp; $x(t)$&nbsp; by a rectangular window function&nbsp; $w(t)$&nbsp; of height&nbsp; $1$&nbsp; and duration&nbsp; $T_{\rm P}$.  
+
*The time limit implicit in the DFT corresponds to the multiplication of the signal&nbsp; $x(t)$&nbsp; by a rectangular window function&nbsp; $w(t)$&nbsp; of height&nbsp; $1$&nbsp; and duration&nbsp; $T_{\rm P}$.
 +
 
*The upper left graph shows the discrete-time representation of this rectangular function with the normalized time variable&nbsp; $\nu= t/T_{\rm A}$:
 
*The upper left graph shows the discrete-time representation of this rectangular function with the normalized time variable&nbsp; $\nu= t/T_{\rm A}$:
 
   
 
   
Line 64: Line 65:
 
\end{array}$$
 
\end{array}$$
  
*From the multiplication&nbsp; $y(t) = x(t) \cdot w(t)$&nbsp; of the signal&nbsp; $x(t)$&nbsp; to be analyzed and the window function&nbsp; $w(t)$&nbsp; follows for the spectral function&nbsp; $Y(f) = X(f) \ast W(f)$, where for the rectangular window with&nbsp; $f_{\rm A} = 1/T_{\rm P}$&nbsp; and&nbsp; ${\rm si}(x) = \sin(x)/x = {\rm sinc}(x/\pi) $&nbsp; holds:
+
*From the multiplication&nbsp; $y(t) = x(t) \cdot w(t)$&nbsp; of the signal&nbsp; $x(t)$&nbsp; to be analyzed and the window function&nbsp; $w(t)$&nbsp; follows for the spectral function&nbsp; $Y(f) = X(f) \ast W(f)$,&nbsp; where for the rectangular window with&nbsp; $f_{\rm A} = 1/T_{\rm P}$&nbsp; and&nbsp; ${\rm si}(x) = \sin(x)/x = {\rm sinc}(x/\pi) $&nbsp; holds:
 
   
 
   
 
:$$W(f) = T_{\rm P} \cdot {\rm sinc}(f \cdot T_{\rm P}) = {1}/{f_{\rm A}}\cdot {\rm sinc}({f}/{f_{\rm A}})\hspace{0.05cm}.$$
 
:$$W(f) = T_{\rm P} \cdot {\rm sinc}(f \cdot T_{\rm P}) = {1}/{f_{\rm A}}\cdot {\rm sinc}({f}/{f_{\rm A}})\hspace{0.05cm}.$$
  
*The function&nbsp; $W(f)$&nbsp; is shown logarithmically in the upper right graph.&nbsp; If all spectral components of&nbsp; $x(t)$&nbsp; lie in the frequency grid&nbsp; $\mu \cdot f_{\rm A}$, the discrete frequency spectral values&nbsp; $D(\mu )$&nbsp; remain unchanged by the convolution with&nbsp; $W(f)$.  
+
*The spectral  function&nbsp; $W(f)$&nbsp; is shown logarithmically in the upper right graph.&nbsp; If all spectral components of&nbsp; $x(t)$&nbsp; lie in the frequency grid&nbsp; $\mu \cdot f_{\rm A}$,&nbsp; the discrete frequency spectral values&nbsp; $D(\mu )$&nbsp; remain unchanged by the convolution with&nbsp; $W(f)$.
*Otherwise, convolution with&nbsp; $W(f)$&nbsp; leads to distortions, since the zeros of the&nbsp; $\rm sinc$ function no longer fit the discrete values of the input spectrum.
+
 +
*Otherwise,&nbsp; convolution with&nbsp; $W(f)$&nbsp; leads to distortions,&nbsp; since the zeros of the&nbsp; $\rm sinc$&nbsp; function no longer fit the discrete values of the input spectrum.
 
<br clear=all>
 
<br clear=all>
The discontinuities in the time domain caused by limitation and periodic continuation are reduced if, instead of the constant one weighting by the rectangle, the two edge areas of the window are weighted weaker than the center.
+
The discontinuities in the time domain caused by limitation and periodic continuation are reduced if,&nbsp; instead of the constant one weighting by the rectangle,&nbsp; the two edge areas of the window are weighted weaker than the center.
  
Consider the graph&nbsp; '''(b)'''&nbsp; for the&nbsp; &raquo;'''Bartlett window'''&laquo; - also called&nbsp; "triangular window":
+
Consider the graph&nbsp; '''(b)'''&nbsp; for the&nbsp; &raquo;'''Bartlett window'''&laquo; &ndash; also called&nbsp; "triangular window":
 
*The discrete-time description of the Bartlett window is with&nbsp; $\nu = t/T_{\rm A}$:
 
*The discrete-time description of the Bartlett window is with&nbsp; $\nu = t/T_{\rm A}$:
 
:$${w} (\nu)  = \left\{ \begin{array}{c} 1 - {2  \hspace{0.05cm} \cdot  \hspace{0.05cm} |\nu|}/{N} \\
 
:$${w} (\nu)  = \left\{ \begin{array}{c} 1 - {2  \hspace{0.05cm} \cdot  \hspace{0.05cm} |\nu|}/{N} \\
Line 91: Line 93:
 
\hspace{0.2cm}W(f) ={1}/({2f_{\rm A}})\cdot {\rm sinc}^2(
 
\hspace{0.2cm}W(f) ={1}/({2f_{\rm A}})\cdot {\rm sinc}^2(
 
{f}/({2f_{\rm A}}))\hspace{0.05cm}.$$
 
{f}/({2f_{\rm A}}))\hspace{0.05cm}.$$
*Due to the lower weighting of the edge regions, which are particularly problematic with unbounded signals, the (logarithmically drawn) spectrum&nbsp; $W(f)$&nbsp; has lower side lobes than the&nbsp; $\rm sinc$ function in the upper graph, which leads to lower leakage components.
+
*Due to the lower weighting of the edge regions,&nbsp; which are particularly problematic with unbounded signals,&nbsp; the&nbsp; $($logarithmically drawn$)$&nbsp; spectrum&nbsp; $W(f)$&nbsp; has lower side lobes than the&nbsp; $\rm sinc$ function in the upper graph,&nbsp; which leads to lower leakage components.
*The better suppression of the side lobes, however, comes at the cost of a noticeable reduction and broadening of the main lobe, limiting the resolving power of the Bartlett window compared to rectangular windowing.
+
 
 +
*The better suppression of the side lobes,&nbsp; however,&nbsp; comes at the cost of a noticeable reduction and broadening of the main lobe,&nbsp; limiting the resolving power of the Bartlett window compared to rectangular windowing.
 
   
 
   
  
Line 98: Line 101:
 
==Special window functions==
 
==Special window functions==
 
<br>   
 
<br>   
[[File:EN_Sig_T_5_4_S3_v2.png|right|frame|Hanning window, Hamming window and Kaiser-Bessel window]]
+
[[File:EN_Sig_T_5_4_S3_v2.png|right|frame|Hanning window,&nbsp; Hamming window and Kaiser-Bessel window]]
Now some frequently used&nbsp; [https://en.wikipedia.org/wiki/Window_function $\text{window functions}$], viz.  
+
Now some frequently used&nbsp; [https://en.wikipedia.org/wiki/Window_function &raquo;window functions&laquo;], viz.  
*the Hanning window,  
+
*the Hanning window,
*the Hamming window, and  
+
 +
*the Hamming window,&nbsp; and  
 +
 
 
*the Kaiser-Bessel window
 
*the Kaiser-Bessel window
 
   
 
   
  
will be described by means of graphs and equations contained therein. For the running variable in the time domain, $-N/2 ≤ \nu < N/2$ always applies.
+
will be described by means of graphs and equations contained therein.&nbsp;
 +
 
 +
For the running variable in the time domain always applies:
 +
:$$-N/2 ≤ \nu < N/2.$$&nbsp; 
 +
 
 +
 
 +
 
 +
 
  
  
''Notes:''
+
 
#In the Kaiser-Bessel window, the functions in the time and frequency domain are each shown for&nbsp; $\alpha = 3.5$&nbsp;.
+
<u>Notes:</u>
# ${\rm I}_0(.)$&nbsp; denotes the&nbsp; [https://en.wikipedia.org/wiki/Bessel_function $\text{modified zero-order Bessel function}$].
+
*In the Kaiser-Bessel window,&nbsp; the functions in the time and frequency domain are each shown for&nbsp; $\alpha = 3.5$.
#Further window functions such as the Blackman-Harris window, the&nbsp; [https://en.wikipedia.org/wiki/Raised-cosine_filter $\text{cosine rolloff window}$]&nbsp; (also called Tukey window) and many more can be found in the book&nbsp; [Söd93]<ref name='Söd93'>Söder, G.:&nbsp; Modellierung, Simulation und Optimierung von Nachrichtensystemen.&nbsp; In: Berlin – Heidelberg: Springer, 1993.</ref>.
+
 
 +
* ${\rm I}_0(.)$&nbsp; denotes the&nbsp; [https://en.wikipedia.org/wiki/Bessel_function &raquo;modified zero-order Bessel function&laquo;].
 +
 
 +
*Further window functions such as the&nbsp; &raquo;Blackman-Harris window&raquo;,&nbsp; the&nbsp; [https://en.wikipedia.org/wiki/Raised-cosine_filter&nbsp; &raquo;cosine rolloff window&laquo;]&nbsp; $($also called Tukey window$)$&nbsp; and many more can be found in the book&nbsp; [Söd93]<ref name='Söd93'>Söder, G.:&nbsp; Modellierung, Simulation und Optimierung von Nachrichtensystemen.&nbsp; In: Berlin – Heidelberg: Springer, 1993.</ref>.
  
  
Line 117: Line 132:
 
<br clear=all>  
 
<br clear=all>  
 
==Quality criteria of window functions==
 
==Quality criteria of window functions==
<br>
+
<br>  
[[File:EN_Sig_T_5_4_S4_v2.png|right|frame|Compilation of important quality criteria of window functions]]
+
The table shows quality criteria for the window functions described in the last sections.&nbsp; The selection of a suitable window function should be made according to the following aspects:
The table shows quality criteria for the window functions described in the last sections.&nbsp; The selection of a suitable window function should be made according to the following aspects:
+
[[File:EN_Sig_T_5_4_S4_v2.png|right|frame|Compilation of important quality criteria of window functions<br><br><br><br><br><br>]]
 +
[[File:EN_Sig_T_5_4_S4b.png|right|frame|Illustrating the&nbsp; &raquo;6dB bandwidth&laquo;<br><br>]]
 +
 
 
*The&nbsp; &raquo;'''minimum distance between main lobe and side lobes'''&laquo;&nbsp; should be as large as possible to keep the influence of the leakage effect low and to improve the amplitude resolution.
 
*The&nbsp; &raquo;'''minimum distance between main lobe and side lobes'''&laquo;&nbsp; should be as large as possible to keep the influence of the leakage effect low and to improve the amplitude resolution.
*For reasons of good frequency selectivity, the&nbsp; &raquo;'''6dB bandwidth'''&laquo;&nbsp; should be small.&nbsp; If this parameter is too large, a dominant spectral line will mask smaller components in the surrounding area.
+
 
 +
*For reasons of good frequency selectivity,&nbsp; the&nbsp; &raquo;'''6dB bandwidth'''&laquo;&nbsp; should be small.&nbsp; If this parameter is too large,&nbsp; a dominant spectral line will mask smaller components in the surrounding area.
 +
 
 
*The&nbsp; &raquo;'''maximum process loss'''&laquo;&nbsp; includes the maximum scaling error and the equivalent noise bandwidth. This value should never exceed&nbsp; $\text{3.7 dB}$.
 
*The&nbsp; &raquo;'''maximum process loss'''&laquo;&nbsp; includes the maximum scaling error and the equivalent noise bandwidth. This value should never exceed&nbsp; $\text{3.7 dB}$.
  
  
These most important quality criteria are highlighted in red in the adjacent table.
+
These three most important quality criteria are highlighted in red in the adjacent table.
*In each row, rather favourable window functions are highlighted in green and rather unfavourable ones in grey.  
+
#In each row,&nbsp; rather favourable window functions are highlighted in green and rather unfavourable ones in grey.  
*From the distribution of the green and grey areas it is already evident that the optimal window function does not exist.
+
#From the distribution of the green and grey areas it is already evident that the optimal window function does not exist.
<br clear=all>
+
 
 +
 
 +
 
 
Now the quality criteria given in the table are described in more detail:
 
Now the quality criteria given in the table are described in more detail:
*The larger the&nbsp; &raquo;'''minimum main-to-side lobe distance'''&laquo; &nbsp; ⇒ &nbsp; ratio of the main lobe to the highest side lobe, the better the amplitude resolution of a window function.&nbsp; As expected, for the rectangle this distance is  smallest&nbsp; $\text{(13 dB)}$.&nbsp; The best result is achieved with&nbsp; $\text{92 dB}$&nbsp; the fourth-order Blackman-Harris window.
+
*The larger the&nbsp; &raquo;'''minimum main-to-side lobe distance'''&laquo; &nbsp; ⇒ &nbsp; ratio of the main lobe to the highest side lobe,&nbsp; the better the amplitude resolution of a window function.&nbsp;  
*However, since not only the highest but also all other side lobes contribute to the leakage effect, the&nbsp; &raquo;'''side lobe drop'''&laquo;&nbsp; is another measure for the resolving power.&nbsp; Of the given window functions, the Hanning window and the cosine rolloff window with rolloff&nbsp; $r = 0.5$&nbsp; have the most favourable values in this respect&nbsp; $\text{(18 dB/octave)}$.
+
::As expected,&nbsp; for the rectangle this distance is  smallest&nbsp; $\text{(13 dB)}$.&nbsp; The best result&nbsp; $\text{(92 dB)}$&nbsp; is achieved with the fourth-order Blackman-Harris window.
[[File:EN_Sig_T_5_4_S4b.png|left|frame|Illustrating the "6dB bandwidth"]]
 
  
*The&nbsp; &raquo;'''6 dB bandwidth'''&laquo;, which can be read from the logarithmized spectral function, is an important measure of the frequency resolving power.&nbsp; Two spectral components present in the signal at&nbsp; $f_1$&nbsp; and&nbsp; $f_2$&nbsp; can only be resolved if the difference&nbsp; $f_2 - f_1$&nbsp; is greater than the&nbsp; "6dB bandwidth" of the window function used (see left graph).
+
*However,&nbsp; since not only the highest but also all other side lobes contribute to the leakage effect,&nbsp; the&nbsp; &raquo;'''side lobe drop'''&laquo;&nbsp; is another measure for the resolving power.&nbsp;  
 +
::Of the given window functions,&nbsp; the Hanning window and the cosine rolloff window with rolloff&nbsp; $r = 0.5$&nbsp; have the most favourable values in this respect&nbsp; $\text{(18 dB/octave)}$.
  
*The&nbsp; &raquo;'''window area'''&laquo;&nbsp; of the function&nbsp; $w(t)$&nbsp; at the same time gives the height&nbsp; $W(0)$&nbsp; in the spectral domain.&nbsp; For all windows except the rectangle, a window area smaller than&nbsp; $1$&nbsp; and thus an error in the amplitude of the DFT results due to the suppression of the outer samples, which, however, can be completely corrected if&nbsp; $w(t)$&nbsp; is known.
+
*The&nbsp; &raquo;'''6 dB bandwidth'''&laquo;,&nbsp; which can be read from the logarithmized spectral function,&nbsp; is an important measure of frequency resolving.&nbsp;
 +
::Two spectral components  in the signal at&nbsp; $f_1$&nbsp; and&nbsp; $f_2$&nbsp; can only be resolved if the difference&nbsp; $f_2 - f_1$&nbsp; is greater than the&nbsp; &raquo;6dB bandwidth&laquo;&nbsp; of the window function used&nbsp; $($see lower graph$)$.
 +
 
 +
*The&nbsp; &raquo;'''window area'''&laquo;&nbsp; of the function&nbsp; $w(t)$&nbsp; at the same time gives the height&nbsp; $W(0)$&nbsp; in the spectral domain.&nbsp;  
 +
::For all windows except the rectangle,&nbsp; $W(0)<1$&nbsp; and thus a DFT amplitude error results due to the suppression of outer samples,&nbsp; which,&nbsp; however,&nbsp; can be completely corrected if&nbsp; $w(t)$&nbsp; is known.
  
  
Line 142: Line 167:
 
==Maximum process loss==
 
==Maximum process loss==
 
<br> 
 
<br> 
This combined quality criterion considers the&nbsp; &raquo;'''maximum scaling error'''&laquo;&nbsp; as well as the (normalized)&nbsp; &raquo;'''equivalent noise bandwidth'''&laquo;.&nbsp; The maximum process loss is usually given in&nbsp; $\text{dB}$&nbsp; and should be rather small according to its name:
+
This combined quality criterion considers  
 +
*the&nbsp; &raquo;'''maximum scaling error'''&laquo;&nbsp; as well as  
 +
 
 +
*the (normalized)&nbsp; &raquo;'''equivalent noise bandwidth'''&laquo;.&nbsp;  
 +
 
 +
 
 +
The maximum process loss is usually given in&nbsp; $\text{dB}$&nbsp; and should be&nbsp; $($according to its name$)$&nbsp; rather small:
 
   
 
   
 
:$$10 \cdot {\rm lg}\hspace{0.15cm}V_{\rm P}\hspace{0.15cm}{\rm (in}\hspace{0.15cm}{\rm dB)}= 20 \cdot {\rm lg}\hspace{0.15cm}
 
:$$10 \cdot {\rm lg}\hspace{0.15cm}V_{\rm P}\hspace{0.15cm}{\rm (in}\hspace{0.15cm}{\rm dB)}= 20 \cdot {\rm lg}\hspace{0.15cm}
Line 148: Line 179:
 
  \frac{\int_{-\infty}^{\infty}|W(f)|^2\hspace{0.05cm}{\rm d}f}{f_{\rm A} \cdot |W(f=0)|^2} \hspace{0.05cm}.$$
 
  \frac{\int_{-\infty}^{\infty}|W(f)|^2\hspace{0.05cm}{\rm d}f}{f_{\rm A} \cdot |W(f=0)|^2} \hspace{0.05cm}.$$
  
From the&nbsp; [[Signal_Representation/Spectrum_Analysis#Quality_criteria_of_window_functions|"table in the last section"]]&nbsp; it can be seen that for the window functions considered&nbsp; $V_{\rm P}$&nbsp; takes values between&nbsp; $\text{3 dB}$&nbsp; and&nbsp; $\text{4 dB}$,&nbsp; where window functions with&nbsp; $V_{\rm P} > 3. 7 \,\text{dB}$&nbsp; (Rectangle, Blackman-Harris, Kaiser-Bessel)&nbsp; should not be used.&nbsp; However, it is precisely these that are best with regard to the main-to-side lobe distance.
+
From the&nbsp; [[Signal_Representation/Spectrum_Analysis#Quality_criteria_of_window_functions|&raquo;table in the last section&laquo;]]&nbsp; it can be seen that for the window functions considered&nbsp; $V_{\rm P}$&nbsp; takes values between&nbsp; $\text{3 dB}$&nbsp; and&nbsp; $\text{4 dB}$,&nbsp; where window functions with&nbsp; $V_{\rm P} > 3. 7 \,\text{dB}$&nbsp; $($rectangle,&nbsp; Blackman-Harris,&nbsp; Kaiser-Bessel$)$&nbsp; should not be used.&nbsp; However,&nbsp; it is precisely these that are best with regard to the main-to-side lobe distance.
  
 
The two proportions are to be interpreted as follows:
 
The two proportions are to be interpreted as follows:
*The&nbsp; "maximum scaling error"&nbsp; is the ratio by which the amplitude determined with the DFT differs from the actual signal amplitude.&nbsp; Hereby, the amplitude error due to a window area smaller than&nbsp; $1$&nbsp; is assumed to be corrected.
+
#The&nbsp; &raquo;maximum scaling error&laquo;&nbsp; is the ratio by which the amplitude determined with the DFT differs from the actual signal amplitude.&nbsp; Hereby,&nbsp; the amplitude error due to a window area smaller than&nbsp; $1$&nbsp; is assumed to be corrected.
*The wider the main lobe of the window function, the smaller this scaling error.&nbsp; The error is largest when the frequency&nbsp; $f_0$&nbsp; of a harmonic oscillation lies midway between two DFT support points &nbsp; ⇒ &nbsp; quotient $|W(f = 0)| / |W(f = f_{\rm A}/2)|$.  
+
#The wider the main lobe of the window function,&nbsp; the smaller this scaling error.&nbsp; The error is largest when the frequency&nbsp; $f_0$&nbsp; of a harmonic oscillation lies midway between two DFT support points &nbsp; ⇒ &nbsp; quotient $|W(f = 0)| / |W(f = f_{\rm A}/2)|$.
 +
#The&nbsp; &raquo;equivalent noise bandwidth&laquo;&nbsp; of the window function is calculable as the width of the equal-area rectangle with respect to the magnitude square&nbsp; $|W(f)|^2$&nbsp; of the spectral function.&nbsp; This parameter captures the disturbing influence of white noise and should be as small as possible.
 +
#The smallest noise bandwidth results for the rectangle.&nbsp; All other window functions have a larger noise bandwidth and thus,&nbsp; in the presence of noise,&nbsp; also a&nbsp; $($significantly$)$&nbsp; less favourable signal-to-noise power ratio.
  
*The&nbsp; "equivalent noise bandwidth"&nbsp; of the window function is calculable as the width of the equal-area rectangle with respect to the magnitude square&nbsp; $|W(f)|^2$&nbsp; of the spectral function.&nbsp; This parameter captures the disturbing influence of white noise and should be as small as possible.
 
*The smallest noise bandwidth results for the rectangle.&nbsp; All other window functions have a larger noise bandwidth and thus, in the presence of noise, also a (significantly) less favourable signal-to-noise power ratio.
 
  
 +
{{BlaueBox|TEXT=
 +
$\text{The results of this section can be summarized as follows:}$&nbsp;
 +
*'''An ideal window function does not exist'''.&nbsp; Depending on the task&nbsp; $($good amplitude or frequency resolution$)$&nbsp; different windows provide the best result in each case.&nbsp; It is therefore recommended that one always uses several window functions for spectral analysis or at least one window function with different parameters.
  
{{BlaueBox|TEXT=
+
*A workable compromise with regard to all criteria is the&nbsp; &raquo;'''Hamming window'''&laquo; which only gives one unfavourable value&nbsp; $($&raquo;side lobe drop&laquo;&nbsp; only&nbsp; 6 dB per octave$)$.
$\text{Conclusion:}$&nbsp;
+
The results of this section can be summarized as follows:
+
*Although the&nbsp; &raquo;'''Hanning window'''&laquo;&nbsp; differs only marginally from the Hamming window in the time domain,&nbsp; in the spectral domain&nbsp; $($&raquo;minimum distance between main lobe and side lobes&laquo;)&nbsp; the difference between these two windows is considerable.}}
*'''An ideal window function does not exist'''.&nbsp; Depending on the task&nbsp; (good amplitude or frequency resolution)&nbsp; different windows provide the best result in each case.&nbsp; It is therefore recommended that one always uses several window functions for spectral analysis or at least one window function with different parameters.
 
*A workable compromise with regard to all criteria is the&nbsp; &raquo;'''Hamming window'''&laquo;, which only gives one unfavourable value&nbsp; $($"side lobe drop"&nbsp; only&nbsp; 6 dB per octave$)$&nbsp;.  
 
*Although the&nbsp; &raquo;'''Hanning window'''&laquo;&nbsp; differs only marginally from the Hamming window in the time domain, in the spectral domain&nbsp; ("minimum distance between main lobe and side lobes")&nbsp; the difference between these two windows is considerable.}}
 
  
 
   
 
   

Latest revision as of 16:02, 27 June 2023

Spectral leakage effect


$\text{Definition:}$  The term  »spectral leakage effect«  is used to describe the distortion of the spectrum of a periodic and thus temporally unlimited signal due to the implicit time limit of the  »Discrete Fourier Transform«  $\rm (DFT)$.  This means that,  for example,  a spectrum analyzer

  • fake frequency components that are not present in the time signal,  and/or
  • actually existing spectral components are hidden by side lobes.


The following  $\text{Example 1}$  will show that for a periodic signal the application of the  »Discrete Fourier Transform«  $\text{(DFT)}$  is not useful without additional measures.  The quality of the spectral analysis – i.e. the correctness of the spectrum found – is mainly determined here by the  $($more or less successful$)$  adaptation of the DFT parameters to the signal parameters at hand.

  1. If the period  $T_0$  of the signal is known,  the duration  $T_{\rm P}$  of the signal section used for the DFT should be an integer multiple of  $T_0$. 
  2. However,  the task of spectral analysis is precisely to find arbitrary signal components,  so that the knowledge of  $T_0$  cannot generally be assumed.
  3. A measure to improve the spectral analysis is the windowing with a  suitable  time function  $w(t)$.  The product signal  $x(t) \cdot w(t)$  is then analyzed.
  4. A large number of such window functions  $w(t)$  are known from the literature,  which lead to good or less satisfactory results depending on the task.


In the next sections the spectral leakage effect will be illustrated by examples and the advantages and disadvantages of the different window functions will be discussed.  So much up front:  There is no  "best"  window function for all applications.

$\text{Example 1:}$  The upper graph  (a)  from [Söd93][1]  shows the discrete-time signal  $d(\nu)$  of a harmonic oscillation with frequency  $f_0 = 125\,\text{ kHz}$   ⇒   period duration  $T_0 = 8 \,{\rm µ s}$. The distance between two successive time samples in this example is chosen to be  $T_{\rm A} = 1 \,{\rm µ s}$ .

Example of applying spectral analysis

⇒   On the right the frequency discrete spectrum  $\vert D(\mu) \vert$  after a DFT with  $N = 32$  samples is shown in logarithmic form (in dB),  from which the further DFT parameters result as follows:

  • Duration of the time segment:   $T_{\rm P} = 32 \,{\rm µ s}$,
  • gridding of the frequency axis:   $f_{\rm A} = 31.25 \,\text{ kHz}$.


Since the interval width  $T_{\rm P}$  captures an integer multiple of period  $T_0$,  the DFT delivers the correct result.  The two Dirac delta functions lie exactly at  $\pm4 \cdot f_{\rm A}$.

⇒   If one measures an oscillation of frequency  $f_0 = 109.375\,\text{ kHz}$   ⇒   period $T_0 = 9.14 \,{\rm µ s}$  corresponding to the graph below  (b),  significant distortions of the spectrum occur.

  • Since now  $T_{\rm P}/T_0 = 3.5$  is no longer an integer,  the periodic continuation of the time section causes phase jumps,  in our example by  $\pi$.
  • The spectral range now no longer consists of two Dirac delta functions as in the sketch  (a),  but of an approximately continuous frequency function with the maximum near the actual signal frequency and a series of further parts,  which are called  »side lobes«.


Describing windowing from a system theory perspective


The occurrence of such unwanted side lobes is now to be explained using the following diagram.  This graphic was also taken from the book  [Söd93][1]

Rectangular window  $($top$)$  and Bartlett window  $($bottom$)$

First consider the upper graph  (a)  for the  »rectangular window«.

  • The time limit implicit in the DFT corresponds to the multiplication of the signal  $x(t)$  by a rectangular window function  $w(t)$  of height  $1$  and duration  $T_{\rm P}$.
  • The upper left graph shows the discrete-time representation of this rectangular function with the normalized time variable  $\nu= t/T_{\rm A}$:
$${w} (\nu) = \left\{ \begin{array}{c} 1 \\ 0 \\ \end{array} \right.\quad \begin{array}{*{10}c} {\rm{for}} \\ \\ \end{array}\begin{array}{*{20}c} -N/2 \le \nu < N/2 \hspace{0.05cm}, \\ {\rm else} \hspace{0.05cm}. \\ \end{array}$$
  • From the multiplication  $y(t) = x(t) \cdot w(t)$  of the signal  $x(t)$  to be analyzed and the window function  $w(t)$  follows for the spectral function  $Y(f) = X(f) \ast W(f)$,  where for the rectangular window with  $f_{\rm A} = 1/T_{\rm P}$  and  ${\rm si}(x) = \sin(x)/x = {\rm sinc}(x/\pi) $  holds:
$$W(f) = T_{\rm P} \cdot {\rm sinc}(f \cdot T_{\rm P}) = {1}/{f_{\rm A}}\cdot {\rm sinc}({f}/{f_{\rm A}})\hspace{0.05cm}.$$
  • The spectral function  $W(f)$  is shown logarithmically in the upper right graph.  If all spectral components of  $x(t)$  lie in the frequency grid  $\mu \cdot f_{\rm A}$,  the discrete frequency spectral values  $D(\mu )$  remain unchanged by the convolution with  $W(f)$.
  • Otherwise,  convolution with  $W(f)$  leads to distortions,  since the zeros of the  $\rm sinc$  function no longer fit the discrete values of the input spectrum.


The discontinuities in the time domain caused by limitation and periodic continuation are reduced if,  instead of the constant one weighting by the rectangle,  the two edge areas of the window are weighted weaker than the center.

Consider the graph  (b)  for the  »Bartlett window« – also called  "triangular window":

  • The discrete-time description of the Bartlett window is with  $\nu = t/T_{\rm A}$:
$${w} (\nu) = \left\{ \begin{array}{c} 1 - {2 \hspace{0.05cm} \cdot \hspace{0.05cm} |\nu|}/{N} \\ 0 \\ \end{array} \right.\quad \begin{array}{*{10}c} {\rm{for}} \\ \\ \end{array}\begin{array}{*{20}c} -N/2 \le \nu < N/2 \hspace{0.05cm}, \\ {\rm else} \hspace{0.05cm}. \\ \end{array}$$
  • From this follows for the continuous-time window function  $w(t)$  and the spectral representation  $W(f)$:
$${w} (t) = \left\{ \begin{array}{c} 1 -{|t|}/{(T_{\rm P}/2)} \\ 0 \\ \end{array} \right.\hspace{0.05cm} \begin{array}{*{20}c} |t| \le T_{\rm P}/2\\ {\rm else} \\ \end{array}\hspace{0.2cm}\circ\!\!-\!\!\!-\!\!\!-\!\!\bullet\, \hspace{0.2cm}W(f) ={1}/({2f_{\rm A}})\cdot {\rm sinc}^2( {f}/({2f_{\rm A}}))\hspace{0.05cm}.$$
  • Due to the lower weighting of the edge regions,  which are particularly problematic with unbounded signals,  the  $($logarithmically drawn$)$  spectrum  $W(f)$  has lower side lobes than the  $\rm sinc$ function in the upper graph,  which leads to lower leakage components.
  • The better suppression of the side lobes,  however,  comes at the cost of a noticeable reduction and broadening of the main lobe,  limiting the resolving power of the Bartlett window compared to rectangular windowing.


Special window functions


Hanning window,  Hamming window and Kaiser-Bessel window

Now some frequently used  »window functions«, viz.

  • the Hanning window,
  • the Hamming window,  and
  • the Kaiser-Bessel window


will be described by means of graphs and equations contained therein. 

For the running variable in the time domain always applies:

$$-N/2 ≤ \nu < N/2.$$ 




Notes:

  • In the Kaiser-Bessel window,  the functions in the time and frequency domain are each shown for  $\alpha = 3.5$.
  • Further window functions such as the  »Blackman-Harris window»,  the  »cosine rolloff window«  $($also called Tukey window$)$  and many more can be found in the book  [Söd93][1].


The suitability of these window functions for various tasks of spectral analysis is mentioned in the next section.

Quality criteria of window functions


The table shows quality criteria for the window functions described in the last sections.  The selection of a suitable window function should be made according to the following aspects:

Compilation of important quality criteria of window functions





Illustrating the  »6dB bandwidth«

  • The  »minimum distance between main lobe and side lobes«  should be as large as possible to keep the influence of the leakage effect low and to improve the amplitude resolution.
  • For reasons of good frequency selectivity,  the  »6dB bandwidth«  should be small.  If this parameter is too large,  a dominant spectral line will mask smaller components in the surrounding area.
  • The  »maximum process loss«  includes the maximum scaling error and the equivalent noise bandwidth. This value should never exceed  $\text{3.7 dB}$.


These three most important quality criteria are highlighted in red in the adjacent table.

  1. In each row,  rather favourable window functions are highlighted in green and rather unfavourable ones in grey.
  2. From the distribution of the green and grey areas it is already evident that the optimal window function does not exist.


Now the quality criteria given in the table are described in more detail:

  • The larger the  »minimum main-to-side lobe distance«   ⇒   ratio of the main lobe to the highest side lobe,  the better the amplitude resolution of a window function. 
As expected,  for the rectangle this distance is smallest  $\text{(13 dB)}$.  The best result  $\text{(92 dB)}$  is achieved with the fourth-order Blackman-Harris window.
  • However,  since not only the highest but also all other side lobes contribute to the leakage effect,  the  »side lobe drop«  is another measure for the resolving power. 
Of the given window functions,  the Hanning window and the cosine rolloff window with rolloff  $r = 0.5$  have the most favourable values in this respect  $\text{(18 dB/octave)}$.
  • The  »6 dB bandwidth«,  which can be read from the logarithmized spectral function,  is an important measure of frequency resolving. 
Two spectral components in the signal at  $f_1$  and  $f_2$  can only be resolved if the difference  $f_2 - f_1$  is greater than the  »6dB bandwidth«  of the window function used  $($see lower graph$)$.
  • The  »window area«  of the function  $w(t)$  at the same time gives the height  $W(0)$  in the spectral domain. 
For all windows except the rectangle,  $W(0)<1$  and thus a DFT amplitude error results due to the suppression of outer samples,  which,  however,  can be completely corrected if  $w(t)$  is known.


Maximum process loss


This combined quality criterion considers

  • the  »maximum scaling error«  as well as
  • the (normalized)  »equivalent noise bandwidth«. 


The maximum process loss is usually given in  $\text{dB}$  and should be  $($according to its name$)$  rather small:

$$10 \cdot {\rm lg}\hspace{0.15cm}V_{\rm P}\hspace{0.15cm}{\rm (in}\hspace{0.15cm}{\rm dB)}= 20 \cdot {\rm lg}\hspace{0.15cm} \frac{|W(f=0)|}{|W(f=f_{\rm A}/2)|} + 10 \cdot {\rm lg}\hspace{0.15cm} \frac{\int_{-\infty}^{\infty}|W(f)|^2\hspace{0.05cm}{\rm d}f}{f_{\rm A} \cdot |W(f=0)|^2} \hspace{0.05cm}.$$

From the  »table in the last section«  it can be seen that for the window functions considered  $V_{\rm P}$  takes values between  $\text{3 dB}$  and  $\text{4 dB}$,  where window functions with  $V_{\rm P} > 3. 7 \,\text{dB}$  $($rectangle,  Blackman-Harris,  Kaiser-Bessel$)$  should not be used.  However,  it is precisely these that are best with regard to the main-to-side lobe distance.

The two proportions are to be interpreted as follows:

  1. The  »maximum scaling error«  is the ratio by which the amplitude determined with the DFT differs from the actual signal amplitude.  Hereby,  the amplitude error due to a window area smaller than  $1$  is assumed to be corrected.
  2. The wider the main lobe of the window function,  the smaller this scaling error.  The error is largest when the frequency  $f_0$  of a harmonic oscillation lies midway between two DFT support points   ⇒   quotient $|W(f = 0)| / |W(f = f_{\rm A}/2)|$.
  3. The  »equivalent noise bandwidth«  of the window function is calculable as the width of the equal-area rectangle with respect to the magnitude square  $|W(f)|^2$  of the spectral function.  This parameter captures the disturbing influence of white noise and should be as small as possible.
  4. The smallest noise bandwidth results for the rectangle.  All other window functions have a larger noise bandwidth and thus,  in the presence of noise,  also a  $($significantly$)$  less favourable signal-to-noise power ratio.


$\text{The results of this section can be summarized as follows:}$ 

  • An ideal window function does not exist.  Depending on the task  $($good amplitude or frequency resolution$)$  different windows provide the best result in each case.  It is therefore recommended that one always uses several window functions for spectral analysis or at least one window function with different parameters.
  • A workable compromise with regard to all criteria is the  »Hamming window« which only gives one unfavourable value  $($»side lobe drop«  only  6 dB per octave$)$.
  • Although the  »Hanning window«  differs only marginally from the Hamming window in the time domain,  in the spectral domain  $($»minimum distance between main lobe and side lobes«)  the difference between these two windows is considerable.


Exercises for the chapter


Exercise 5.4: Comparison of Rectangular and Hanning Window

Exercise 5.4Z: On the Hanning Window


References

  1. 1.0 1.1 1.2 Söder, G.:  Modellierung, Simulation und Optimierung von Nachrichtensystemen.  In: Berlin – Heidelberg: Springer, 1993.