ADC: quantizzazione e codifica delle ampiezze dei campioni

Linguaggi di programmazione: php, perl, python, C, bash e tutti gli altri.
Scrivi risposta
Avatar utente
ubuntumate
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1180
Iscrizione: giovedì 28 maggio 2015, 18:18
Distribuzione: Windows 7
Sesso: Maschile
Località: Milano

ADC: quantizzazione e codifica delle ampiezze dei campioni

Messaggio da ubuntumate »

Devo quantizzare e codificare un range di temperature che compreso tra -40 °F e +115 °F. I valori possibili che il sensore di temperatura può rilevare sono 156 se ha una tolleranza di 1 °F. Avendo a disposizione 16 parole per codificare la temperatura registrata, devo associare una parola a ogni intervallo di 10 gradi Fahrenheit. È corretto?
Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.
ACM/IEEE Code of ethics.
Avatar utente
vbextreme
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1214
Iscrizione: domenica 12 gennaio 2014, 14:06
Desktop: lxde
Distribuzione: xubuntu 14.10

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da vbextreme »

generalmente quei sensori vanno dai -40°C ai +115°C o da 0° a 155°, in base alla configurazione.
non ho capito il discorso di "16 parole", se hai 16 bit quindi 65536 possibili valori ogni valore corrisponderà a 0,00238° mentre ogni grado corrisponerà a 420,1
Easy framework per il linguaggio C.
vbextreme hack your life
Avatar utente
ubuntumate
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1180
Iscrizione: giovedì 28 maggio 2015, 18:18
Distribuzione: Windows 7
Sesso: Maschile
Località: Milano

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da ubuntumate »

Ciao @vbextreme.

Il problema è puramente teorico e perciò si decide di usare solo 16 combinazioni che corrispondo alle tensioni 0,1,2......15 Volt. Le temperature variano da -40° F e +115 °F, cioè -4 °C e + 46 °C. I valori tra -40 e 115, estremi compresi, sono 156 e perciò, per dividere tutto il range in 16 quanti ho fatto 156/16, ottenendo che ogni parola viene associata a un range di 10 gradi Fahrenheit. Nel libro di testo il range per parola è pari a 5 °F e viene calcolato così: (115 - 40)/16.
Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.
ACM/IEEE Code of ethics.
Avatar utente
M_A_W_ 1968
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 856
Iscrizione: venerdì 15 febbraio 2013, 3:57
Desktop: KDE
Distribuzione: SuSE
Sesso: Maschile
Località: Un luogo geometrico
Contatti:

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da M_A_W_ 1968 »

ubuntumate [url=http://forum.ubuntu-it.org/viewtopic.php?p=4911632#p4911632][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:Il problema è puramente teorico e perciò si decide di usare solo 16 combinazioni che corrispondo alle tensioni 0,1,2......15 Volt. Le temperature variano da -40° F e +115 °F, cioè -4 °C e + 46 °C. I valori tra -40 e 115, estremi compresi, sono 156 e perciò, per dividere tutto il range in 16 quanti ho fatto 156/16, ottenendo che ogni parola viene associata a un range di 10 gradi Fahrenheit. Nel libro di testo il range per parola è pari a 5 °F e viene calcolato così: (115 - 40)/16.
Questo nel libro di testo. Invece noi, che abbiamo frequentato con profitto la seconda media, osiamo scrivere:
R = (115 - (-40)) / 16

D'altro canto anche su wikipedia le potenze del -1 e le moltiplicazioni col segno sono un mistero misterioso, vedi l'history della voce sulla successione di Fibonacci e in particolare la povera formula di Binet. :cry: :nono: :muro:
Sì, un blog ce l'ho perfino io: gli è che mi manca il tempo...

"...in una società che sembra sempre più spaventata dai problemi troppo articolati e che rigetta come un corpo estraneo ogni elemento di complessità, sapremo ancora come utilizzare il parere degli esperti?"
Avatar utente
ubuntumate
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1180
Iscrizione: giovedì 28 maggio 2015, 18:18
Distribuzione: Windows 7
Sesso: Maschile
Località: Milano

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da ubuntumate »

@MAW: il testo in questione è il Kime-Mano. Quando trovo qualcosa che non va penso sempre che sia io ad essermi incartato in qualche sciocchezza. In genere i libri non sbagliano. Però nell'edizione italiana c'è scritto:
A titolo esemplificativo, se l'intervallo di temperatura iniziale -40° F - +115° F viene diviso in 16 intervalli di quantizzazione, il valore binario associato a ciascuno di tali intervalli rappresenterà un intervallo pari a (115-40)/16 F=5° F per cui le temperature che differiscono di meno di 5° F avranno la stessa rappresentazione in binario.
Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.
ACM/IEEE Code of ethics.
Avatar utente
M_A_W_ 1968
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 856
Iscrizione: venerdì 15 febbraio 2013, 3:57
Desktop: KDE
Distribuzione: SuSE
Sesso: Maschile
Località: Un luogo geometrico
Contatti:

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da M_A_W_ 1968 »

I migliori libri sono sottoposti a revisioni ed editing da parte di esperti con elevato profilo di professionalizzazione, senza contare che talora (come in questo caso) gli autori sono a loro volta dei veri e propri mostri sacri. In questo consiste il loro notevole valore epistemico, assolutamente superiore a quello di qualsiasi ciofeca raffazzonata da un Pinco Pallino qualsiasi sul web (a maggior ragione se ha "studiato" su wikipedia o su altri cialtroneschi e sgangheratissimi tutorial partoriti diuturnamente dal gremitissimo caravanserraglio dei suoi pari, pieno di capre, asini, bestie assortite e lucignoli varii).

Tuttavia, specialmente parlando di traduzioni, purtroppo esistono sempre eccezioni alla regola generale, anche se fortunatamente sono rare e di secondaria o terziaria importanza.
Sì, un blog ce l'ho perfino io: gli è che mi manca il tempo...

"...in una società che sembra sempre più spaventata dai problemi troppo articolati e che rigetta come un corpo estraneo ogni elemento di complessità, sapremo ancora come utilizzare il parere degli esperti?"
Avatar utente
Claudio_F
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1463
Iscrizione: lunedì 28 maggio 2012, 18:49
Desktop: Mate/Gnome
Distribuzione: Ubu22.04

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da Claudio_F »

Immagine
Avatar utente
ubuntumate
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1180
Iscrizione: giovedì 28 maggio 2015, 18:18
Distribuzione: Windows 7
Sesso: Maschile
Località: Milano

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da ubuntumate »

Dall'edizione in inglese
A wireless weather station measures a number of weather parameters at an out-
door site and transmits them for display to an indoor base station. Its operation
can be illustrated by considering the temperature measurement illustrated in Fig-
ure 4 with reference to the block diagram in Figure 3. Two embedded microproces-
sors are used, one in the outdoor site and the other in the indoor base station.
The temperature at the outdoor site ranges continuously from -40°F to
+115°F. Temperature values over one 24-hour period are plotted as a function of
time in Figure 4(a). This temperature is measured by a sensor consisting of a ther-
mistor (a resistance that varies with temperature) with a fixed current applied by
an electronic circuit. This sensor provides an analog voltage that is proportional to
the temperature. Using signal conditioning, this voltage is changed to a continuous
voltage ranging between 0 and 15 volts, as shown in Figure 4(b).
The analog voltage is sampled at a rate of once per hour (a very slow sam-
pling rate used just for illustration), as shown by the dots in Figure 4(b). Each
value sampled is applied to an analog-to-digital (A/D) converter, as in Figure 3,
which replaces the value with a digital number written in binary and having deci-
mal values between 0 and 15, as shown in Figure 4(c). A binary number can be
interpreted in decimal by multiplying the bits from left to right times the respective
weights, 8, 4, 2, and 1, and adding the resulting values. For example, 0101 can be
interpreted as 0 x 8 + 1 x 4 + 0 x 2 + 1 x 1 = 5 . In the process of conversion, the
value of the temperature is quantized from an infinite number of values to just 16
values. Examining the correspondence between the temperature in Figure 4(a) and
the voltage in Figure 4(b), we find that the typical digital value of temperature rep-
resents an actual temperature range up to 5 degrees above or below the digital
value. For example, the analog temperature range between -25 and -15 degrees is
represented by the digital temperature value of -20 degrees. This discrepancy
between the actual temperature and the digital temperature is called the quantiza-
tion error. In order to obtain greater precision, we would need to increase the num-
ber of bits beyond four in the output of the A/D converter.
C'è un certa differenza tra le due versioni. E inoltre nella versione inglese (sempre quarta edizione) ci sono ben 6 capitoli in più che vanno da "Memory basics" fino a "RISC e CISC CPU", totalmente assenti nell'edizione che io possiedo. In ogni caso l'intervallo è di 10° F e il caso è chiuso.
Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.
ACM/IEEE Code of ethics.
Avatar utente
M_A_W_ 1968
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 856
Iscrizione: venerdì 15 febbraio 2013, 3:57
Desktop: KDE
Distribuzione: SuSE
Sesso: Maschile
Località: Un luogo geometrico
Contatti:

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da M_A_W_ 1968 »

ubuntumate [url=http://forum.ubuntu-it.org/viewtopic.php?p=4911663#p4911663][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:C'è un certa differenza tra le due versioni. E inoltre nella versione inglese (sempre quarta edizione) ci sono ben 6 capitoli in più che vanno da "Memory basics" fino a "RISC e CISC CPU", totalmente assenti nell'edizione che io possiedo. In ogni caso l'intervallo è di 10° F e il caso è chiuso.
Non a caso insisto sempre, usque ad nauseam, per l'acquisto delle edizioni originali. :birra: :ciao:
Sì, un blog ce l'ho perfino io: gli è che mi manca il tempo...

"...in una società che sembra sempre più spaventata dai problemi troppo articolati e che rigetta come un corpo estraneo ogni elemento di complessità, sapremo ancora come utilizzare il parere degli esperti?"
Avatar utente
ubuntumate
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1180
Iscrizione: giovedì 28 maggio 2015, 18:18
Distribuzione: Windows 7
Sesso: Maschile
Località: Milano

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da ubuntumate »

@Claudio_F: step = (Tmax - Tmin + 1)/ points secondo me. Il + 1 serve ad includere lo zero e points coincide con le parole a disposizione.

@MAW: infatti d'ora in avanti seguirò il tuo consiglio.
Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.
ACM/IEEE Code of ethics.
Avatar utente
Claudio_F
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1463
Iscrizione: lunedì 28 maggio 2012, 18:49
Desktop: Mate/Gnome
Distribuzione: Ubu22.04

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da Claudio_F »

ubuntumate ha scritto:step = (Tmax - Tmin + 1)/ points secondo me. Il + 1 serve ad includere lo zero e points coincide con le parole a disposizione.
Il delta per me è sempre Tmax - Tmin, invece per i 16 mi sa che è così (mi sono confuso sul fondoscala), ho modificato anche il primo disegno. Un ADC può avere anche questa seconda funzione di trasferimento, alla fine cambia solo il valore dell'errore sul singolo campione:
Immagine
Avatar utente
ubuntumate
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1180
Iscrizione: giovedì 28 maggio 2015, 18:18
Distribuzione: Windows 7
Sesso: Maschile
Località: Milano

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da ubuntumate »

Alla fine sono 15 intervalli e 16 punti. Con 4 bit rappresenti 16 temperature differenti e 15 intervalli.
Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.
ACM/IEEE Code of ethics.
Avatar utente
Dclaudio1990
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 624
Iscrizione: sabato 11 aprile 2015, 14:31
Distribuzione: openSUSE
Sesso: Maschile
Località: Roma

Re: ADC: quantizzazione e codifica delle ampiezze dei campio

Messaggio da Dclaudio1990 »

ubuntumate [url=http://forum.ubuntu-it.org/viewtopic.php?p=4911663#p4911663][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:Dall'edizione in inglese
A wireless weather station measures a number of weather parameters at an out-
door site and transmits them for display to an indoor base station. Its operation
can be illustrated by considering the temperature measurement illustrated in Fig-
ure 4 with reference to the block diagram in Figure 3. Two embedded microproces-
sors are used, one in the outdoor site and the other in the indoor base station.
The temperature at the outdoor site ranges continuously from -40°F to
+115°F. Temperature values over one 24-hour period are plotted as a function of
time in Figure 4(a). This temperature is measured by a sensor consisting of a ther-
mistor (a resistance that varies with temperature) with a fixed current applied by
an electronic circuit. This sensor provides an analog voltage that is proportional to
the temperature. Using signal conditioning, this voltage is changed to a continuous
voltage ranging between 0 and 15 volts, as shown in Figure 4(b).
The analog voltage is sampled at a rate of once per hour (a very slow sam-
pling rate used just for illustration), as shown by the dots in Figure 4(b). Each
value sampled is applied to an analog-to-digital (A/D) converter, as in Figure 3,
which replaces the value with a digital number written in binary and having deci-
mal values between 0 and 15, as shown in Figure 4(c). A binary number can be
interpreted in decimal by multiplying the bits from left to right times the respective
weights, 8, 4, 2, and 1, and adding the resulting values. For example, 0101 can be
interpreted as 0 x 8 + 1 x 4 + 0 x 2 + 1 x 1 = 5 . In the process of conversion, the
value of the temperature is quantized from an infinite number of values to just 16
values. Examining the correspondence between the temperature in Figure 4(a) and
the voltage in Figure 4(b), we find that the typical digital value of temperature rep-
resents an actual temperature range up to 5 degrees above or below the digital
value. For example, the analog temperature range between -25 and -15 degrees is
represented by the digital temperature value of -20 degrees. This discrepancy
between the actual temperature and the digital temperature is called the quantiza-
tion error. In order to obtain greater precision, we would need to increase the num-
ber of bits beyond four in the output of the A/D converter.
C'è un certa differenza tra le due versioni. E inoltre nella versione inglese (sempre quarta edizione) ci sono ben 6 capitoli in più che vanno da "Memory basics" fino a "RISC e CISC CPU", totalmente assenti nell'edizione che io possiedo. In ogni caso l'intervallo è di 10° F e il caso è chiuso.
Salve,
sto studiando anche io su questo testo, e leggendo la versione inglese mi è sorto un dubbio.
Piu precisamente in questa frase For example, the analog temperature range between -25 and -15 degrees is
represented by the digital temperature value of -20 degrees
, dice che le temperature da -25 a -15 fanno parte di un singolo intervallo quantizzato.
Ma andando di logica, questa affermazione mi sembra errata, perchè in teoria gli intervalli dovrebbero partire da -40° F fino a -31° F (l'intervallo sarebbe 0000) e cosi via, se si andasse di 5 a 5 non ci sarebbero delle ambiguità?
Scusate per il ritardo dell'intervento.
:ciao:
"Io penso, dunque sono, ossia esisto."
-René Descartes
Scrivi risposta

Ritorna a “Programmazione”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 17 ospiti