Difference between revisions of "Aufgaben:Exercise 5.4: Comparison of Rectangular and Hanning Window"

From LNTwww
 
(34 intermediate revisions by 6 users not shown)
Line 1: Line 1:
  
{{quiz-Header|Buchseite=*Buch*/*Kapitel*
+
{{quiz-Header|Buchseite=Signal_Representation/Spectrum_Analysis
 
}}
 
}}
  
[[File:P_ID1166__Sig_A_5_4_neu.png|250px|right|Beispiel für die Spektralanalyse (Aufgabe A5.4)]]
+
[[File:P_ID1166__Sig_A_5_4_neu.png|250px|right|frame|Examples for spectral analysis]]
  
Gegeben sei der prinzipielle Zeitverlauf x(t) eines periodischen Signals. Unbekannt sind die Parameter A1, f1, A2 und f2:
+
Let the time course of a periodic signal be given in principle:
 
   
 
   
$$x(t) & = A_1 \cdot \cos (2 \pi \cdot f_1 \cdot t)+\\ & + & A_2 \cdot \cos (2 \pi \cdot f_2 \cdot t)
+
:$$x(t)   =   A_1 \cdot \cos (2 \pi \cdot f_1 \cdot t) + A_2 \cdot \cos (2 \pi \cdot f_2 \cdot t) \hspace{0.05cm}.$$
\hspace{0.05cm}.$$
+
 
 +
Unknown and thus to be estimated are its parameters  $A_1$,  $f_1$,  $A_2$  and  $f_2$.
 +
 
 +
After weighting the signal with the window function  $w(t)$ , the product  $y(t) = x(t) \cdot w(t)$  is subjected to a  [[Signal_Representation/Discrete_Fourier_Transform_(DFT)|Discrete Fourier Transform]]  (DFT) with the parameters  $N = 512$  and  $T_{\rm P}$.  The time  $T_{\rm P}$  of the signal section to be analyzed can be set by the user as desired.
  
Nach Gewichtung des Signals mit dem Fenster w(t) wird das Produkt y(t) = x(t) · w(t) einer Diskreten Fouriertransformation (DFT) mit den Parametern N = 512 und TP unterworfen. Die Zeitdauer TP des analysierten Signalausschnitts kann vom Benutzer beliebig eingestellt werden.
+
Two functions are available for windowing, each of which is zero for  $|t| > T_{\rm P}/2$:
Für die Fensterung stehen folgende Funktionen zur Verfügung, die jeweils für |t| > TP/2 identisch 0 sind:
+
*The  '''rectangular window''':
das Rechteckfenster:
 
 
   
 
   
$${w} (\nu)  = \left\{ \begin{array}{c} 1 \\
+
:$${w} (\nu)  = \left\{ \begin{array}{c} 1 \\
 
  0 \\  \end{array} \right.\quad
 
  0 \\  \end{array} \right.\quad
\begin{array}{*{10}c}    {\rm{f\ddot{u}r}}
+
\begin{array}{*{10}c}    {\rm{for}}
 
\\    \\ \end{array}\begin{array}{*{20}c}
 
\\    \\ \end{array}\begin{array}{*{20}c}
 
-N/2 \le \nu < N/2 \hspace{0.05cm}, \\
 
-N/2 \le \nu < N/2 \hspace{0.05cm}, \\
{\rm sonst} \hspace{0.05cm}, \\
+
{\rm else} \hspace{0.05cm}, \\
 
\end{array}$$
 
\end{array}$$
 
   
 
   
$$W(f) ={1}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot
+
:$$W(f) ={1}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot
 
{f}/{f_{\rm A}})\hspace{0.05cm},$$
 
{f}/{f_{\rm A}})\hspace{0.05cm},$$
  
das Hanning–Fenster:
+
*the&nbsp; '''Hanning window''':
 
   
 
   
$${w} (\nu)  = \left\{ \begin{array}{c} 0.5 + 0.5 \cdot \cos (2 \pi \cdot \frac{\nu}{N}) \\
+
:$${w} (\nu)  = \left\{ \begin{array}{c} 0.5 + 0.5 \cdot \cos (2 \pi \cdot {\nu}/{N}) \\
 
  0 \\  \end{array} \right.\quad
 
  0 \\  \end{array} \right.\quad
\begin{array}{*{10}c}    {\rm{f\ddot{u}r}}
+
\begin{array}{*{10}c}    {\rm{for}}
 
\\    \\ \end{array}\begin{array}{*{20}c}
 
\\    \\ \end{array}\begin{array}{*{20}c}
 
-N/2 \le \nu < N/2 \hspace{0.05cm}, \\
 
-N/2 \le \nu < N/2 \hspace{0.05cm}, \\
{\rm sonst} \hspace{0.05cm}, \\
+
{\rm else} \hspace{0.05cm}, \\
 
\end{array}$$  
 
\end{array}$$  
  
$$W(f) ={0.5}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot
+
:$$W(f) ={0.5}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot
 
\frac{f}{f_{\rm A}})+ {0.25}/{f_{\rm A}}\cdot {\rm si}(\pi
 
\frac{f}{f_{\rm A}})+ {0.25}/{f_{\rm A}}\cdot {\rm si}(\pi
 
\cdot \frac{f-f_{\rm A}}{f_{\rm A}})+ {0.5}/{f_{\rm A}}\cdot
 
\cdot \frac{f-f_{\rm A}}{f_{\rm A}})+ {0.5}/{f_{\rm A}}\cdot
 
{\rm si}(\pi \cdot \frac{f+f_{\rm A}}{f_{\rm A}})\hspace{0.05cm}.$$
 
{\rm si}(\pi \cdot \frac{f+f_{\rm A}}{f_{\rm A}})\hspace{0.05cm}.$$
  
Beachten Sie, dass die Frequenzauflösung fA gleich dem Kehrwert des einstellbaren Parameters TP ist. W(f) ist die Fouriertransformierte der zeitkontinuierlichen Fensterfunktion w(t), während die oben angegebene Funktion w(ν) die zeitdiskrete Gewichtungsfunktion angibt.
+
Here, $W(f)$&nbsp; is the Fourier transform of the continuous-time window function&nbsp; $w(t)$, while&nbsp; $w(ν)$&nbsp; indicates the discrete-time weighting function.
Im Laufe der Aufgabe wird auf verschiedene Spektralfunktionen Y(f) Bezug genommen, zum Beispiel auf
+
 
 +
In the task, reference is made to various spectral functions&nbsp; $Y(f)$&nbsp; for example to
 
   
 
   
$$Y_{\rm A}(f) = 1\, {\rm V}\cdot {\rm \delta} (f \pm  1\,\,{\rm kHz})+
+
:$$Y_{\rm A}(f) = 1\, {\rm V}\cdot {\rm \delta} (f \pm  1\,\,{\rm kHz})+
 
  0.5\,\, {\rm V}\cdot {\rm \delta} (f \pm  1.125\,\,{\rm kHz})
 
  0.5\,\, {\rm V}\cdot {\rm \delta} (f \pm  1.125\,\,{\rm kHz})
 
  \hspace{0.05cm}.$$
 
  \hspace{0.05cm}.$$
  
In der obigen Grafik sind zwei weitere Spektralfunktionen YB(f) und YC(f) abgebildet, die sich ergeben, wenn ein 1 kHz–Signal mittels DFT analysiert wird und der DFT–Parameter TP = 8.5 ms ungünstig gewählt ist.
+
In the graph, two further spectral functions&nbsp; $Y_{\rm B}(f)$&nbsp; and&nbsp; $Y_{\rm C}(f)$&nbsp; are shown, which result when a&nbsp; $1 \ \text{kHz}$&nbsp; signal is analyzed by DFT and the DFT parameter&nbsp; $T_{\rm P} = 8.5 \ \text{ms}$&nbsp; is chosen unfavourably.
Für eines der Bilder ist das Rechteckfenster zugrundegelegt, für das andere das Hanning–Fenster. Nicht angegeben wird, welche Spektralfunktion zu welchem Fenster gehört.
+
 
Hinweis: Diese Aufgabe bezieht sich auf den Theorieteil von Kapitel 5.4.
+
*For one of the images the rectangular window is used, for the other the Hanning window.
 +
*It is not indicated which graph belongs to which window.
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
''Hints:''
 +
*This task belongs to the chapter&nbsp; [[Signal_Representation/Spectrum_Analysis|Spectrum Analysis]].
 +
*Note that the frequency resolution&nbsp; $f_{\rm A}$&nbsp; is equal to the reciprocal of the adjustable parameter&nbsp; $T_{\rm P}$.
 +
*Unfortunately, the indices of&nbsp; $f_{\rm A}$&nbsp; and&nbsp; $Y_{\rm A}(f)$ collide.&nbsp; It is obvious that they are not related.&nbsp; Just to be on the safe side, we point this out. 
 +
 +
 
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
  
{Welche der folgenden Aussagen treffen mit Sicherheit zu, wenn die DFT das Ausgangsspektrum YA(f) anzeigt?
+
{Which of the following statements are true with certainty when the DFT displays the output spectrum&nbsp; $Y_{\rm A}(f)$&nbsp;?
 
|type="[]"}
 
|type="[]"}
+ Zur Gewichtung wurde das Rechteckfenster verwendet.
+
+ The rectangular window was used for weighting.
- Zur Gewichtung wurde das Hanning–Fenster verwendet.
+
- The Hanning window was used for weighting.
- Es wurde der DFT–Parameter TP = 4 ms verwendet.
+
- The DFT parameter&nbsp; $T_{\rm P} = 4\ \text{ms}$&nbsp; was used.
+ Das DFT–Spektrum YA(f) ist identisch mit dem Spektrum X(f).
+
+ The DFT spectrum&nbsp; $Y_{\rm A}(f)$&nbsp; is identical to the actual spectrum&nbsp; $X(f)$.
  
{Wie lautet Y(f) bei Verwendung des Hanning–Fensters und TP = 8 ms, wenn das Eingangsspektrum X(f) = YA(f) anliegt? Geben Sie die Gewichte der Diraclinien bei f1 = 1 kHz und f2 = 1.125 kHz an.
+
{Using the Hanning window and&nbsp;  $T_{\rm P} = 8 \ \text{ms} $, what is&nbsp; $Y(f)$&nbsp; when the input spectrum&nbsp; $X(f) = Y_{\rm A}(f)$&nbsp; is applied? <br>Give the weights of the Dirac delta lines at&nbsp; $f_1= 1\ \text{kHz}$ &nbsp; &rArr; &nbsp; $G(f_1)$&nbsp; and at &nbsp; $f_2 = 1.125\ \text{kHz}$&nbsp; &rArr; &nbsp; $G(f_2)$.
 
|type="{}"}
 
|type="{}"}
$G(f_1 = 1 \text{kHz}) =$ { 0.625 3% } V
+
$G(f_1 = 1.000 \ \text{kHz})\ = \ $ { 0.625 3% } &nbsp;$\text{V}$
$G(f_1 = 1.125 \text{kHz}) =$ { 0.5 3% } V
+
$G(f_2 = 1.125 \ \text{kHz})\ = \ $ { 0.5 3% } &nbsp;$\text{V}$
  
{Wir betrachten das 1 kHz–Cosinussignal x(t). Welches Spektrum – YB(f) oder YC(f) – ergibt sich mit dem Rechteck– bzw. dem Hanning–Fenster, wenn der DFT-Parameter TP = 8.5 ms ungünstig gewählt ist?
+
{We consider the&nbsp; $1\ \text{kHz}$ cosine signal&nbsp; $x(t)$.&nbsp; Which spectrum -&nbsp; $Y_{\rm B}(f)$&nbsp; or&nbsp; $Y_{\rm C}(f)$&nbsp; results with the rectangular or the Hanning window, respectively, if the DFT parameter&nbsp;  $T_{\rm P} = 8.5 \ \text{ms}$&nbsp; is chosen unfavourably?
|type="[]"}
+
|type="()"}
- YB(f) ergibt sich bei Rechteckfensterung.
+
- $Y_{\rm B}(f)$&nbsp; results with rectangular windowing.
+ YB(f) ergibt sich mit dem Hanning-Fenster.
+
+ $Y_{\rm B}(f)$&nbsp; results with the Hanning window.
  
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''1.''' a) Bei Verwendung des Hanning–Fensters müssten zunächst 3 Diracfunktionen zu erkennen sein, auch wenn x(t) nur eine Frequenz beinhaltet es wurde das Rechteckfenster verwendet.
+
'''(1)'''&nbsp; <u>Solutions 1 and 4</u> are correct:
Mit TP = 4 ms ergibt sich für die Frequenzauflösung fA = 1/TP = 0.25 kHz. Damit liegt die Frequenz f2 nicht im vorgegebenen Raster und Y(f) würde sich aus sehr vielen Diraclinien zusammensetzen. Das heißt: die dritte Aussage ist falsch.
+
*Using the Hanning window, three Dirac functions should be recognisable even if&nbsp; $x(t)$&nbsp; contains only one frequency &nbsp; &nbsp; the rectangular window was used.
Wie aus der nachfolgenden Grafik hervorgeht, hat x(t) die Periodendauer T0 = 8 ms. Wählt man den DFT–Parameter gleich TP = 8 ms (oder ein ganzzahliges Vielfaches davon), so stimmt die periodische Fortsetzung P{x(t)} im Intervall |t| ≤ TP/2 mit x(t) überein, so dass sich die Gewichtungsfunktion w(t) nicht störend auswirkt: Das DFT–Spektrum Y(f) stimmt somit mit dem tatsächlichen Spektrum überein. Richtig sind somit die Lösungsvorschläge 1 und 4.
+
*With&nbsp; $T_{\rm P} = 4 \ \text{ms}$&nbsp;, the frequency resolution is&nbsp; $f_{\rm A}= 1/T_{\rm P} = 0.25 \ \text{kHz}$.&nbsp; Thus the frequency&nbsp; $f_2$&nbsp; does not lie in the given grid and&nbsp; $Y(f)$&nbsp; would be composed of very many Dirac delta lines.&nbsp; This means: &nbsp; the third statement is wrong.
 +
[[File:P_ID1167__Sig_A_5_4a.png|right|frame|Output signal&nbsp; $y(t)$&nbsp; with the rectangular window]]
  
[[File:P_ID1167__Sig_A_5_4a.png|250px|right|Beispielsignal 1 zur Spektralanalyse (ML zu Aufgabe A5.4)]]
+
*As can be seen from the graph,&nbsp; $x(t)$&nbsp; has the period duration&nbsp; $T_{\rm 0} = 8 \ \text{ms}$.  
 +
*If one chooses the DFT parameter equal to&nbsp; $T_{\rm P} = 4 \ \text{ms}$&nbsp; (or an integer multiple thereof), the periodic continuation&nbsp; ${\rm P}\{ x(t)\} $&nbsp;  in the interval&nbsp; $|t| \leq T_{\rm P}/2$&nbsp; coincides with&nbsp; $x(t)$&nbsp;, so that the weighting function&nbsp; $w(t)$&nbsp; has no disturbing effect.&nbsp; So:
 +
*The DFT spectrum&nbsp; $Y(f)$&nbsp; thus agrees with the actual spectrum.
  
b) Wegen TP = 8 ms setzt sich das Hanning–Spektrum W(f) aus drei Diracfunktionen bei positiven Frequenzen und drei dazu achsensymmetrischen Diracs bei negativen Frequenzen zusammen. Für die positiven Frequenzen lautet die Spektralfunktion:
+
 
 +
 
 +
'''(2)'''&nbsp; Because of&nbsp; $T_{\rm 0} = 8 \ \text{ms}$&nbsp;, the Hanning spectrum&nbsp; $W(f)$&nbsp;
 +
*consists of three Dirac functions at positive frequencies
 +
*and three axisymmetrical Diracs at negative frequencies
 +
 
 +
 
 +
are composed. For the positive frequencies, the spectral function is:
 +
[[File:P_ID1169__Sig_A_5_4b.png|right|frame|Output signal&nbsp; $y(t)$&nbsp; with the Hanning window]]
 
   
 
   
$$W(f) =0.5\cdot {\rm \delta}(f) + 0.25\cdot {\rm \delta}(f-f_{\rm A})+ 0.25\cdot {\rm \delta}(f+f_{\rm A})\hspace{0.05cm}.$$
+
:$$W(f) =0.5\cdot {\rm \delta}(f) + 0.25\cdot {\rm \delta}(f-f_{\rm A})+ 0.25\cdot {\rm \delta}(f+f_{\rm A})\hspace{0.05cm}.$$
  
Das Ausgangsspektrum ergibt sich aus der Faltung zwischen X(f) und W(f). Bei positiven Frequenzen ergeben sich nun vier Diracs mit folgenden Gewichten:
+
The output spectrum results from the convolution between&nbsp; $X(f)$&nbsp; and&nbsp; $W(f)$.&nbsp; At positive frequencies, there are now four Diracs with the following weights:
 
   
 
   
$$G(f = 0.875\,{\rm kHz}) & = & 1\, {\rm V}\cdot 0.25 = 0.250\, {\rm
+
:$$\begin{align*} G(f = 0.875\,{\rm kHz}) & = 1\, {\rm V}\cdot 0.25 = 0.250\, {\rm
 
  V}, \\
 
  V}, \\
  G(f = f_1 = 1.000\,{\rm kHz}) & = & 1\, {\rm V}\cdot 0.5 + 0.5\, {\rm V}\cdot 0.25 \hspace{0.15 cm}\underline{ = 0.625\, {\rm
+
  G(f = f_1 = 1.000\,{\rm kHz}) & = 1\, {\rm V}\cdot 0.5 + 0.5\, {\rm V}\cdot 0.25 \hspace{0.15 cm}\underline{ = 0.625\, {\rm
 
  V}}, \\
 
  V}}, \\
  G(f = f_2 = 1.125\,{\rm kHz}) & = & 1\, {\rm V}\cdot 0.25 + 0.5\, {\rm V}\cdot 0.5  \hspace{0.15 cm}\underline{= 0.500\, {\rm
+
  G(f = f_2 = 1.125\,{\rm kHz}) & = 1\, {\rm V}\cdot 0.25 + 0.5\, {\rm V}\cdot 0.5  \hspace{0.15 cm}\underline{= 0.500\, {\rm
 
  V}}, \\
 
  V}}, \\
  G(f = 1.250\,{\rm kHz}) & = & 0.5\, {\rm V}\cdot 0.25 = 0.125\, {\rm
+
  G(f = 1.250\,{\rm kHz}) & = 0.5\, {\rm V}\cdot 0.25 = 0.125\, {\rm
 
  V}
 
  V}
  \hspace{0.05cm}.$$
+
  \hspace{0.05cm}.\end{align*}$$
 +
 
 +
The graph shows the attenuation of the edges by the weighting function&nbsp; $w(t)$&nbsp; of the Hanning window.
  
Die folgende Grafik zeigt die Abschwächung der Ränder durch die Gewichtungsfunktion w(t) des Hanning–Fensters.
 
  
[[File:P_ID1169__Sig_A_5_4b.png|250px|right|Beispielsignal 2 zur Spektralanalyse (ML zu Aufgabe A5.4)]]
+
'''(3)'''&nbsp; <u> Solution 2</u> is correct:
c)  Das Rechteck–Fenster liefert dann ein sehr stark verfälschtes Ergebnis, wenn die Fensterbreite TP (wie hier) nicht an die Frequenz des Cosinussignals angepasst ist. In diesem Fall ist das Hanning–Fenster besser geeignet. Daraus folgt: Richtig ist der zweite Lösungsvorschlag.
+
*The rectangular window delivers a very strongly distorted result if the window width&nbsp; $T_{\rm P}$&nbsp; (as here) is not adapted to the cosine frequency.
 +
*In this case, the Hanning window is more suitable.&nbsp; Then the measured spectrum&nbsp; $Y_{\rm B}(f)$ results.
 +
* From the spectrum&nbsp; $Y_{\rm C}(f)$&nbsp; the searched $1\ \rm kHz$ line is more difficult to detect.&nbsp; The spectrum&nbsp; $Y_{\rm C}(f)$&nbsp; results after rectangular windowing.  
 
{{ML-Fuß}}
 
{{ML-Fuß}}
  
 
__NOEDITSECTION__
 
__NOEDITSECTION__
[[Category:Aufgaben zu Signaldarstellung|^4. Bandpassartige Signale^]]
+
[[Category:Signal Representation: Exercises|^5.4 Spectrum Analysis^]]

Latest revision as of 14:24, 18 January 2023

Examples for spectral analysis

Let the time course of a periodic signal be given in principle:

$$x(t) = A_1 \cdot \cos (2 \pi \cdot f_1 \cdot t) + A_2 \cdot \cos (2 \pi \cdot f_2 \cdot t) \hspace{0.05cm}.$$

Unknown and thus to be estimated are its parameters  $A_1$,  $f_1$,  $A_2$  and  $f_2$.

After weighting the signal with the window function  $w(t)$ , the product  $y(t) = x(t) \cdot w(t)$  is subjected to a  Discrete Fourier Transform  (DFT) with the parameters  $N = 512$  and  $T_{\rm P}$.  The time  $T_{\rm P}$  of the signal section to be analyzed can be set by the user as desired.

Two functions are available for windowing, each of which is zero for  $|t| > T_{\rm P}/2$:

  • The  rectangular window:
$${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}$$
$$W(f) ={1}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot {f}/{f_{\rm A}})\hspace{0.05cm},$$
  • the  Hanning window:
$${w} (\nu) = \left\{ \begin{array}{c} 0.5 + 0.5 \cdot \cos (2 \pi \cdot {\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}$$
$$W(f) ={0.5}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot \frac{f}{f_{\rm A}})+ {0.25}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot \frac{f-f_{\rm A}}{f_{\rm A}})+ {0.5}/{f_{\rm A}}\cdot {\rm si}(\pi \cdot \frac{f+f_{\rm A}}{f_{\rm A}})\hspace{0.05cm}.$$

Here, $W(f)$  is the Fourier transform of the continuous-time window function  $w(t)$, while  $w(ν)$  indicates the discrete-time weighting function.

In the task, reference is made to various spectral functions  $Y(f)$  for example to

$$Y_{\rm A}(f) = 1\, {\rm V}\cdot {\rm \delta} (f \pm 1\,\,{\rm kHz})+ 0.5\,\, {\rm V}\cdot {\rm \delta} (f \pm 1.125\,\,{\rm kHz}) \hspace{0.05cm}.$$

In the graph, two further spectral functions  $Y_{\rm B}(f)$  and  $Y_{\rm C}(f)$  are shown, which result when a  $1 \ \text{kHz}$  signal is analyzed by DFT and the DFT parameter  $T_{\rm P} = 8.5 \ \text{ms}$  is chosen unfavourably.

  • For one of the images the rectangular window is used, for the other the Hanning window.
  • It is not indicated which graph belongs to which window.





Hints:

  • This task belongs to the chapter  Spectrum Analysis.
  • Note that the frequency resolution  $f_{\rm A}$  is equal to the reciprocal of the adjustable parameter  $T_{\rm P}$.
  • Unfortunately, the indices of  $f_{\rm A}$  and  $Y_{\rm A}(f)$ collide.  It is obvious that they are not related.  Just to be on the safe side, we point this out.


Questions

1

Which of the following statements are true with certainty when the DFT displays the output spectrum  $Y_{\rm A}(f)$ ?

The rectangular window was used for weighting.
The Hanning window was used for weighting.
The DFT parameter  $T_{\rm P} = 4\ \text{ms}$  was used.
The DFT spectrum  $Y_{\rm A}(f)$  is identical to the actual spectrum  $X(f)$.

2

Using the Hanning window and  $T_{\rm P} = 8 \ \text{ms} $, what is  $Y(f)$  when the input spectrum  $X(f) = Y_{\rm A}(f)$  is applied?
Give the weights of the Dirac delta lines at  $f_1= 1\ \text{kHz}$   ⇒   $G(f_1)$  and at   $f_2 = 1.125\ \text{kHz}$  ⇒   $G(f_2)$.

$G(f_1 = 1.000 \ \text{kHz})\ = \ $

 $\text{V}$
$G(f_2 = 1.125 \ \text{kHz})\ = \ $

 $\text{V}$

3

We consider the  $1\ \text{kHz}$ cosine signal  $x(t)$.  Which spectrum -  $Y_{\rm B}(f)$  or  $Y_{\rm C}(f)$  – results with the rectangular or the Hanning window, respectively, if the DFT parameter  $T_{\rm P} = 8.5 \ \text{ms}$  is chosen unfavourably?

$Y_{\rm B}(f)$  results with rectangular windowing.
$Y_{\rm B}(f)$  results with the Hanning window.


Solution

(1)  Solutions 1 and 4 are correct:

  • Using the Hanning window, three Dirac functions should be recognisable even if  $x(t)$  contains only one frequency   ⇒   the rectangular window was used.
  • With  $T_{\rm P} = 4 \ \text{ms}$ , the frequency resolution is  $f_{\rm A}= 1/T_{\rm P} = 0.25 \ \text{kHz}$.  Thus the frequency  $f_2$  does not lie in the given grid and  $Y(f)$  would be composed of very many Dirac delta lines.  This means:   the third statement is wrong.
Output signal  $y(t)$  with the rectangular window
  • As can be seen from the graph,  $x(t)$  has the period duration  $T_{\rm 0} = 8 \ \text{ms}$.
  • If one chooses the DFT parameter equal to  $T_{\rm P} = 4 \ \text{ms}$  (or an integer multiple thereof), the periodic continuation  ${\rm P}\{ x(t)\} $  in the interval  $|t| \leq T_{\rm P}/2$  coincides with  $x(t)$ , so that the weighting function  $w(t)$  has no disturbing effect.  So:
  • The DFT spectrum  $Y(f)$  thus agrees with the actual spectrum.


(2)  Because of  $T_{\rm 0} = 8 \ \text{ms}$ , the Hanning spectrum  $W(f)$ 

  • consists of three Dirac functions at positive frequencies
  • and three axisymmetrical Diracs at negative frequencies


are composed. For the positive frequencies, the spectral function is:

Output signal  $y(t)$  with the Hanning window
$$W(f) =0.5\cdot {\rm \delta}(f) + 0.25\cdot {\rm \delta}(f-f_{\rm A})+ 0.25\cdot {\rm \delta}(f+f_{\rm A})\hspace{0.05cm}.$$

The output spectrum results from the convolution between  $X(f)$  and  $W(f)$.  At positive frequencies, there are now four Diracs with the following weights:

$$\begin{align*} G(f = 0.875\,{\rm kHz}) & = 1\, {\rm V}\cdot 0.25 = 0.250\, {\rm V}, \\ G(f = f_1 = 1.000\,{\rm kHz}) & = 1\, {\rm V}\cdot 0.5 + 0.5\, {\rm V}\cdot 0.25 \hspace{0.15 cm}\underline{ = 0.625\, {\rm V}}, \\ G(f = f_2 = 1.125\,{\rm kHz}) & = 1\, {\rm V}\cdot 0.25 + 0.5\, {\rm V}\cdot 0.5 \hspace{0.15 cm}\underline{= 0.500\, {\rm V}}, \\ G(f = 1.250\,{\rm kHz}) & = 0.5\, {\rm V}\cdot 0.25 = 0.125\, {\rm V} \hspace{0.05cm}.\end{align*}$$

The graph shows the attenuation of the edges by the weighting function  $w(t)$  of the Hanning window.


(3)  Solution 2 is correct:

  • The rectangular window delivers a very strongly distorted result if the window width  $T_{\rm P}$  (as here) is not adapted to the cosine frequency.
  • In this case, the Hanning window is more suitable.  Then the measured spectrum  $Y_{\rm B}(f)$ results.
  • From the spectrum  $Y_{\rm C}(f)$  the searched $1\ \rm kHz$ line is more difficult to detect.  The spectrum  $Y_{\rm C}(f)$  results after rectangular windowing.