<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" xmlns:m="http://www.w3.org/1998/Math/MathML" id="new">
  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Signal Processing in Processing: Convolution and Filtering</name>
  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">1.1</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2005/05/26 01:38:51 GMT-5</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2005/06/09 07:13:28 GMT-5</md:revised>
  <md:authorlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="drocchesso">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Davide</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Rocchesso</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Davide.Rocchesso@univr.it</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="ppolotti">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Pietro</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Polotti</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">polotti@sci.univr.it</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="drocchesso">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Davide</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Rocchesso</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Davide.Rocchesso@univr.it</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="ppolotti">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Pietro</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Polotti</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">polotti@sci.univr.it</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Convolution</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Filtering</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Systems</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Discrete-time systems and their description with the impulse response. The convolution operator. Filtering. (in Italian)</md:abstract>
</metadata>
  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="systems">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Sistemi</name> <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="systemsp">Per i nostri scopi, un
      sistema è un qualsiasi blocco di elaborazione che, presa in
	ingresso una sequenza di campioni <m:math>
	  <m:apply>
	      <m:ci type="fn">x</m:ci>
	      <m:ci>n</m:ci>
	  </m:apply>
	</m:math>, produce in uscita una sequenza di campioni <m:math>
	  <m:apply>
	      <m:ci type="fn">y</m:ci>
	      <m:ci>n</m:ci>
	  </m:apply>
	</m:math>. Se i campioni vengono da una serie temporale si
      parla di <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">sistemi a tempo discreto</term>. In questo modulo
      non ci occuperemo di elaborazione nel tempo continuo, anche se i
      principi descritti si possono generalizzare anche al caso di
      segnali di variabile continua. Invece, la sequenza di numeri può
      provenire dal campionamento di una immagine, e in questo caso
      sarà opportuno parlare di <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">sistemi a spazio discreto</term>
      e usare due indici <m:math> <m:ci>m</m:ci> </m:math> e <m:math>
      <m:ci>n</m:ci> </m:math> se il campionamento avviene mediante
      griglia rettangolare di righe e colonne.  </para>

      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="linearsysp">In questo modulo ci occupiamo soltanto di
      <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">sistemi lineari</term>, intendendo con questo che vale il
      <definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="superposition"> <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Principio di
      sovrapposizione degli effetti</term> <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Se <m:math>
	      <m:msub>
	      <m:ci type="fn">y</m:ci>
		<m:mn>1</m:mn>
	      </m:msub>
	</m:math> e <m:math>
	      <m:msub>
	      <m:ci type="fn">y</m:ci>
		<m:mn>2</m:mn>
	      </m:msub>
	</m:math> sono le risposte del sistema agli ingressi <m:math>
	      <m:msub>
	      <m:ci type="fn">x</m:ci>
		<m:mn>1</m:mn>
	      </m:msub>
	</m:math> e <m:math>
	      <m:msub>
	      <m:ci type="fn">x</m:ci>
		<m:mn>2</m:mn>
	      </m:msub>
	  </m:math> allora la risposta all'ingresso composito <m:math>
	      <m:apply>
		<m:plus/>
		<m:apply>
		  <m:times/>
		  <m:msub>
		    <m:ci>a</m:ci>
		    <m:cn>1</m:cn>
		  </m:msub>
		  <m:msub>
		    <m:ci>x</m:ci>
		    <m:cn>1</m:cn>
		  </m:msub>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:msub>
		    <m:ci>a</m:ci>
		    <m:cn>2</m:cn>
		  </m:msub>
		  <m:msub>
		    <m:ci>x</m:ci>
		    <m:cn>2</m:cn>
		  </m:msub>
		</m:apply>
	      </m:apply>
	    </m:math>
è l'uscita composita
<m:math>
	      <m:apply>
		<m:plus/>
		<m:apply>
		  <m:times/>
		  <m:msub>
		    <m:ci>a</m:ci>
		    <m:cn>1</m:cn>
		  </m:msub>
		  <m:msub>
		    <m:ci>y</m:ci>
		    <m:cn>1</m:cn>
		  </m:msub>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:msub>
		    <m:ci>a</m:ci>
		    <m:cn>2</m:cn>
		  </m:msub>
		  <m:msub>
		    <m:ci>y</m:ci>
		    <m:cn>2</m:cn>
		  </m:msub>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </meaning>
	</definition>
</para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="invariancep">Un altro concetto importante è quello
      della invarianza rispetto al tempo ovvero, analogamente,
      rispetto allo spazio.
	<definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="invarianced">
	  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Invarianza rispetto al tempo</term> <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Un
	  sistema è invariante rispetto al tempo se la traslazione
	  temporale di <m:math> <m:ci>D</m:ci> </m:math> campioni del
	  segnale di ingresso produce una identica traslazione nel
	  segnale di uscita, cioè <m:math> <m:apply> <m:ci type="fn">x</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>n</m:ci>
		  <m:ci>D</m:ci>
		</m:apply>
	      </m:apply>
	    </m:math> produce in uscita <m:math>	  <m:apply>
	      <m:ci type="fn">y</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>n</m:ci>
		  <m:ci>D</m:ci>
		</m:apply>
	      </m:apply>
	    </m:math>.
	  </meaning>
	</definition>
Casi di non invarianza si riscontrano laddove il sistema cambia le
proprie caratteristiche nel tempo (o nello spazio), per esempio per
effetto di controllo umano. Sono non invarianti anche quei sistemi per
i quali la frequenza di campionamento del segnale di ingresso è
diversa da quella del segnale di uscita. Ad esempio, i decimatori sono
sistemi varianti nel tempo.
</para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="chain">Una connessione in serie di blocchi lineari e
	invarianti rispetto al tempo (<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Linear
	Time-Invariant</term> - LTI) è essa stessa un sistema lineare
	e invariante rispetto al tempo, e l'ordine dei blocchi può
	essere variato senza che cambi il comportamento
	ingresso-uscita complessivo.</para> <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="lti">I sistemi
	LTI possono essere descritti completamente dalla risposta che
	forniscono ad un impulso di ampiezza unitaria.</para> 
      <definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="impulsed">
	<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Impulso nel tempo (nello spazio) discreto</term>
	<meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">è il segnale <m:math>
	    <m:ci>δ</m:ci>
	  </m:math>
 che vale <m:math> <m:cn>1</m:cn> </m:math>
	  all'istante zero (nel punto di coordinate <m:math>
	    <m:list>	    <m:cn>0</m:cn> 
	    <m:cn>0</m:cn> 
	    </m:list>
	  </m:math>), e <m:math> <m:cn>0</m:cn> </m:math> in ogni altro istante (punto).
      </meaning>
      </definition>
    </section>
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="convolution">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Risposta all'impulso e convoluzione</name> <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="impulserespp">Chiamiamo <m:math> <m:ci>h</m:ci> </m:math> il
      segnale di uscita di un sistema LTI il cui ingresso sia
      costituito da un impulso. Tale segnale di uscita viene detto
      <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">risposta all'impulso</term>.  Dal momento che qualsiasi
      segnale a tempo (spazio) discreto si può pensare come costituito
      dalla somma pesata di impulsi traslati, ogni campione che si
      presenta in ingresso <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">attiva</emphasis> una risposta
      all'impulso con una certa ampiezza determinata dal valore del
      campione stesso.  Dal momento che le risposte all'impulso si
      attivano a distanza di un campione l'una dall'altra ed hanno una
      estensione di svariati campioni, l'effetto di ciascun campione
      di input si protrae nel tempo, ovvero si estende su un certo
      numero di campioni successivi del segnale di output. Vista la
      linearità e l'invarianza temporale del sistema, le successive
      risposte all'impulso sommano i loro effetti. In altri
      termini, il sistema mantiene memoria dei campioni passati, cioè
      immessi in precedenza nel sistema, e usa questa memoria per
      influenzare il presente.</para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="piattop">
	Per avere una analogia fisica, si può pensare alla percussione
	a intervalli regolari di un piatto musicale. La risposta ad
	ogni singolo colpo si protrae nel tempo e si sovrappone alle
	risposte ad ogni colpo successivo.
      </para>
      <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="xexa">
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="xexamp">Si consideri il segnale <m:math>
	    <m:ci>x</m:ci>
	  </m:math> che sia nullo ovunque esclusi gli istanti <m:math>
	    <m:apply>
	      <m:minus/>
	      <m:mn>1</m:mn>
	    </m:apply>
	  </m:math>, <m:math>
	    <m:mn>0</m:mn>
	  </m:math>, e <m:math>
	    <m:mn>1</m:mn>
	  </m:math> in cui vale, rispettivamente <m:math>
	    <m:mn>1</m:mn>
	  </m:math>, <m:math>
	    <m:mn>0.5</m:mn>
	  </m:math>, e <m:math>
	    <m:mn>0.25</m:mn>
	  </m:math>. In ogni istante <m:math>
	    <m:ci>n</m:ci>
	  </m:math>, <m:math><m:apply>
	      <m:ci type="fn">x</m:ci>
	      <m:ci>n</m:ci>
	  </m:apply>
	  </m:math> si può esprimere come <m:math>
	      <m:apply>
		<m:plus/>
	      <m:apply>
		<m:times/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:ci type="fn">δ</m:ci>
		<m:apply>
		  <m:plus/>
		  <m:ci>n</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:cn>0.5</m:cn>
		<m:apply>
		  <m:ci type="fn">δ</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:cn>0.25</m:cn>
		<m:apply>
		  <m:ci type="fn">δ</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>n</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		</m:apply>
	      </m:apply>
	      </m:apply>
	  </m:math>. Per linearità l'uscita si può quindi ottenere per composizione di risposte all'impulso opportunamente traslate e pesate: <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">y</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:plus/>
	      <m:apply>
		<m:times/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:ci type="fn">h</m:ci>
		<m:apply>
		  <m:plus/>
		  <m:ci>n</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:cn>0.5</m:cn>
		<m:apply>
		  <m:ci type="fn">h</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:cn>0.25</m:cn>
		<m:apply>
		  <m:ci type="fn">h</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>n</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		</m:apply>
	      </m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>.
	</para>
      </example>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="xexampp">Per generalizzazione dell'esempio <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="xexa"/> si può definire l'operazione di
      <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">convoluzione</term>.</para>
      <definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="convolutiond">
	<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Convoluzione di due segnali <m:math>
	    <m:ci>h</m:ci>
	  </m:math> e <m:math>
	    <m:ci>x</m:ci>
	  </m:math>
	</term>
	<meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">y</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">h * x</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>m</m:ci>
		</m:bvar>
		<m:lowlimit><m:apply>
		    <m:minus/>
		    <m:infinity/>
		  </m:apply>
		</m:lowlimit>
		<m:uplimit>
		  <m:infinity/>
		</m:uplimit>
		<m:apply>
		  <m:times/>
 	      <m:apply>
		<m:ci type="fn">x</m:ci>
		<m:ci>m</m:ci>
	      </m:apply>
		<m:apply>
		  <m:ci type="fn">h</m:ci>
		  <m:apply>
		    <m:minus/>
		    <m:ci>n</m:ci>
		    <m:ci>m</m:ci>
		  </m:apply>
		</m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>

	  </m:math>
</meaning>
      </definition>

      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="invito_conv">L'operazione di convoluzione può essere
      pienamente intesa attraverso la costruzione esplicita di qualche
      esempio di prodotto di convoluzione. Il modulo <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m10087">Discrete-Time Convolution</cnxn> offre la
      costruzione grafica di un esempio e rimanda a ulteriori esempi
      disponibili in rete. </para>
      <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Proprietà</name> <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="proprietap">Le proprietà
	dell'operazione di convoluzione sono ben illustrate nel modulo
	<cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m10088">Properties of
	Convolution</cnxn>. Quella più interessante in questa
	sede è la estensione:</para>
	<rule xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="estensione_conv" type="property">
	  <statement xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	   <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="estensionepp">
	      Se <m:math> <m:apply> <m:ci type="fn">x</m:ci>
	    <m:ci>n</m:ci>
	      </m:apply>
	      </m:math> è estesa su <m:math>
		<m:msub>
		  <m:ci>M</m:ci>
		  <m:mn>1</m:mn>
		</m:msub>
	      </m:math> campioni, e <m:math> <m:apply>
		<m:ci type="fn">h</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      </m:math> è estesa su <m:math> <m:msub> <m:ci>M</m:ci>
<m:mn>2</m:mn> </m:msub> 	      </m:math> campioni, allora il prodotto di convoluzione <m:math> <m:apply>
		<m:ci type="fn">y</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      </m:math> è esteso su <m:math>
		<m:apply>
		  <m:plus/>		<m:msub>
		  <m:ci>M</m:ci>
		  <m:mn>1</m:mn>
		</m:msub>
		<m:msub>
		  <m:ci>M</m:ci>
		  <m:mn>2</m:mn>
		</m:msub>
                </m:apply>
		  <m:apply>
		    <m:minus/>
		    <m:cn>1</m:cn>
		  </m:apply>
	      </m:math> campioni.
	    </para>
	  </statement>
	</rule>
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="lungop">Quindi il segnale prodotto di convoluzione
	sarà più lungo sia del segnale di ingresso sia della risposta
	all'impulso.</para> <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="commutap">Un'altra proprietà
	interessante è la commutatività dell'operatore di
	convoluzione, secondo la quale segnale di ingresso
	e risposta all'impulso possono scambiare i loro ruoli senza
	che cambi il segnale di uscita.</para>
      </section>
    </section>
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Risposta in Frequenza e Filtraggio</name>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="freqrespp">La <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m0046">trasformata di Fourier</cnxn> della risposta all'impulso viene chiamata <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Risposta in Frequenza</term> e si indica con <m:math>
	  <m:apply>
	    <m:ci type="fn">H</m:ci>
	    <m:ci>ω</m:ci>
	  </m:apply>
	</m:math>. La trasformata di Fourier dell'uscita del sistema
	si ottiene dalla trasformata di Fourier dell'ingresso mediante
	moltiplicazione per la risposta in frequenza, cioè <m:math>
	  <m:apply>
	    <m:eq/>
	  <m:apply>
	    <m:ci type="fn">Y</m:ci>
	    <m:ci>ω</m:ci>
	  </m:apply>
	    <m:apply>
	      <m:times/>
	  <m:apply>
	    <m:ci type="fn">H</m:ci>
	    <m:ci>ω</m:ci>
	  </m:apply>
	  <m:apply>
	    <m:ci type="fn">X</m:ci>
	    <m:ci>ω</m:ci>
	  </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>.
 </para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sagomap">
	La risposta in frequenza sagoma, in maniera moltiplicativa, lo
	spettro del segnale di ingresso o, in altri termini, opera un
	<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">filtraggio</term> esaltando talune frequenze ed
	attenuandone altre. Il filtraggio può operare anche sulla fase
	delle componenti spettrali, ritardandole in misura diversa.
      </para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="filtraggio">
	Il filtraggio può avvenire nel <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dominio del
	tempo</emphasis> (o dello spazio), mediante operazione di
	convoluzione, o nel <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dominio delle
	frequenze</emphasis> mediante moltiplicazione per la risposta
	in frequenza.
      </para>
      <exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="primofiltro">
	<problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="primofiltropp">Si utilizzi la risposta all'impulso  nulla ovunque esclusi gli istanti <m:math>
	    <m:apply>
	      <m:minus/>
	      <m:mn>1</m:mn>
	    </m:apply>
	  </m:math>, <m:math> <m:mn>0</m:mn> </m:math>, e <m:math>
	    <m:mn>1</m:mn> </m:math> in cui valga, rispettivamente
	    <m:math> <m:mn>1</m:mn> </m:math>, <m:math>
	    <m:mn>0.5</m:mn> </m:math>, e <m:math> <m:mn>0.25</m:mn>
	    </m:math>, per ridefinire l'operazione di filtraggio
	    <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">filtra()</code> del <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m12664" target="sound_chooser">Sound Chooser</cnxn> presentato nel
	    modulo <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m12664">Media Representation in
	    Processing</cnxn>. In questo caso il filtraggio è
	    realizzato nel dominio del tempo mediante convoluzione
	    diretta.
	  </para>
	</problem>
	<solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	  <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="block">
          <![CDATA[       
	  void filtra(float[] DATAF, float[] DATA, float WC, float RO) {
	    //WC and R0 are useless, here kept only to avoid rewriting other
	    //parts of code
	    for(int i = 2; i < DATA.length-1; i++){
	      DATAF[i] = DATA[i+1] + 0.5*DATA[i] + 0.25*DATA[i-1];
	      }
	    }
             ]]>	      
	  </code>
	</solution>
      </exercise>
      <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Causalità</name>
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="causalityp">
	  La nozione di causalità è piuttosto intuitiva: essa
	  corrisponde all'esperienza di stimolare un sistema ed
	  ottenere una risposta a tale stimolazione solo per istanti
	  del tempo futuro. Per sistemi LTI a tempo discreto, ciò
	  corrispondere ad avere la risposta all'impulso nulla per
	  istanti di tempo (discreto) negativi. Sistemi LTI causali
	  possono produrre senza ritardo un'uscita campione per
	  campione, in quanto la convoluzione va ad elaborare solo
	  valori dell'ingresso passato e presente. Nell'<cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="primofiltro"/> la risposta all'impulso è non
	  causale, ma ciò non costituisce un problema perché è già a
	  disposizione l'intero segnale di ingresso e l'elaborazione
	  opera sull'intero blocco di campioni.
	</para>
      </section>
    </section>
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Filtraggio in 2D</name> 
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="imgprcp">
	Le nozioni di risposta all'impulso, convoluzione, risposta in
	frequenza, e filtraggio si estendono in maniera naturale dal
	1D al 2D, e costituiscono concetti fondamentali
	dell'elaborazione di immagini. 
      </para>
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="convolve2D">
      <definition xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="convolution2dd">
	<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Convoluzione di due segnali 2D (immagini)</term>
	  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">y</m:ci>
		<m:ci>m</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">h * x</m:ci>
		<m:ci>m</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>k</m:ci>
		</m:bvar>
		<m:lowlimit><m:apply>
		    <m:minus/>
		    <m:infinity/>
		  </m:apply>
		</m:lowlimit>
		<m:uplimit>
		  <m:infinity/>
		</m:uplimit>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>l</m:ci>
		</m:bvar>
		<m:lowlimit><m:apply>
		    <m:minus/>
		    <m:infinity/>
		  </m:apply>
		</m:lowlimit>
		<m:uplimit>
		  <m:infinity/>
		</m:uplimit>
		<m:apply>
		  <m:times/>
 	      <m:apply>
		<m:ci type="fn">x</m:ci>
		<m:ci>k</m:ci>
		<m:ci>l</m:ci>
	      </m:apply>
		<m:apply>
		  <m:ci type="fn">h</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>m</m:ci>
			<m:ci>k</m:ci>
		      </m:apply>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:ci>l</m:ci>
		      </m:apply>
		</m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	    </m:apply>
	  </m:math>
	  </meaning>
	</definition>
	Se <m:math> <m:ci>x</m:ci> </m:math> è l'immagine di
	  interesse, è facile rendersi conto che la convoluzione
	  avviene tramite moltiplicazione e traslazione nello spazio
	  di una <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">maschera di convoluzione</term> o
	  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">kernel</term> <m:math> <m:ci>h</m:ci> </m:math> (la
	  risposta all'impulso del sistema di elaborazione).  Così
	  come nel caso 1D il filtraggio può essere pensato come una
	  combinazione di un gruppo di campioni contigui (dove la
	  estensione del gruppo dipende dalla estensione della
	  risposta all'impulso del filtro) che viene ripetuta nel
	  tempo, campione per campione, così nello spazio il
	  filtraggio può essere visto come una combinazione di una
	  porzione di campioni (insieme pixel contigui), la cui
	  estensione è data dalla maschera di convoluzione. Quella che
	  nel tempo era un effetto della memoria del sistema, nel caso
	  delle immagini diventa una <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">influenza a
	  distanza</emphasis>.  </para> <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="freqresp2Dp">Come
	  nel caso 1D, la trasformata di Fourier della risposta
	  all'impulso viene chiamata <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Risposta in
	  Frequenza</term> e si indica con <m:math>
	  <m:apply>
	    <m:ci type="fn">H</m:ci>
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>X</m:mn>
		</m:msub>
	      </m:ci> 
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>Y</m:mn>
		</m:msub>
	      </m:ci> 
	  </m:apply>
	</m:math>. La trasformata di Fourier dell'uscita del sistema
	si ottiene dalla trasformata di Fourier dell'ingresso mediante
	moltiplicazione per la risposta in frequenza, cioè <m:math>
	  <m:apply>
	    <m:eq/>
	  <m:apply>
	    <m:ci type="fn">Y</m:ci>
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>X</m:mn>
		</m:msub>
	      </m:ci> 
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>Y</m:mn>
		</m:msub>
	      </m:ci> 
	  </m:apply>
	    <m:apply>
	      <m:times/>
	  <m:apply>
	    <m:ci type="fn">H</m:ci>
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>X</m:mn>
		</m:msub>
	      </m:ci> 
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>Y</m:mn>
		</m:msub>
	      </m:ci> 
	  </m:apply>
	  <m:apply>
	    <m:ci type="fn">X</m:ci>
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>X</m:mn>
		</m:msub>
	      </m:ci> 
	      <m:ci>		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mn>Y</m:mn>
		</m:msub>
	      </m:ci> 
	  </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>.
 </para>    
      <exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="convolve2dprob">
	<problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	  <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="convolve2dprobp">Considerato il codice Processing
	  dell'<link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" src="http://www.processing.org/learning/examples/blur.html">esempio
	  di blurring</link>, si isolino le linee che
	  realizzano l'operazione di convoluzione.
	  </para>
	</problem>
	<solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	  <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="block">
          <![CDATA[       
for(int y=0; y<height; y++) { 
  for(int x=0; x<width/2; x++) { 
    float sum = 0; 
    for(int k=-n2; k<=n2; k++) { 
      for(int j=-m2; j<=m2; j++) { 
        // Reflect x-j to not exceed array boundary 
        int xp = x-j; 
        int yp = y-k; 
        //... omissis ...
	//auxiliary code to deal with image boundaries   
        sum = sum + kernel[j+m2][k+n2] * red(get(xp, yp)); 
      } 
    } 
    output[x][y] = int(sum);  
  } 
} 
             ]]>	      
	  </code>
	</solution>
      </exercise>
</section>
  </content>
  
</document>
