









Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!










- March 24, Study Notes 8.2.3 Intuizione Dietro la Convoluzione......................... 11 8.3 Confronto Riassuntivo................................... 11 8.4 Conclusione - Memoryless vs. LTI............................ 12
9 Conclusion 12
10 Appendix: Forward and Inverse Transformations 13
Convolution is a key operation in many fields, from signal processing to applied mathematics. It allows us to compute an output (such as the number of patients needing ventilators or the level of pollution) by combining two functions: one representing an effect over time or space (e.g., fraction of patients needing a ventilator after a delay, or the decay of pollution over distance) and the other representing an input (e.g., the rate or number of new admissions, or pollution production). This document explains:
The discrete convolution as a sum.
The continuous convolution as an integral.
The connection between summation and integration—why the integral represents the “area under the graph” of contributions.
In the discrete setting, the convolution of two functions (or sequences) f and g is defined as:
(f ∗ g)(n) =
k=−∞
f (k) g(n − k).
In practical cases, such as modeling hospital ventilator usage, we assume that f (k) = 0 or g(n) = 0 for k < 0 or n < 0. Thus, the convolution simplifies to:
c(n) =
X^ n
k=
f (k) g(n − k).
Suppose:
f (k) is the fraction of patients who need a ventilator k weeks after admission. For instance, if
f = [0. 05 , 0. 03 , 0 .01],
then:
(f ∗ h)(t) =
−∞
f (τ ) h(t − τ ) dτ
t: tempo attuale in cui si valuta l’output.
τ : tempo in cui si `e verificato l’input (non un delay, ma un tempo assoluto).
f (τ ): input al tempo τ.
h(t − τ ): quanto l’input al tempo τ influenza l’output al tempo t.
Convoluzione Causale (t = fisso)
t t − 4 t − 3 t − 2 t − 1 t − 0
passato presente
Convoluzione Simmetrica (t = 0 per esempio)
τ − 4 − 3 − 2 − 1 0 1 2 3 4
passato presente futuro
Interpretazione di τ e t − τ
Formula τ t − τ Causale Ritardo (quanto tempo fa) Tempo dell’input: passato Standard Tempo dell’input Distanza dal tempo attuale t
Cosa rappresentano i valori di τ
Formula τ > 0 τ = 0 τ < 0 Causale input passato input presente non permesso
Formula τ < t τ = t τ > t Standard input passato input presente input futuro
Aspetto Causale Standard (Simmetrica) Dominio τ [0, ∞) (−∞, ∞) Usa input futuri? No S`ı (a meno di restrizioni) Tipico uso Sistemi fisici, real-time Filtri, smoothing, processing offline Favorisce valori recenti? ✓ Se h(τ ) decresce ✓ Se h(t − τ ) ha picco in t = τ
Esempio: Convoluzione Causale con t = 10
(f ∗ h)(10) =
0
f (10 − τ ) h(τ ) dτ
τ = 0 ⇒ f (10 − 0) = f (10): input al tempo presente.
τ = 1 ⇒ f (9): input di 1 unit`a fa.
τ = 2 ⇒ f (8): input di 2 unit`a fa.
...
L’output a t = 10 `e la somma pesata di input passati, dove i contributi decrescono con l’aumentare del ritardo τ , secondo h(τ ).
Esempio: Convoluzione Standard con t = 10
(f ∗ h)(10) =
−∞
f (τ ) h(10 − τ ) dτ
τ = 10 ⇒ h(0): input nel presente.
τ = 9 ⇒ h(1): input di 1 unit`a fa.
τ = 11 ⇒ h(−1): input di 1 unit`a nel futuro.
Se il kernel h `e simmetrico (es. gaussiano o triangolare), allora:
h(1) = h(−1) ⇒ f (9) e f (11) contribuiscono in modo uguale all’output in t = 10.
Let:
g(t) be the rate of new hospital admissions (patients per day) at time t.
f (τ ) be the fraction of patients who need a ventilator τ days after admission.
Then, the total ventilator usage at time T is given by:
c(T ) =
0
f (τ ) g(T − τ ) dτ.
This integral accumulates the contribution from each cohort of patients admitted at earlier times.
Thus, the two common forms: Z (^) T
0
f (τ ) g(T − τ ) dτ and
0
f (T − ξ) g(ξ) dξ
are equivalent. The difference lies only in the choice of the dummy variable of integration.
Beyond convolution, two related operations are widely used in signal processing: cross-correlation and autocorrelation.
Cross-correlation measures the similarity between two signals as a function of a time-lag. For real-valued functions f and g, the continuous cross-correlation is defined as:
(f ⋆ g)(t) =
−∞
f (τ ) g(t + τ ) dτ.
In the discrete setting, it is given by:
(f ⋆ g)[n] =
k=−∞
f [k] g[n + k].
When working with complex-valued signals, a complex conjugate is typically incorporated to ensure proper similarity measures. This leads to a definition such as:
(f ⋆ g)(t) =
−∞
f (τ ) g(t + τ ) dτ,
or alternatively,
(f ⋆ g)(t) =
−∞
f (τ ) g(t + τ ) dτ.
The placement of the conjugate (on g or f ) depends on the chosen convention—engineering appli- cations often place it on the second function, while many mathematical texts place it on the first to align with the definition of the inner product.
Autocorrelation is a special case of cross-correlation where the signal is compared with itself. For a real-valued function f , the autocorrelation is:
(f ⋆ f )(t) =
−∞
f (τ ) f (t + τ ) dτ.
For complex-valued functions, including the complex conjugate yields:
(f ⋆ f )(t) =
−∞
f (τ ) f (t + τ ) dτ.
Autocorrelation is especially useful for identifying periodicities or repeating patterns in a signal since it quantifies how well the signal matches a shifted version of itself.
The key differences between convolution and cross-correlation are:
Time-Reversal: Convolution involves flipping one of the functions (i.e., g(t − τ )), whereas cross-correlation uses the function in its original order (i.e., g(t + τ )).
Complex Conjugation: In cross-correlation for complex signals, a conjugate is included—its placement is determined by convention. Convolution typically does not require a conjugate unless one desires a specific interpretation in the complex domain.
Purpose: Convolution is mainly used to filter or transform data (such as applying a kernel in image processing), while cross-correlation is used to measure similarity or to detect the presence of a known pattern. Autocorrelation, being a special case of cross-correlation, helps reveal inherent periodicity in a signal.
In addition to the ventilator usage example, convolution can be used to model environmental phenomena. Consider a river being polluted by villages along its course.
Suppose:
A village with 1,000 inhabitants is located at x = 0 (our reference point) and contributes pollution at a rate of 1 unit per person per day.
The river has a self-cleaning property: for each mile downstream, 50% of the pollution is cleaned. This decay can be modeled by an exponential function. Define the Pollution Spread Function (PSF) as: f (d) = 0. 5 d^ for d ≥ 0 , and f (d) = 0 for d < 0 (since pollution does not flow upstream).
Two additional upstream villages contribute to the pollution:
In a continuous framework, the pollution production function g(x) represents the rate at which pollution enters the river at location x. For a point source (a village concentrated at a specific location), we use the Dirac delta function δ(x). For example:
g(x) = 12 000 δ(x + 2) + 40 000 δ(x + 5),
where the village at x = −2 contributes 12,000 units/day and the one at x = −5 contributes 40, units/day. The delta function ensures that the pollution is localized at the village’s position and that its total contribution is exactly preserved upon integration.
More generally, by sliding the flipped PSF along the entire river and convolving it with the contin- uous pollution production function g(x), we obtain the pollution profile for every point along the river:
P (x) =
Z (^) x
−∞
g(u) 0. 5 x−u^ du.
This provides a continuous model for how pollution accumulates from upstream sources and decays as it flows downstream.
La convoluzione `e un’operazione fondamentale in molte applicazioni di controllo, in particolare per modellare i sistemi lineari e invarianti nel tempo (LTI). Questi sistemi sono caratterizzati dalla loro risposta all’impulso h(t), che descrive come il sistema risponde a un impulso di Dirac applicato in ingresso.
Un sistema senza memoria e tale che l’output in ogni istante t dipende solo dal valore dell’input in quel medesimo istante. Per un sistema lineare, la relazionee tipicamente:
y(t) = k x(t),
dove k `e una costante scalare. In sistemi non lineari, possiamo avere ad esempio:
y(t) = f
x(t)
con f una funzione qualsiasi (ad esempio, un operatore di saturazione). In entrambi i casi, non viene considerata alcuna informazione sui valori passati di x(t).
In un sistema lineare e invariante nel tempo (LTI), l’output non dipende solamente dal valore corrente dell’input, ma anche da tutti i valori passati. Questo comportamento `e descritto dalla risposta all’impulso h(t) del sistema.
8.2.1 Scomposizione dell’Input in Impulsi
Ogni segnale x(t) pu`o essere rappresentato come una sovrapposizione (o integrazione) di impulsi di Dirac:
x(t) =
−∞
x(τ ) δ(t − τ ) dτ.
La proprieta fondamentale dei sistemi LTIe che la risposta a un impulso δ(t − τ ) e data da h(t − τ ), cioe la risposta all’impulso traslata nel tempo.
8.2.2 Calcolo dell’Output tramite Convoluzione
Grazie alla linearita e all’invarianza nel tempo, l’output del sistema in risposta a ciascun impulso x(τ )δ(t − τ )e: x(τ ) h(t − τ ).
Sommando (integrando) tutte queste risposte, otteniamo:
y(t) =
−∞
x(τ ) h(t − τ ) dτ.
Questa espressione definisce la convoluzione tra x(t) e h(t) (spesso indicata con x(t) ∗ h(t)). Nel caso discreto, se indichiamo il segnale come x[n] e la risposta all’impulso come h[n], la convoluzione si esprime come:
y[n] =
k=−∞
x[k] h[n − k].
8.2.3 Intuizione Dietro la Convoluzione
La convoluzione viene utilizzata perch´e in un sistema LTI:
Linearit`a: Permette di sommare le risposte a ciascun impulso, ogni risposta essendo scalata in base al valore di x(t) in quell’istante.
Invarianza nel tempo: Garantisce che la risposta a un impulso sia sempre h(t), traslata opportunamente in base al tempo in cui l’impulso e applicato. Pertanto, l’output y(t)e il risultato dell’accumulo (somma o integrazione) di tutte le risposte all’impulso traslate, ognuna pesata dal valore dell’input in quel punto. Se si usasse una semplice moltiplicazione, si implicherebbe che l’output in t dipende solo da x(t) (cio`e un sistema senza memoria), ignorando completamente l’effetto dei valori passati.
Senza memoria:
y(t) = f
x(t)
(ad es., y(t) = k x(t))
L’output `e determinato solo dal valore corrente dell’input.
Con memoria (LTI):
y(t) =
−∞
x(τ ) h(t − τ ) dτ,
oppure, in versione discreta:
y[n] =
k=−∞
x[k] h[n − k].
L’output in t `e il risultato della somma ponderata delle risposte all’impulso a partire dai valori passati dell’input, ciascuno traslato nel tempo.
Let X be a continuous random variable with cumulative distribution function (CDF)
F (x) = P(X ≤ x)
and probability density function (PDF)
fX (x) = F ′(x).
Our goal is to show that if we let U = F (X),
then U is uniformly distributed on [0, 1]; and conversely, if we generate U ∼ Unif(0, 1) and set
X = F −^1 (U ),
then the resulting random variable X has density fX (x).
Step 1. Transformation: U = F (X) Define the function g(x) = F (x).
Since we assume that F is strictly increasing and continuous, it is invertible and its inverse is given by g−^1 (u) = F −^1 (u).
The change-of-variables formula for transforming random variables states that if X has density fX (x) and U = g(X),
then the density of U is given by
fU (u) = fX
g−^1 (u)
(^) d du
g−^1 (u).
Alternatively, considering U = g(X), we can express the density of X in terms of fU and the transformation g as fX (x) = fU
g(x)
· |g′(x)|.
In our case, since g(x) = F (x) we have
g′(x) = F ′(x) = fX (x).
Because we set U = F (X) and (by design) we use the uniform distribution for U on [0, 1], it follows that fU (u) = 1, for u ∈ [0, 1].
Thus, substituting into the change-of-variables formula we obtain
fX (x) = fU
F (x)
· |F ′(x)| = 1 · |fX (x)| = fX (x).
This confirms that the density of X is recovered correctly by the formula
fX (x) = fU (F (x)) F ′(x).
Step 2. Inverse Transform Sampling Now suppose that we generate a random number U from the uniform distribution on [0, 1] and set X = F −^1 (U ).
To verify that X has the desired distribution, consider for any x ∈ R:
P(X ≤ x) = P
F −^1 (U ) ≤ x
U ≤ F (x)
(since F is strictly increasing, so F −^1 (u) ≤ x if and only if u ≤ F (x))
= F (x) (because U ∼ Unif(0, 1), so P(U ≤ F (x)) = F (x)).
Thus, the CDF of X is exactly F (x), and differentiating (where differentiable) yields that the density of X is fX (x).
Summary
fX (x) = fU
F (x)
|F ′(x)|.
Since fU (u) = 1 for u ∈ [0, 1] and F ′(x) = fX (x), this shows that the transformation is consistent.
U ≤ F (x)
= F (x), so that X has the desired distribution with density fX (x).