Graphical Convolution

From LNTwww
Revision as of 15:19, 1 April 2021 by Tasnad (talk | contribs)

Open Applet in new Tab   Deutsche Version Öffnen

Applet Description


Dieses Applet verdeutlicht die Faltungsoperation im Zeitbereich

  • zwischen einem Eingangsimpuls  $x(t)$   ⇒   Rechteck, Dreieck, Gauß, Exponentialfunktion
  • und der Impulsantwort  $h(t)$  eines LZI–Systems mit Tiefpass–Charakter  ⇒   Spalt–Tiefpass, Tiefpass erster bzw. zweiter Ordnung, Gauß–Tiefpass.


Für das Ausgangssignal  $y(t)$  entsprechend dem Blockschaltbild im  $\text{Beispiel 1}$  gilt dann, wie im Kapitel  Grafische Faltung  dargelegt:

$$y( t ) = x(t) * h( t ) = \int_{ - \infty }^{ + \infty } \hspace{-0.15cm}{x( \tau )} \cdot h( {t - \tau } )\hspace{0.1cm}{\rm d}\tau .$$

Bei kausalen Systemen   ⇒    $h(t) \equiv 0$  für  $t < 0$  (Beispiele: Spalt–Tiefpass sowie Tiefpass erster und zweiter Ordnung)   kann hierfür auch geschrieben werden:

$$y( t ) = \int_{ - \infty }^{ t } \hspace{-0.15cm}{x( \tau )} \cdot h( {t - \tau } )\hspace{0.1cm}{\rm d}\tau .$$

Bitte beachten Sie:

  • Alle Größen – auch die Zeit $t$ – sind normiert (dimensionslos) zu verstehen.
  • Die Zeitfunktionen  $x(t)$,  $h(t)$  und  $y(t)$  können im Programm keine negativen Signalwerte annehmen.
  • Die absolute Dauer  eines Impulses  $y(t)$  ist der (zusammenhängende) Zeitbereich, für den  $y(t) > 0$  gilt.
  • Die äquivalente Dauer  eines Impulses ist über das flächengleiche Rechteck berechenbar.

Theoretical Background

Faltung im Zeitbereich

Der  Faltungssatz  ist mit das wichtigste Gesetz der Fouriertransformation. Wir betrachten zunächst den Faltungssatz im Zeitbereich und setzen voraus, dass die Spektren zweier Zeitfunktionen  $x_1(t)$  und  $x_2(t)$  bekannt sind:

$$X_1 ( f )\hspace{0.15cm}\bullet\!\!\!-\!\!\!-\!\!\!-\!\!\circ\hspace{0.15cm}x_1( t ),\quad X_2 ( f )\hspace{0.1cm}\bullet\!\!\!-\!\!\!-\!\!\!-\!\!\circ\hspace{0.1cm}x_2 ( t ).$$

Dann gilt für die Zeitfunktion des Produktes  $X_1(f) \cdot X_2(f)$:

$$X_1 ( f ) \cdot X_2 ( f )\hspace{0.15cm}\bullet\!\!\!-\!\!\!-\!\!\!-\!\!\circ\hspace{0.15cm}\int_{ - \infty }^{ + \infty } {x_1 ( \tau )} \cdot x_2 ( {t - \tau } )\hspace{0.1cm}{\rm d}\tau.$$

Hierbei ist  $\tau$  eine formale Integrationsvariable mit der Dimension einer Zeit.

$\text{Definition:}$  Die obige Verknüpfung der Zeitfunktion  $x_1(t)$  und  $x_2(t)$  bezeichnet man als  Faltung  und stellt diesen Funktionalzusammenhang mit einem Stern dar:

$$x_{\rm{1} } (t) * x_{\rm{2} } (t) = \int_{ - \infty }^{ + \infty } {x_1 ( \tau ) } \cdot x_2 ( {t - \tau } ) \hspace{0.1cm}{\rm d}\tau.$$

Damit lässt sich obige Fourierkorrespondenz auch wie folgt schreiben:

$$X_1 ( f ) \cdot X_2 ( f )\hspace{0.15cm}\bullet\!\!\!-\!\!\!-\!\!\!-\!\!\circ\hspace{0.15cm}{ {x} }_{\rm{1} } ( t ) * { {x} }_{\rm{2} } (t ).$$

$\text{Beweis}$


Anmerkung:   Die Faltung ist  kommutativ   ⇒   Die Reihenfolge der Operanden ist vertauschbar:   ${ {x}}_{\rm{1}} ( t ) * { {x}}_{\rm{2}} (t ) ={ {x}}_{\rm{2}} ( t ) * { {x}}_{\rm{1}} (t ) $.


Zur Berechnung von Signal und Spektrum am LZI–Ausgang

$\text{Beispiel 1:}$  Ein jedes lineare zeitinvariante (LZI-) System kann sowohl durch den Frequenzgang  $H(f)$  als auch durch die Impulsantwort  $h(t)$  beschrieben werden, wobei der Zusammenhang zwischen diesen beiden Systemgrößen ebenfalls durch die Fouriertransformation gegeben ist.

Legt man an den Eingang ein Signal  $x(t)$  mit dem Spektrum  $X(f)$  an, so gilt für das Spektrum des Ausgangssignals:

$$Y(f) = X(f) \cdot H(f)\hspace{0.05cm}.$$

Mit dem Faltungssatz ist es nun möglich, das Ausgangssignal auch direkt im Zeitbereich zu berechnen:

$$y( t ) = x(t) * h( t ) = \int_{ - \infty }^{ + \infty } \hspace{-0.15cm}{x( \tau )} \cdot h( {t - \tau } )\hspace{0.1cm}{\rm d}\tau = \int_{ - \infty }^{ + \infty } \hspace{-0.15cm} {h( \tau )} \cdot x( {t - \tau } )\hspace{0.1cm}{\rm d}\tau = h(t) * x( t ).$$

Aus dieser Gleichung geht nochmals hervor, dass die Faltungsoperation  kommutativ  ist.


Faltung im Frequenzbereich

Die Dualität zwischen Zeit– und Frequenzbereich erlaubt auch Aussagen hinsichtlich des Spektrums eines Produktsignals:

$$x_1 ( t ) \cdot x_2 ( t )\circ\!\!-\!\!\!-\!\!\!-\!\!\bullet\,X_1 (f) * X_2 (f) = \int_{ - \infty }^{ + \infty } {X_1 ( \nu )} \cdot X_2 ( {f - \nu })\hspace{0.1cm}{\rm d}\nu.$$

Dieses Resultat lässt sich ähnlich wie der  Faltungssatz im Zeitbereich  beweisen. Die Integrationsvariable  $\nu$  hat aber nun die Dimension einer Frequenz.

Faltung im Frequenzbereich

$\text{Beispiel 2:}$  Die  Zweiseitenband-Amplitudenmodulation  (ZSB-AM) ohne Träger wird durch das skizzierte Modell beschrieben.

  • Bei der Zeitbereichsdarstellung (blau) ergibt sich das modulierte Signal  $s(t)$  als das Produkt aus dem Nachrichtensignal  $q(t)$  und dem (normierten) Trägersignal  $z(t)$.
  • Nach dem Faltungssatz folgt daraus für den Frequenzbereich (rot), dass das Ausgangsspektrum  $S(f)$  gleich dem Faltungsprodukt aus  $Q(f)$  und  $Z(f)$  ist.


Faltung einer Funktion mit einer Diracfunktion

Sehr einfach wird die Faltungsoperation, wenn einer der beiden Operanden eine  Diracfunktion  ist. Dies gilt für die Faltung im Zeit– und im Frequenzbereich gleichermaßen.

Wir betrachten beispielhaft die Faltung einer Funktion  $x_1(t)$  mit der Funktion

$$x_2 ( t ) = \alpha \cdot \delta ( {t - T} ) \quad \circ\,\!\!\!-\!\!\!-\!\!\!-\!\!\bullet \quad X_2 ( f )= \alpha \cdot {\rm{e}}^{ - {\rm{j}}\hspace{0.03cm}2\hspace{0.03cm}{\rm{\pi }}\hspace{0.01cm}f\hspace{0.01cm}T}.$$

Für die Spektralfunktion des Signals  $y(t) = x_1(t) \ast x_2(t)$  gilt dann:

$$Y( f ) = X_1 ( f ) \cdot X_2 ( f ) = X_1 ( f ) \cdot \alpha \cdot {\rm{e}}^{ - {\rm{j}}\hspace{0.03cm}2\hspace{0.03cm}{\rm{\pi }}\hspace{0.01cm}f\hspace{0.01cm}T} .$$

Die komplexe Exponentialfunktion führt zur Verschiebung um  $T$   ⇒   Verschiebungssatz, der Faktor  $\alpha$  zu einer Dämpfung  $(\alpha < 1)$  bzw. einer Verstärkung  $(\alpha > 1)$. Daraus folgt:

$$x_1 (t) * x_2 (t) = \alpha \cdot x_1 ( {t - T} ).$$

$\text{In Worten: }$  Die Faltung einer beliebigen Funktion mit einer Diracfunktion bei  $t = T$  ergibt die um  $T$  nach rechts verschobene Funktion, wobei noch die Gewichtung der Diracfunktion durch den Faktor  $\alpha$  zu berücksichtigen ist.


$\text{Beispiel 3:}$  Ein Rechtecksignal  $x(t)$  wird durch ein LZI-System um eine Laufzeit  $\tau = 3\,\text{ ms}$  verzögert und um den Faktor  $\alpha = 0.5$  gedämpft.

Faltung eines Rechtecks mit einer Diracfunktion

Verschiebung und Dämpfung erkennt man sowohl am Ausgangssignal  $y(t)$  als auch an der Impulsantwort  $h(t)$.


Grafische Faltung

In diesem Applet wird von folgender Faltungsoperation ausgegangen:

Bildschirmabzug des Programms „Grafische Faltung” (frühere Version)
$$y(t) = x (t) * h (t) = \int_{ - \infty }^{ + \infty } {x ( \tau )} \cdot h ( {t - \tau } )\hspace{0.1cm}{\rm d}\tau.$$

Die Lösung des Faltungsintegrals soll auf grafischem Wege erfolgen. Es wird vorausgesetzt, dass  $x(t)$  und  $h(t)$  zeitkontinuierliche Signale sind.


Dann sind die folgenden Schritte erforderlich:

  1.   Die  Zeitvariablen  der beiden Funktionen  ändern:  
        $x(t) \to x(\tau)$,   $h(t) \to h(\tau)$.
  2.   Zweite Funktion spiegeln:   $h(\tau) \to h(-\tau)$.
  3.   Gespiegelte Funktion um  $t$  verschieben:   $h(-\tau) \to h(t-\tau)$.
  4.   Multiplikation der beiden Funktionen  $x(\tau)$  und  $h(t-\tau)$.
  5.   Integration  über das Produkt bezüglich  $\tau$  in den Grenzen von  $-\infty$  bis  $+\infty$.


Da die Faltung kommutativ ist, kann anstelle von  $h(\tau)$  auch  $x(\tau)$  gespiegelt werden.



Nebenstehende Grafik zeigt einen Bildschirmabzug einer älteren Version des vorliegenden Applets.


Beispiel einer Faltungsoperation:
Sprungfunktion gefaltet mit Exponentialfunktion

$\text{Beispiel 4:}$  Die Vorgehensweise bei der grafischen Faltung wird nun anhand eines ausführlichen Beispiels erklärt:

  • Am Eingang eines Filters liege eine Sprungfunktion  $x(t) = \gamma(t)$  an.
  • Die Impulsantwort des RC-Tiefpasses sei  $h( t ) = {1}/{T} \cdot {\rm{e} }^{ - t/T}.$


Die Grafik zeigt rot das Eingangssignal  $x(\tau)$, blau die Impulsantwort  $h(\tau)$ und grau das Ausgangssignal  $y(\tau)$. Die Zeitachse ist bereits in  $\tau$  umbenannt.

Das Ausgangssignal kann zum Beispiel nach folgender Gleichung berechnet werden:

$$y(t) = h(t) * x(t) = \int_{ - \infty }^{ + \infty } {h( \tau )} \cdot x( {t - \tau } )\hspace{0.1cm}{\rm d}\tau.$$

Noch einige Anmerkungen zur grafischen Faltung:

  • Der Ausgangswert bei  $t = 0$  ergibt sich, indem man das Eingangssignal  $x(\tau)$  spiegelt, dieses gespiegelte Signal  $x(-\tau)$  mit der Impulsantwort  $h(\tau)$  multipliziert und darüber integriert.
  • Da es hier kein Zeitintervall gibt, bei dem sowohl die blaue Kurve  $h(\tau)$  und gleichzeitig auch die rot gestrichelte Spiegelung  $x(-\tau)$  ungleich Null ist, folgt daraus  $y(t=0)=0$.
  • Für jeden anderen Zeitpunkt  $t$  muss das Eingangssignal verschoben werden   ⇒   $x(t-\tau)$, beispielsweise entsprechend der grün gestrichelten Kurve für  $t=T$.
  • Da in diesem Beispiel auch  $x(t-\tau)$  nur die Werte  $0$  oder  $1$  annehmen kann, wird die Integration  $($allgemein von  $\tau_1$  bis  $\tau_2)$  einfach und man erhält mit  $\tau_1 = 0$  und  $\tau_2 = t$ :
$$y( t) = \int_0^{\hspace{0.05cm} t} {h( \tau)}\hspace{0.1cm} {\rm d}\tau = \frac{1}{T}\cdot\int_0^{\hspace{0.05cm} t} {{\rm{e}}^{ - \tau /T } }\hspace{0.1cm} {\rm d}\tau = 1 - {{\rm{e}}^{ - t /T } }.$$

Die Skizze gilt für  $t=T$  und führt zum Ausgangswert  $y(t=T) = 1 – 1/\text{e} \approx 0.632$.


Exercises

  • First, select the number  $(1,\ 2, \text{...} \ )$  of the task to be processed.  The number  $0$  corresponds to a "Reset":  Same setting as at program start.
  • A task description is displayed.  The parameter values are adjusted.  Solution after pressing "Show Solution".
  • Both the input signal  $x(t)$  and the impulse response  $h(t)$  of the filter are are normalized, dimensionless and energy-limited ("time-limited pulses").


(1)   Select the following parameters:  $\text{Gaussian pulse: }A_x = 1, \ \Delta t_x= 1, \ \tau_x = 1;     \text{ Impulse response according to 2nd order low pass: } \Delta t_h= 1$.
         Interpret the displayed graphs.  What is the maximum output value  $y_{\rm max}$?  At what time  $t_{\rm max}$  does  $y_{\rm max}$  occur?

  •  After renaming:  Input signal  $x(\tau)$   ⇒   red curve,   impulse response  $h(\tau)$   ⇒   blue curve,  after mirroring  $h(-\tau)$   ⇒   green curve.
  •  Shifting the green curve by  $t$  to the right, we get  $h(t-\tau)$.  The output signal  $y(t)$  is obtained by multiplication and integration with respect to  $\tau$:
$$y (t) = \int_{ - \infty }^{ +\infty } {x ( \tau ) } \cdot h ( {t - \tau } ) \hspace{0.1cm}{\rm d}\tau = \int_{ - \infty }^{ t } {x ( \tau ) } \cdot h ( {t - \tau } ) \hspace{0.1cm}{\rm d}\tau .$$
  •  The output pulse  $y(t)$  is asymmetric in the present case;  the maximum output value  $y_{\rm max}\approx 0.67$  occurs at  $t_{\rm max}\approx 1.5$.


(2)   What changes if we increase the equivalent pulse duration of  $h(t)$  to  $\Delta t_h= 1.5$?

  •  $y_{\rm max}\approx 0.53$  now occurs at  $t_{\rm max}\approx 1.75$.  Due to the less favorable (wider) impulse response, the input pulse is more deformed.
  •  In a digital communication system, this would result in stronger  "intersymbol interferences".


(3)   Now select the symmetric  $\text{rectangular pulse: }A_x = 1, \ \Delta t_x= 1, \ \tau_x = 0$  and the  $\text{rectangular impulse response}$  of the low-pass filter:  $\Delta t_h= 1$.
         Interpret the convolution result.  What is the maximum output value  $y_{\rm max}$?  At what times is  $y(t)>0$?  Does  $h(t)$  describe a causal system?

  •  The convolution of two rectangles with respective durations  $1$  yields a triangle with absolute duration  $2$  ⇒   equivalent pulse duration  $\Delta t_y= 1$.
  •  $y(t)$  is different from zero in the range from  $-0.5$  to  $+1.5$ .  The pulse maximum  $y_{\rm max} = 1$  is at  $t_{\rm max} = +0.5$.
  •  $h(t)$  describes a causal system, since  $h(t) \equiv 0$  for  $t < 0$.  That means:  The "effect"  $y(t)$  does not come before the "cause"  $x(t)$.


(4)   What changes if we increase the equivalent pulse duration of  $h(t)$  to  $\Delta t_h= 2$ ?

  •  The convolution of two rectangles of different widths results in a trapezoid, here between  $-0.5$  and  $+2.5$ ⇒   equivalent pulse duration  $\Delta t_y= 2$.
  •  The maximum  $y_{\rm max} = 0.5$  occurs in the range  $0.5 \le t \le 1.5$.  Nothing changes with respect to causality.


(5)   Now select the (unsymmetrical)  $\text{rectangular pulse: }A_x = 1, \ \Delta t_x= 1, \ \tau_x = 0.5$  and the  $\text{impulse response of a 1st order low pass: }\Delta t_h= 1$.
         Interpret the results.  What is the value of  $y_{\rm max}$?  At what times is  $y(t)>0$ ?  Does  $h(t)$  describe a causal system?

  •  $h(t)$  has an exponentially decreasing curve for  $t > 0$.  It always applies:   $y(t>0) > 0$,  but the signal values can become very small.
  •  $y_{\rm max} = 0.63$  occurs for  $t_{\rm max} = +1$.  For  $ t < t_{\rm max}$ the progression is exponentially increasing, for  $ t > t_{\rm max}$  exponentially decreasing.
  •  The 1st order low pass can be realized with a resistor and a capacitor.  Any realizable system is causal per se.


(6)   Select as in  $(3)$  the  $\text{rectangular impulse response}$  of the low-pass filter:  $\Delta t_h= 1$.  With which  $x(t)$  results the same  $y(t)$  as for  $(5)$?

  •  The signal  $y(t)$  in  $(5)$  resulted as a convolution between the rectangular input  $x(t)$  and the exponential function  $h(t)$.
  •  Since the convolution operation is commutative, the same result is obtained with the exponential function  $x(t)$  and the rectangular function  $h(t)$.
  •  Thus, the correct setting for the input signal  $x(t)$  is the  $\text{exponential pulse }$with  $ A_x = 1, \ \Delta t_x= 1, \ \tau_x = 0$ .


(7)   For the remainder of the exercises, we consider the Gaussian low-pass.  The equivalent duration of the impulse response  $h(t)$  should first be  $\Delta t_h= 0.8$.
       Analyze and interpret this  "system"  in terms of causality and the resulting distortions for the rectangular pulse.

  •  The low-pass is not causal (and therefore non–realizable):  For  $t < 0$  does  $h(t) \equiv 0$  not hold. Suitable model if infinite delay is ignored.
  •  The larger  $\Delta t_h$  is, the wider the output pulse and the stronger the degradation of a digital system due to intersymbol interference.
  •  The frequency response  $H(f)$  is the Fourier transform of  $h(t)$. The larger  $\Delta t_h$  is, the smaller  $\Delta f_h = 1/\Delta t_h$   ⇒   The system is more narrowband.


(8)   Now select  $\text{Gaussian pulse: }A_x = 1, \ \Delta t_x= 1.5, \ \tau_x = 0$  and  $\text{Gaussian low pass: }\Delta t_h= 2$.  What is the course of the output pulse  $y(t)$?
         What are the equivalent duration  $\Delta t_y$  of the output pulse and the maximum output value  $y_{\rm max}$?  At what time  $t_{\rm max}$  does  $y_{\rm max}$  occur?

  •  $y(t)$  is (exactly) Gaussian, too.   Mnemonic:  $\text{"Gaussian convolved with Gaussian gives always Gaussian"}$.
  •  Equivalent duration:  $\Delta t_y =\sqrt{\Delta t_x^2+ \Delta t_h^2} = 2.5$.  Pulse maximum  $($at  $t=0)$:  $y_{\rm max} = A_x \cdot \Delta t_x/\Delta t_y = 1 \cdot 1.5/2.5 = 0.6$.


(9)   Now select  $\text{Triangular pulse: }A_x = 1, \ \Delta t_x= 1.5, \ \tau_x = 0$  and  $\text{Gaussian low–pass: }\Delta t_h= 2$.  What is the course of the output pulse  $y(t)$?
       What is the equivalent duration  $\Delta t_y$  of the output pulse and the maximum output value  $y_{\rm max}$?  At what time  $t_{\rm max}$  does  $y_{\rm max}$  occur?

  •  $y(t)$  is nearly Gaussian, but not exactly.  Mnemonic:  $\text{"Gaussian convolved with non–Gaussian never gives exactly Gaussian"}$.
  •  The characteristics of the output pulse  $y(t)$  differ only slightly from  $(8)$:  $\Delta t_y \approx 2.551$,  $y_{\rm max} \approx 0.588$.


Applet Manual


Screen shot  (German version)

    (A)     Selection:   Shape of the input pulse  $x(t)$

    (B)     Parameter input for the input pulse  $x(t)$

    (C)     Selection:   Shape of the impulse response  $h(t)$  of the low-pass system

    (D)     Parameter input for the impulse response  $h(t)$

    (E)     Control panel  (Start;   Pause/Continue   ;  Step >   ;  Step <  ;  Reset)

    (F)     Output the initial value  $y(t)$  at the continuous time  $t$

    (G)     Maximum value  $y_{\rm max} = y(t_{\rm max})$  and equivalent width $\Delta\hspace{0.03cm} t_y$

                 After renaming the abscissa:   $t \ \to \ \tau$:

    (H)     Representation of  $x(\tau)$  ⇒   red static curve.

    (I)       Representation of  $h(\tau)$  ⇒  blue curve  and   $h(t-\tau)$  ⇒   green curve
                $($this is shifted to the right with the motion parameter   $t$ $)$

    (J)       Plot of  $x(\tau) \cdot h(t - \tau)$  ⇒   purple curve, dynamic with  $t$

    (K)      Successive representation of the output signal  $y(t)$  ⇒   brown curve

    (L)      Area for exercise execution:   Task selection.

    (M)      Exercise execution:   Area for task description

    (N)      Exercise execution:   Area for the sample solution

About the Authors

This interactive calculation tool was designed and implemented at the  Institute for Communications Engineering  at the  Technical University of Munich.

  • The first version was created in 2006 by Markus Elsberger  as part of his bachelor thesis with “FlashMX – Actionscript” (Supervisor: Günter Söder).
  • Last revision and English version 2020/2021 by  Carolin Mirschina  in the context of a working student activity.  Translation using DEEPL.com.


The conversion of this applet to HTML 5 was financially supported by  Studienzuschüsse  ("study grants")  of the TUM Faculty EI.  We thank.


Once again:  Open Applet in new Tab

Open Applet in new Tab   Deutsche Version Öffnen