Difference between revisions of "Signal Representation/Possible Errors when using DFT"

From LNTwww
Line 1: Line 1:
 
   
 
   
 
{{Header
 
{{Header
|Untermenü=Zeit- und frequenzdiskrete Signaldarstellung
+
|Untermenü=Time and Frequency-Discrete Signal Representation
|Vorherige Seite=Diskrete Fouriertransformation (DFT)
+
|Vorherige Seite=Discrete Fourier Transform (DFT)
|Nächste Seite=Spektralanalyse
+
|Nächste Seite=Spectrum Analysis
 
}}
 
}}
  
==Der mittlere quadratische Fehler als Qualitätskriterium==
+
==The Mean Square Error As a Quality Criteria==
 
<br>
 
<br>
Im Folgenden werden einige Fehlermöglichkeiten bei Anwendung der DFT kurz diskutiert, wobei wir uns auf die Transformation vom Zeit– in den Frequenzbereich beschränken. Auch in seinen Abtastwerten wird sich im Allgemeinen das über die DFT ermittelte Spektrum&nbsp; $D(\mu )/f_{\rm A}$&nbsp; vom tatsächlichen Spektrum&nbsp; $X(\mu \cdot f_{\rm A})$&nbsp; unterscheiden, was auf zwei Prozesse zurückzuführen ist:
+
In the following, we briefly discuss some error possibilities when applying the DFT, whereby we restrict ourselves to the transformation from the time to the frequency domain. Even in its samples, the spectrum&nbsp; $D(\mu )/f_{\rm A}$&nbsp; determined via the DFT will generally differ from the actual spectrum&nbsp; $X(\mu \cdot f_{\rm A})$&nbsp; due to two processes:
*die&nbsp; '''Abtastung''', also die Reduzierung der Information über&nbsp; $x(t)$&nbsp; auf&nbsp; $N$&nbsp; Zahlenwerte,
+
*the&nbsp; '''sampling''', that is, the reduction of information about&nbsp; $x(t)$&nbsp; to&nbsp; $N$&nbsp; numerical values,
*die&nbsp; '''Fensterung''', die das Signal&nbsp; $x(t)$&nbsp; eventuell fälschlicherweise begrenzt.
+
*the&nbsp; '''windowing''' that limits the signal&nbsp; $x(t)$&nbsp; possibly erroneously.
  
  
 
{{BlaueBox|TEXT=
 
{{BlaueBox|TEXT=
 
$\text{Definition:}$&nbsp;
 
$\text{Definition:}$&nbsp;
Ein Gütekriterium, das beide Fehlerarten berücksichtigt, ist der&nbsp; '''mittlere quadratische Fehler''':
+
A quality criteria that takes both types of error into account is the&nbsp; '''mean square error''':
 
   
 
   
 
:$${\rm MQF} =  \frac{1}{N}\cdot \sum_{\mu = 0 }^{N-1}
 
:$${\rm MQF} =  \frac{1}{N}\cdot \sum_{\mu = 0 }^{N-1}
 
  \left\vert X(\mu \cdot f_{\rm A})-\frac{D(\mu)}{f_{\rm A} }\right \vert^2 \hspace{0.05cm}.$$
 
  \left\vert X(\mu \cdot f_{\rm A})-\frac{D(\mu)}{f_{\rm A} }\right \vert^2 \hspace{0.05cm}.$$
  
Es ist stets&nbsp; ${\rm MQF} \ne 0$, da sich bei endlichem&nbsp; $N$&nbsp; nicht gleichzeitig die Degradation durch die Abtastung und durch die Fensterung zu Null machen lassen.}}  
+
It is always&nbsp; ${\rm MQF} \ne 0$, since with finite&nbsp; $N$&nbsp; degradation due to sampling and due to windowing cannot be made zero at the same time}}.
  
  
Die Größe dieser Bewertungsgröße&nbsp; ${\rm MQF}$&nbsp; hängt von folgenden Parametern ab:
+
The magnitude of this evaluation quantity&nbsp; ${\rm MQF}$&nbsp; depends on the following parameters:
*den Eigenschaften der vorliegenden Zeitfunktion&nbsp; $x(t)$&nbsp; bzw. des Spektrums&nbsp; $X(f)$,
+
*the properties of the time function at hand&nbsp; $x(t)$&nbsp; or the spectrum&nbsp; $X(f)$,
*dem DFT–Parameter&nbsp; $N$;&nbsp; je größer&nbsp; $N$&nbsp; gewählt wird, umso kleiner wird&nbsp; ${\rm MQF}$,
+
*the DFT parameter&nbsp; $N$;&nbsp; the larger&nbsp; $N$&nbsp; is chosen, the smaller&nbsp; ${\rm MQF}$ becomes,
*einem der vier weiteren DFT–Parameter, zum Beispiel&nbsp; $f_{\rm A}$.  
+
*one of the four further DFT parameters, for example&nbsp; $f_{\rm A}$.  
  
  
Die weiteren DFT–Parameter sind bei gegebenem&nbsp; $N$&nbsp; über die Gleichungen&nbsp; $f_{\rm P} = N \cdot f_{\rm A}$,&nbsp; $T_{\rm P} = 1/f_{\rm A}$&nbsp; und&nbsp; $T_{\rm A} = T_{\rm P}/N$&nbsp; festgelegt.
+
For a given&nbsp; $N$&nbsp; the other DFT parameters are determined via the equations&nbsp; $f_{\rm P} = N \cdot f_{\rm A}$,&nbsp; $T_{\rm P} = 1/f_{\rm A}$&nbsp; and&nbsp; $T_{\rm A} = T_{\rm P}/N$&nbsp;.
  
Wir weisen Sie bereits hier auf das Lernvideo&nbsp; [[Fehlermöglichkeiten_bei_Anwendung_der_DFT_(Lernvideo)|Fehlermöglichkeiten bei Anwendung der DFT]]&nbsp; hin, das den Inhalt dieses Kapitels verdeutlicht.  
+
We refer you already here to the learning video (in German language) &nbsp; [[Fehlermöglichkeiten_bei_Anwendung_der_DFT_(Lernvideo)|Possible Errors When Using DFT]]&nbsp;, which clarifies the content of this chapter.  
  
  
[[File:EN_Sig_T_5_1_S1.png|right|frame|Quasi-fehlerfreie DFT mit&nbsp; $N = 16$]]
+
[[File:EN_Sig_T_5_1_S1.png|right|frame|Quasi-Error-Free DFT with &nbsp; $N = 16$]]
 
{{GraueBox|TEXT=
 
{{GraueBox|TEXT=
$\text{Beispiel 1:}$&nbsp;
+
$\text{Example 1:}$&nbsp;
Wir betrachten beispielhaft einen Gaußimpuls mit der äquivalenten Impulsdauer&nbsp; $\Delta t = T$, wobei&nbsp; $T$&nbsp; gleichzeitig als Normierungsparameter verwendet wird:
+
As an example, we consider a Gaussian pulse with the equivalent pulse duration&nbsp; $\Delta t = T$, where&nbsp; $T$&nbsp; is simultaneously used as a normalisation parameter:
 
   
 
   
 
:$$x(t) = {\rm e}^{- \pi (t/T)^2} \hspace{0.05cm}.$$
 
:$$x(t) = {\rm e}^{- \pi (t/T)^2} \hspace{0.05cm}.$$
  
Der Gaußimpuls eignet sich aufgrund des schnellen, exponentiellen Abklingens sowohl im Zeit– als auch im Frequenzbereich sehr gut für die Anwendung der DFT.  
+
The Gaussian pulse is very suitable for the application of DFT due to its fast, exponential decay in both the time and frequency domain.  
  
Die untere Grafik zeigt das DFT&ndash;Ergebnis
+
The graph below shows the DFT&ndash;result
*für&nbsp; $N = 16$&nbsp; und
+
*for&nbsp; $N = 16$&nbsp; and
 
*$T_{\rm A}/T = 0.25$ &nbsp; &rArr; &nbsp; $f_{\rm A} \cdot T = 0.25$.
 
*$T_{\rm A}/T = 0.25$ &nbsp; &rArr; &nbsp; $f_{\rm A} \cdot T = 0.25$.
 
<br clear=all>
 
<br clear=all>
Zu dieser Darstellung ist Folgendes anzumerken:
+
The following should be noted about this plot:
*Die berücksichtigten Abtastwerte von&nbsp; $x(t)$&nbsp; liegen im Bereich&nbsp; $\vert t/T \vert≤ 2$.&nbsp; Da&nbsp; $x(\pm 2T)$&nbsp; sehr klein ist, führt die Periodifizierung im Zeitbereich mit&nbsp; $T_{\rm P}/T = N \cdot T_{\rm A}/T = 2$&nbsp; zu keinen gravierenden Fehlern.
+
*The considered samples of&nbsp; $x(t)$&nbsp; are in the range&nbsp; $\vert t/T \vert≤ 2$.&nbsp; Since&nbsp; $x(\pm 2T)$&nbsp; is very small, periodization in the time domain with&nbsp; $T_{\rm P}/T = N \cdot T_{\rm A}/T = 2$&nbsp; does not lead to serious errors.
*Mit&nbsp; $f_{\rm A} \cdot T = 0.25$&nbsp; sowie&nbsp; $N = 16$&nbsp; ergibt sich der (normierte) DFT–Parameter&nbsp; $f_{\rm P} \cdot T = 4$.  
+
*With&nbsp; $f_{\rm A} \cdot T = 0.25$&nbsp; and&nbsp; $N = 16$&nbsp; results in the (normalised) DFT parameter&nbsp; $f_{\rm P} \cdot T = 4$.  
*Die diskreten Spektrallinien der DFT liegen somit im Bereich&nbsp; $–2/T ≤ f < +2/T$.
+
*The discrete spectral lines of the DFT thus lie in the range&nbsp; $-2/T ≤ f < +2/T$.
*Der mittlere quadratrische Fehler ist relativ klein&nbsp; $\text{(MQF} \approx 10^{–12})$, was auf die günstige Wahl von&nbsp; $f_{\rm A} \cdot T = 0.25$&nbsp; $($bei gegebenem&nbsp; $N = 16)$&nbsp; zurückzuführen ist.
+
*The mean squared error is relatively small&nbsp; $\text{(MQF} \approx 10^{-12})$, which is due to the favourable choice of&nbsp; $f_{\rm A} \cdot T = 0.25$&nbsp; $($for a given&nbsp; $N = 16)$&nbsp;.
*Die DFT–Genauigkeit kann durch Vergrößerung von&nbsp; $N$&nbsp; verbessert werden:  
+
*The DFT accuracy can be improved by increasing&nbsp; $N$&nbsp;:  
:*Für&nbsp; $N = 1024$&nbsp; erhält man den kleinstmöglichen Wert&nbsp; $\text{MQF} \approx 8 \cdot 10^{–17}$, wenn&nbsp; $f_{\rm A} \cdot T = 0.125$&nbsp; gewählt wird. Für die weiteren DFT–Parameter gilt dann:
+
:*For&nbsp; $N = 1024$&nbsp; the smallest possible value is obtained&nbsp; $\text{MQF} \approx 8 \cdot 10^{-17}$, if&nbsp; $f_{\rm A} \cdot T = 0.125$&nbsp; is chosen. The following then applies to the other DFT parameters:
:: $$f_{\rm P} \cdot T = 128, \hspace{0.5cm}T_{\rm A}/T = 1/128, \hspace{0.5cm} T_{\rm P}/T = N \cdot T_{\rm A}/T= 8.$$
+
:: $$f_{\rm P} \cdot T = 128, \hspace{0.5cm}T_{\rm A}/T = 1/128, \hspace{0.5cm} T_{\rm P}/T = N \cdot T_{\rm A}/T= 8.$$
:*Bei einem 32&ndash;Bit&ndash;Prozessor (das bedeutet:&nbsp; kleinere Quantisierungsfehler des Rechners)&nbsp; wäre&nbsp; $\text{MQF}$&nbsp; noch kleiner, aber niemals Null. }}
+
:*For a 32&ndash;bit&ndash;processor (meaning:&nbsp; smaller quantization errors of the computer)&nbsp; $\text{MQF}$&nbsp; would be even smaller, but never zero. }}
  
  
==DFT-Verfälschung durch Fensterung &ndash; Abbruchfehler==
+
==DFT Falsification Due to Windowing &ndash; Termination Error==
 
<br>
 
<br>
Ein typischer Fehler bei Anwendung der DFT ist auf die&nbsp; '''Fensterung'''&nbsp; zurückzuführen. Diese als&nbsp; ''Abbruchfehler''&nbsp; bekannte Verfälschung lässt sich folgendermaßen erklären:
+
A typical error when using the DFT is due to&nbsp; '''windowing''''&nbsp;. This falsification, known as&nbsp; ''truncation error''&nbsp; can be explained as follows:
*Die im DFT–Algorithmus implizit enthaltene Fensterung entspricht der Multiplikation des Signals&nbsp; $x(t)$ mit&nbsp; einer Rechteckfunktion der Höhe&nbsp; $1$&nbsp; und der Dauer&nbsp; $T_{\rm P} = N \cdot T_{\rm A}$.
+
*The windowing implicit in the DFT algorithm corresponds to the multiplication of the signal&nbsp; $x(t)$ by&nbsp; a rectangular function of height&nbsp; $1$&nbsp; and duration&nbsp; $T_{\rm P} = N \cdot T_{\rm A}$.
*Ist das Zeitsignal&nbsp; $x(t)$&nbsp; nicht auf den Bereich&nbsp; $T_{\rm P}$&nbsp; begrenzt, so stimmt das DFT–Ergebnis nicht mit dem tatsächlichen Spektrum&nbsp; $X(f)$&nbsp; überein, sondern ergibt sich aus diesem durch Faltung mit der Spektralfunktion&nbsp; $T_{\rm P} \cdot \text{si}(\pi fT_{\rm P})$.
+
*If the time signal&nbsp; $x(t)$&nbsp; is not limited to the range&nbsp; $T_{\rm P}$&nbsp; the DFT result does not coincide with the actual spectrum&nbsp; $X(f)$&nbsp; but is obtained from it by convolution with the spectral function&nbsp; $T_{\rm P} \cdot \text{si}(\pi fT_{\rm P})$.
*Im Grenzfall&nbsp; $T_{\rm P} \to \infty$, was bei gegebenem Abstand&nbsp; $T_{\rm A}$&nbsp; der Abtastwerte auch eine unendlich große Stützstellenzahl&nbsp; $N$&nbsp; bedeuten würde, entartet&nbsp; $T_{\rm P} \cdot \text{si}(\pi fT_{\rm P})$&nbsp; zu einer Diracfunktion und das Originalspektrum&nbsp; $X(f)$&nbsp; bliebe erhalten.
+
*In the limiting case&nbsp; $T_{\rm P} \to \infty$, which for a given distance&nbsp; $T_{\rm A}$&nbsp; of the samples would also mean an infinitely large number of interpolation points&nbsp; $N$&nbsp; degenerates&nbsp; $T_{\rm P} \cdot \text{si}(\pi fT_{\rm P})$&nbsp; to a Dirac function and the original spectrum&nbsp; $X(f)$&nbsp; would remain.
*Die DFT eines zeitlich unbegrenzten Signals – zum Beispiel eines periodischen Signals – wird immer einen Abbruchfehler hervorrufen, der nur durch besondere Maßnahmen in Grenzen gehalten werden kann. Hierauf wird im Kapitel&nbsp; [[Signal_Representation/Spectrum_Analysis|Spektralanalyse]]&nbsp; näher eingegangen.
+
*The DFT of an unbounded signal in time - for example a periodic signal - will always cause a truncation error which can only be kept within limits by special measures. This is discussed in more detail in the chapter&nbsp; [[Signal_Representation/Spectrum_Analysis|spectrum analysis]]&nbsp;.
*Bei zeitlich begrenzten, impulsartigen Signalen lässt sich der Abbruchfehler vermeiden, wenn man&nbsp; $T_{\rm P}$&nbsp; hinreichend groß wählt. Durch weitere Vergrößerung des Fensters in Bereiche mit&nbsp; $x(t) \approx 0$&nbsp; ergibt sich kein zusätzlicher Informationsgewinn  &nbsp; ⇒ &nbsp; $\text{MQF}$&nbsp; wird nicht kleiner.
+
*For time-limited, pulse-like signals, the truncation error can be avoided by choosing&nbsp; $T_{\rm P}$&nbsp; sufficiently large. By further enlarging the window into areas with&nbsp; $x(t) \approx 0$&nbsp; no additional information gain results &nbsp; ⇒ &nbsp; $\text{MQF}$&nbsp; does not become smaller.
*Durch dieses Anfügen von Nullen&nbsp; '''(zero–padding)'''&nbsp; treten nun die Abtastwerte von&nbsp; $X(f)$&nbsp; in kleinerem Abstand&nbsp; $f_{\rm A} = 1/T_{\rm A}$&nbsp; auf. Durch&nbsp; $T_{\rm P}$–Verdopplung erreicht man eine Interpolation der Frequenzabtastwerte genau in der Mitte zwischen zwei vorherigen Stützstellen.
+
*By this addition of zeros&nbsp; '''(zero-padding)'''&nbsp; the samples of&nbsp; $X(f)$&nbsp; now occur at a smaller distance&nbsp; $f_{\rm A} = 1/T_{\rm A}$&nbsp;. By&nbsp; $T_{\rm P}$-doubling one achieves an interpolation of the frequency samples exactly in the middle between two previous grid points.
  
  
Das folgende Beispiel zeigt einen Abbruchfehler aufgrund ungünstig gewählter DFT–Parameter.
+
The following example shows a termination error due to unfavourably chosen DFT parameters.
  
[[File:EN_Sig_T_5_1_S2.png|right|frame|Abbruchfehler bei einer DFT mit&nbsp; $N = 16$]]
+
[[File:EN_Sig_T_5_1_S2.png|right|frame|Termination Error For a DFT With&nbsp; $N = 16$]]
 
{{GraueBox|TEXT=
 
{{GraueBox|TEXT=
$\text{Beispiel 2:}$&nbsp;
+
$\text{Example 2:}$&nbsp;
Die Grafik zeigt das Ergebnis der DFT für gleiches&nbsp; $x(t)$&nbsp; und&nbsp; $X(f)$&nbsp; sowie gleiches&nbsp; $N = 16$&nbsp; wie im&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#Der_mittlere_quadratische_Fehler_als_Qualit.C3.A4tskriterium|$\text{Beispiel 1}$]], aber nun mit demgegenüber um den Faktor&nbsp; $2$&nbsp; feinerer Abtastung im Zeitbereich:  
+
The graph shows the result of the DFT for equal&nbsp; $x(t)$&nbsp; and&nbsp; $X(f)$&nbsp; as well as equal&nbsp; $N = 16$&nbsp; as in&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#Der_mittlere_quadratische_Fehler_als_Qualit.C3.A4tskriterium|$\text{example 1}$]],but now with sampling in the time domain finer by a factor of&nbsp; $2$&nbsp; compared to this:  
 
:$$T_{\rm A}/T = 0.125 &nbsp; &nbsp; &rArr; &nbsp; &nbsp; f_{\rm A} \cdot T = 0.5.$$
 
:$$T_{\rm A}/T = 0.125 &nbsp; &nbsp; &rArr; &nbsp; &nbsp; f_{\rm A} \cdot T = 0.5.$$
  
Der Vergleich mit&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#Der_mittlere_quadratische_Fehler_als_Qualit.C3.A4tskriterium|Beispiel 1]]&nbsp; $(T_{\rm A}/T = 0.25 \ \Rightarrow \  f_{\rm A} \cdot T = 0.25)$&nbsp; zeigt:
+
The comparison with&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#Der_mittlere_quadratische_Fehler_als_Qualit.C3.A4tskriterium|example 1]]&nbsp; $(T_{\rm A}/T = 0.25 \ \Rightarrow \  f_{\rm A} \cdot T = 0.25)$&nbsp; shows:
*Der Abstand der  Frequenzabtastwerte wird größer:&nbsp; $f_{\rm A} \cdot T = 0.5$.
+
*The spacing of the frequency samples increases:&nbsp; $f_{\rm A} \cdot T = 0.5$.
*Gleichzeitig verringert sich&nbsp; $T_{\rm P}/T$&nbsp; von&nbsp; $4$&nbsp; auf&nbsp; $2$.
+
*At the same time, $T_{\rm P}/T$&nbsp; decreases from&nbsp; $4$&nbsp; to&nbsp; $2$.
*Damit werden nun nur noch die Signalanteile im Bereich&nbsp; $\vert t \vert < T$&nbsp; durch die DFT erfasst.
+
*With this, only the signal components in the range&nbsp; $\vert t \vert < T$&nbsp; are now captured by the DFT.
  
  
'''Zusammengefasst:''' <br>Mit diesen DFT–Parametern entsteht ein&nbsp; '''Abbruchfehler''', durch den der mittlere quadratische Fehler&nbsp; $\rm (MQF)$&nbsp; signifikant von&nbsp; $10^{-12}$ auf $4 \cdot 10^{-5}$&nbsp; vergrößert wird.  
+
'''Summing up:''' <br>With these DFT parameters, a&nbsp; '''truncation error''' arises, by which the mean square error&nbsp; $\rm (MQF)$&nbsp; is significantly increased from&nbsp; $10^{-12}$ to $4 \cdot 10^{-5}$&nbsp;.  
  
  
Wir verweisen nochmals auf das Lernvideo <br>[[Fehlermöglichkeiten_bei_Anwendung_der_DFT_(Lernvideo)|Fehlermöglichkeiten bei Anwendung der DFT]]. }}
+
Again, we refer to the learning video (in German language) <br>[[Fehlermöglichkeiten_bei_Anwendung_der_DFT_(Lernvideo)|Possible Errors When Using DFT]]. }}
  
  
  
==DFT-Verfälschung durch Abtastung &ndash; Aliasingfehler==
+
==DFT Falsification Due To Sampling &ndash; Aliasing Error==
 
<br>
 
<br>
Auch eine ungeeignete Abtastung der Zeitfunktion&nbsp; $x(t)$&nbsp; kann das DFT–Ergebnis signifikant verfälschen. Dieser so genannte&nbsp; '''Aliasingfehler'''&nbsp; lässt sich wie folgt erklären:
 
*Die Abtastung von&nbsp; $x(t)$&nbsp; im Abstand&nbsp; $T_{\rm A}$&nbsp; bewirkt eine periodische Fortsetzung des Spektrums bei Vielfachen der Periodisierungsfrequenz&nbsp; $f_{\rm P} = 1/T_{\rm A}$.
 
*Besitzt das Spektrum&nbsp; $X(f)$&nbsp; auch Spektralanteile bei&nbsp; $|f| > f_{\rm P}/2$, so ist das Abtasttheorem nicht erfüllt und es kommt zu Überlappungen der zu addierenden, verschobenen Frequenzanteile.
 
*Nur bei bandbegrenztem Signal kann der Aliasingfehler durch geeignete DFT–Parameter vermieden werden. Dagegen ist bei zeitlich begrenzten, impulsartigen Signalen dieser Fehler unvermeidbar, da zeitbegrenzte Signale nicht gleichzeitig bandbegrenzt sein können.
 
*Der Aliasingfehler wird durch eine feinere Abtastung&nbsp; $($also: &nbsp; kleineres&nbsp; $T_{\rm A} = 1/f_{\rm P})$&nbsp; kleiner. Dies erreicht man bei gleichbleibendem&nbsp; $T_{\rm A}$&nbsp; – um den Abbruchfehler nicht anwachsen zu lassen – allerdings nur durch ein größeres&nbsp; $N$&nbsp; und damit einen größeren Rechenaufwand.
 
  
 +
An unsuitable sampling of the time function&nbsp; $x(t)$&nbsp; can also significantly falsify the DFT result. This so-called&nbsp; '''aliasing error'''&nbsp; can be explained as follows:
 +
*Sampling&nbsp; $x(t)$&nbsp; at a distance&nbsp; $T_{\rm A}$&nbsp; causes a periodic continuation of the spectrum at multiples of the periodisation frequency&nbsp; $f_{\rm P} = 1/T_{\rm A}$.
 +
*If the spectrum&nbsp; $X(f)$&nbsp; also has spectral components at&nbsp; $|f| > f_{\rm P}/2$, the sampling theorem is not fulfilled and overlaps of the shifted frequency components to be added occur.
 +
*Only with a band-limited signal can the aliasing error be avoided by suitable DFT parameters. In contrast, this error is unavoidable with time-limited, pulse-like signals, since time-limited signals cannot be band-limited at the same time.
 +
*The aliasing error is reduced by finer sampling&nbsp; $($so: &nbsp; smaller&nbsp; $T_{\rm A} = 1/f_{\rm P})$&nbsp;. This can only be achieved with a constant&nbsp; $T_{\rm A}$&nbsp; - in order not to let the truncation error increase - by a larger&nbsp; $N$&nbsp; and thus a greater computational effort.
  
Das folgende&nbsp; $\text{Beispiel 3}$&nbsp; zeigt einen solchen Aliasingfehler aufgrund falsch gewählter DFT–Parameter:
 
*Gegenüber dem &bdquo;Vergleichssystem&rdquo; gemäß&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#Der_mittlere_quadratische_Fehler_als_Qualit.C3.A4tskriterium|$\text{Beispiel 1}$]]&nbsp;  ist&nbsp; $T_{\rm A}$&nbsp; zu groß und&nbsp; $f_{\rm A}$&nbsp; zu klein dimensioniert.
 
*Die Stützstellenanzahl ist in beiden Fällen&nbsp; $N = 16$.
 
  
 +
The following&nbsp; $\text{Example 3}$&nbsp; shows such an aliasing error due to wrongly chosen DFT parameters:
 +
*Compared to the &bdquo;comparison system&rdquo; according to&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#Der_mittlere_quadratische_Fehler_als_Qualit.C3.A4tskriterium|$\text{example 1}$]]&nbsp;  is&nbsp; $T_{\rm A}$&nbsp; too large and&nbsp; $f_{\rm A}$&nbsp; too small dimensioned.
 +
*The number of interpolation points is in both cases&nbsp; $N = 16$.
  
[[File:EN_Sig_T_5_1_S3._neu.png|right|frame|Aliasingfehler bei einer DFT mit&nbsp; $N = 16$]]
+
 
 +
[[File:EN_Sig_T_5_1_S3._neu.png|right|frame|Aliasing Error of a  DFT With&nbsp; $N = 16$]]
 
{{GraueBox|TEXT=
 
{{GraueBox|TEXT=
$\text{Beispiel 3:}$&nbsp;
+
$\text{Example 3:}$&nbsp;
Die DFT–Parameter seien&nbsp; $N = 16$&nbsp; und&nbsp; $f_{\rm A} \cdot T= 0.125$. Somit ergibt sich für die drei anderen DFT–Parameter:
+
Let the DFT parameters be&nbsp; $N = 16$&nbsp; and&nbsp; $f_{\rm A} \cdot T= 0.125$. Thus, for the other three DFT parameters we get:
* $T_{\rm P}/T = 8.0 \hspace{0.5cm} \text{(Beispiel 1:} \ \ T_{\rm P}/T = 4)$,
+
* $T_{\rm P}/T = 8.0 \hspace{0.5cm} \text{(Example 1:} \ \ T_{\rm P}/T = 4)$,
* $f_{\rm P} \cdot T = 2.0 \hspace{0.45cm} \text{(Beispiel 1:} \ \ f_{\rm P} \cdot T = 4)$,
+
* $f_{\rm P} \cdot T = 2.0 \hspace{0.45cm} \text{(Example 1:} \ \ f_{\rm P} \cdot T = 4)$,
* $T_{\rm A}/T = 0.5\hspace{0.45cm} \text{(Beispiel 1:} \ \ T_{\rm A}/T = 0.25)$.
+
* $T_{\rm A}/T = 0.5\hspace{0.45cm} \text{(Example 1:} \ \ T_{\rm A}/T = 0.25)$.
  
  
Daraus ergeben sich folgende Konsequenzen:
+
This results in the following consequences:
*Der Abbruchfehler spielt wegen&nbsp; $T_{\rm P} /T = 8$&nbsp; weiterhin keine Rolle (schon&nbsp; $T_{\rm P} /T = 4$&nbsp; war ausreichend).
+
*The termination error continues to play no role because of&nbsp; $T_{\rm P} /T = 8$&nbsp; (already&nbsp; $T_{\rm P} /T = 4$&nbsp; was sufficient).
*Wegen&nbsp; $f_{\rm P}  \cdot T = 2$&nbsp; entsteht nun allerdings Aliasing, weil die DFT von der Summe vieler Gaußfunktionen im Abstand&nbsp; $f_{\rm P}  \cdot T = 2$&nbsp; ausgeht (dünn gestrichelte Kurven in der Grafik ).
+
*Because&nbsp; $f_{\rm P}  \cdot T = 2$&nbsp; aliasing now arises, however, because the DFT is derived from the sum of many Gaussian functions at distance&nbsp; $f_{\rm P}  \cdot T = 2$&nbsp; (thin dashed curves in the graph ).
*Die einzelnen DFT–Koeffizienten werden unterschiedlich verfälscht: &nbsp; Der mittlere DFT–Koeffizient&nbsp; $($für die Frequenz&nbsp; $f = 0)$&nbsp; ist nahezu richtig, während die Fehler der DFT–Koeffizienten zu den Rändern hin deutlich zunehmen.
+
*The individual DFT coefficients are falsified differently: &nbsp; The mean DFT coefficient&nbsp; $($for the frequency&nbsp; $f = 0)$&nbsp; is almost correct, while the errors of the DFT coefficients increase significantly towards the edges.
*Im betrachteten Beispiel ist der DFT–Koeffizient für&nbsp; $f \cdot T = -1$&nbsp; doppelt so groß als er sein sollte, da die Gaußfunktion mit dem Zentrum bei&nbsp; $f \cdot T = -2$&nbsp; den gleichen Beitrag liefert wie die eigentliche Gaußfunktion um&nbsp; $f \cdot T = 0$&nbsp; (siehe gelbe Hinterlegung).
+
*In the example considered, the DFT coefficient for&nbsp; $f \cdot T = -1$&nbsp; is twice as large as it should be, since the Gaussian function with the centre at&nbsp; $f \cdot T = -2$&nbsp; gives the same contribution as the actual Gaussian function around&nbsp; $f \cdot T = 0$&nbsp; (see yellow background).
  
  
Somit ergibt sich hier mit&nbsp; $\text{MQF} \approx 2 \cdot 10^{-4}$&nbsp; ein viermal größerer Fehlerwert als durch den Abbruchfehler im&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#DFT-Verf.C3.A4lschung_durch_Fensterung_.E2.80.93_Abbruchfehler|$\text{Beispiel 2}$]].  
+
Thus, here with&nbsp; $\text{MQF} \approx 2 \cdot 10^{-4}$&nbsp; an error value four times larger than that caused by the termination error in&nbsp; [[Signal_Representation/Possible_Errors_When_Using_DFT#DFT-Verf.C3.A4lschung_durch_Fensterung_.E2.80.93_Abbruchfehler|$\text{example 2}$]].  
  
Wir verweisen nochmals auf das Lernvideo&nbsp; [[Fehlermöglichkeiten_bei_Anwendung_der_DFT_(Lernvideo)|Fehlermöglichkeiten bei Anwendung der DFT]]. }}
+
Again, we refer to the learning video (in German language) &nbsp; [[Fehlermöglichkeiten_bei_Anwendung_der_DFT_(Lernvideo)|Possible Errors When Using DFT]]. }}
  
  
==Aufgaben zum Kapitel==  
+
==Exercises For The Chapter==  
 
<br>
 
<br>
 
[[Aufgaben:Exercise 5.3: Mean Square Error|Exercise 5.3: Mean Square Error]]
 
[[Aufgaben:Exercise 5.3: Mean Square Error|Exercise 5.3: Mean Square Error]]

Revision as of 19:43, 1 January 2021

The Mean Square Error As a Quality Criteria


In the following, we briefly discuss some error possibilities when applying the DFT, whereby we restrict ourselves to the transformation from the time to the frequency domain. Even in its samples, the spectrum  $D(\mu )/f_{\rm A}$  determined via the DFT will generally differ from the actual spectrum  $X(\mu \cdot f_{\rm A})$  due to two processes:

  • the  sampling, that is, the reduction of information about  $x(t)$  to  $N$  numerical values,
  • the  windowing that limits the signal  $x(t)$  possibly erroneously.


$\text{Definition:}$  A quality criteria that takes both types of error into account is the  mean square error:

$${\rm MQF} = \frac{1}{N}\cdot \sum_{\mu = 0 }^{N-1} \left\vert X(\mu \cdot f_{\rm A})-\frac{D(\mu)}{f_{\rm A} }\right \vert^2 \hspace{0.05cm}.$$

It is always  ${\rm MQF} \ne 0$, since with finite  $N$  degradation due to sampling and due to windowing cannot be made zero at the same time

.


The magnitude of this evaluation quantity  ${\rm MQF}$  depends on the following parameters:

  • the properties of the time function at hand  $x(t)$  or the spectrum  $X(f)$,
  • the DFT parameter  $N$;  the larger  $N$  is chosen, the smaller  ${\rm MQF}$ becomes,
  • one of the four further DFT parameters, for example  $f_{\rm A}$.


For a given  $N$  the other DFT parameters are determined via the equations  $f_{\rm P} = N \cdot f_{\rm A}$,  $T_{\rm P} = 1/f_{\rm A}$  and  $T_{\rm A} = T_{\rm P}/N$ .

We refer you already here to the learning video (in German language)   Possible Errors When Using DFT , which clarifies the content of this chapter.


Quasi-Error-Free DFT with   $N = 16$

$\text{Example 1:}$  As an example, we consider a Gaussian pulse with the equivalent pulse duration  $\Delta t = T$, where  $T$  is simultaneously used as a normalisation parameter:

$$x(t) = {\rm e}^{- \pi (t/T)^2} \hspace{0.05cm}.$$

The Gaussian pulse is very suitable for the application of DFT due to its fast, exponential decay in both the time and frequency domain.

The graph below shows the DFT–result

  • for  $N = 16$  and
  • $T_{\rm A}/T = 0.25$   ⇒   $f_{\rm A} \cdot T = 0.25$.


The following should be noted about this plot:

  • The considered samples of  $x(t)$  are in the range  $\vert t/T \vert≤ 2$.  Since  $x(\pm 2T)$  is very small, periodization in the time domain with  $T_{\rm P}/T = N \cdot T_{\rm A}/T = 2$  does not lead to serious errors.
  • With  $f_{\rm A} \cdot T = 0.25$  and  $N = 16$  results in the (normalised) DFT parameter  $f_{\rm P} \cdot T = 4$.
  • The discrete spectral lines of the DFT thus lie in the range  $-2/T ≤ f < +2/T$.
  • The mean squared error is relatively small  $\text{(MQF} \approx 10^{-12})$, which is due to the favourable choice of  $f_{\rm A} \cdot T = 0.25$  $($for a given  $N = 16)$ .
  • The DFT accuracy can be improved by increasing  $N$ :
  • For  $N = 1024$  the smallest possible value is obtained  $\text{MQF} \approx 8 \cdot 10^{-17}$, if  $f_{\rm A} \cdot T = 0.125$  is chosen. The following then applies to the other DFT parameters:
$$f_{\rm P} \cdot T = 128, \hspace{0.5cm}T_{\rm A}/T = 1/128, \hspace{0.5cm} T_{\rm P}/T = N \cdot T_{\rm A}/T= 8.$$
  • For a 32–bit–processor (meaning:  smaller quantization errors of the computer)  $\text{MQF}$  would be even smaller, but never zero.


DFT Falsification Due to Windowing – Termination Error


A typical error when using the DFT is due to  windowing' . This falsification, known as  truncation error  can be explained as follows:

  • The windowing implicit in the DFT algorithm corresponds to the multiplication of the signal  $x(t)$ by  a rectangular function of height  $1$  and duration  $T_{\rm P} = N \cdot T_{\rm A}$.
  • If the time signal  $x(t)$  is not limited to the range  $T_{\rm P}$  the DFT result does not coincide with the actual spectrum  $X(f)$  but is obtained from it by convolution with the spectral function  $T_{\rm P} \cdot \text{si}(\pi fT_{\rm P})$.
  • In the limiting case  $T_{\rm P} \to \infty$, which for a given distance  $T_{\rm A}$  of the samples would also mean an infinitely large number of interpolation points  $N$  degenerates  $T_{\rm P} \cdot \text{si}(\pi fT_{\rm P})$  to a Dirac function and the original spectrum  $X(f)$  would remain.
  • The DFT of an unbounded signal in time - for example a periodic signal - will always cause a truncation error which can only be kept within limits by special measures. This is discussed in more detail in the chapter  spectrum analysis .
  • For time-limited, pulse-like signals, the truncation error can be avoided by choosing  $T_{\rm P}$  sufficiently large. By further enlarging the window into areas with  $x(t) \approx 0$  no additional information gain results   ⇒   $\text{MQF}$  does not become smaller.
  • By this addition of zeros  (zero-padding)  the samples of  $X(f)$  now occur at a smaller distance  $f_{\rm A} = 1/T_{\rm A}$ . By  $T_{\rm P}$-doubling one achieves an interpolation of the frequency samples exactly in the middle between two previous grid points.


The following example shows a termination error due to unfavourably chosen DFT parameters.

Termination Error For a DFT With  $N = 16$

$\text{Example 2:}$  The graph shows the result of the DFT for equal  $x(t)$  and  $X(f)$  as well as equal  $N = 16$  as in  $\text{example 1}$,but now with sampling in the time domain finer by a factor of  $2$  compared to this:

$$T_{\rm A}/T = 0.125     ⇒     f_{\rm A} \cdot T = 0.5.$$

The comparison with  example 1  $(T_{\rm A}/T = 0.25 \ \Rightarrow \ f_{\rm A} \cdot T = 0.25)$  shows:

  • The spacing of the frequency samples increases:  $f_{\rm A} \cdot T = 0.5$.
  • At the same time, $T_{\rm P}/T$  decreases from  $4$  to  $2$.
  • With this, only the signal components in the range  $\vert t \vert < T$  are now captured by the DFT.


Summing up:
With these DFT parameters, a  truncation error arises, by which the mean square error  $\rm (MQF)$  is significantly increased from  $10^{-12}$ to $4 \cdot 10^{-5}$ .


Again, we refer to the learning video (in German language)
Possible Errors When Using DFT.


DFT Falsification Due To Sampling – Aliasing Error


An unsuitable sampling of the time function  $x(t)$  can also significantly falsify the DFT result. This so-called  aliasing error  can be explained as follows:

  • Sampling  $x(t)$  at a distance  $T_{\rm A}$  causes a periodic continuation of the spectrum at multiples of the periodisation frequency  $f_{\rm P} = 1/T_{\rm A}$.
  • If the spectrum  $X(f)$  also has spectral components at  $|f| > f_{\rm P}/2$, the sampling theorem is not fulfilled and overlaps of the shifted frequency components to be added occur.
  • Only with a band-limited signal can the aliasing error be avoided by suitable DFT parameters. In contrast, this error is unavoidable with time-limited, pulse-like signals, since time-limited signals cannot be band-limited at the same time.
  • The aliasing error is reduced by finer sampling  $($so:   smaller  $T_{\rm A} = 1/f_{\rm P})$ . This can only be achieved with a constant  $T_{\rm A}$  - in order not to let the truncation error increase - by a larger  $N$  and thus a greater computational effort.


The following  $\text{Example 3}$  shows such an aliasing error due to wrongly chosen DFT parameters:

  • Compared to the „comparison system” according to  $\text{example 1}$  is  $T_{\rm A}$  too large and  $f_{\rm A}$  too small dimensioned.
  • The number of interpolation points is in both cases  $N = 16$.


Aliasing Error of a DFT With  $N = 16$

$\text{Example 3:}$  Let the DFT parameters be  $N = 16$  and  $f_{\rm A} \cdot T= 0.125$. Thus, for the other three DFT parameters we get:

  • $T_{\rm P}/T = 8.0 \hspace{0.5cm} \text{(Example 1:} \ \ T_{\rm P}/T = 4)$,
  • $f_{\rm P} \cdot T = 2.0 \hspace{0.45cm} \text{(Example 1:} \ \ f_{\rm P} \cdot T = 4)$,
  • $T_{\rm A}/T = 0.5\hspace{0.45cm} \text{(Example 1:} \ \ T_{\rm A}/T = 0.25)$.


This results in the following consequences:

  • The termination error continues to play no role because of  $T_{\rm P} /T = 8$  (already  $T_{\rm P} /T = 4$  was sufficient).
  • Because  $f_{\rm P} \cdot T = 2$  aliasing now arises, however, because the DFT is derived from the sum of many Gaussian functions at distance  $f_{\rm P} \cdot T = 2$  (thin dashed curves in the graph ).
  • The individual DFT coefficients are falsified differently:   The mean DFT coefficient  $($for the frequency  $f = 0)$  is almost correct, while the errors of the DFT coefficients increase significantly towards the edges.
  • In the example considered, the DFT coefficient for  $f \cdot T = -1$  is twice as large as it should be, since the Gaussian function with the centre at  $f \cdot T = -2$  gives the same contribution as the actual Gaussian function around  $f \cdot T = 0$  (see yellow background).


Thus, here with  $\text{MQF} \approx 2 \cdot 10^{-4}$  an error value four times larger than that caused by the termination error in  $\text{example 2}$.

Again, we refer to the learning video (in German language)   Possible Errors When Using DFT.


Exercises For The Chapter


Exercise 5.3: Mean Square Error

Exercise 5.3Z: Zero-Padding