diff --git a/writing/sp4comm.multipub/120-quantization/90-qt-examples.tex b/writing/sp4comm.multipub/120-quantization/90-qt-examples.tex index 3443c5e..f3be8e9 100644 --- a/writing/sp4comm.multipub/120-quantization/90-qt-examples.tex +++ b/writing/sp4comm.multipub/120-quantization/90-qt-examples.tex @@ -1,31 +1,58 @@ \section{Odds and Ends} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{example}[Implementation of AD and DA Converters]\label{ex:qt:physAD} -Analog-to-digital conversion is a process that lives at the interface between the physical world of electrical signals and the abstract world of numeric processing; it is carried out by specialized hardware that first samples the input signal's instantaneous value and then encode this value into a binary representation suitable for use on a general-purpose processors. - -\itempar{The Op-Amp.} The fundamental component at the heart of an ADC is the operational amplifier, or \textit{op-amp}, whose symbolic representation is shown in Figure~\ref{fig:qt:opamp}. An op-amp, powered by a balanced power supply $(-V_s, V_s)$, is a differential amplifier whose output voltage is proportional to the difference between the voltages at the two inputs: +Analog-to-digital conversion is a process that lives at the interface between the physical world of electrical signals and the abstract world of numeric processing; it is carried out by specialized hardware devices that first measure the input signal's instantaneous value and then encode this value into a binary representation suitable for use on a general-purpose processors. Although a full description of the electronic circuitry used in ADCs and DACs is beyond the scope of this book, in this section we will examine the fundamental principles at work in these devices. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\putbox#1#2#3{\makebox[0in][l]{\makebox[#1][l]{}\raisebox{\baselineskip}[0in][0in]{\raisebox{#2}[0in][0in]{#3}}}} +\def\rightbox#1{\makebox[0in][r]{#1}} +\def\centbox#1{\makebox[0in]{#1}} +\def\topbox#1{\raisebox{-\baselineskip}[0in][0in]{#1}} +\def\midbox#1{\raisebox{-0.5\baselineskip}[0in][0in]{#1}} + +\begin{figure}[t] + \includegraphics[height=20mm]{\localpath{figs/opamp.ps}} +% \epsfig{file=opamp.eps}\\ + \putbox{-24mm}{18mm}{$v_p$}% + \putbox{-24mm}{5mm}{$v_n$}% + \putbox{35mm}{11.5mm}{$v_o$}% + \putbox{8mm}{-4mm}{$+V_{cc}$}% + \putbox{8mm}{27mm}{$-V_{cc}$}% +\end{figure} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\itempar{The Op-Amp.} The fundamental component at the heart of an ADC is the operational amplifier, or \textit{op-amp}, whose symbolic representation is shown in Figure~\ref{fig:qt:opamp}. An op-amp, powered by a balanced power supply $(-V_{cc}, +V_{cc})$, is a differential amplifier whose output voltage is proportional to the difference between the voltages at the two inputs: \[ - V_0 = G(V_+ - V_-). + v_0 = G(v_+ - v_-). \] The ideal op-amp has the following characteristics: \begin{itemize} - \item the input and output impedance are infinite; - \item the gain is infinite. + \item the input and output impedance are infinite; as a consequence, op-amp inputs draw no current which is ideal if we need to measure a voltage source without affecting its value. + \item the gain is infinite, which means the op-amp will saturate to $\pm V_{cc}$ as soon as the voltage difference between the inputs is nonzero. \end{itemize} -As a consequence of the first +These properties are exploited in two of the classic configurations for the device, shown in Figure~\ref{fig:qt:comp_follower}: +\begin{enumerate} + \item to build a \textit{comparator} the op-amp is used in open-loop, with the inverting input connected to a reference voltage $V_T$; if the non-inverting input is connected to a voltage larger than $V_T$, then the output will saturate to the maximum possible voltage $V_{cc}$ whereas if $v_+ < V_T$, the output will drop to $-V{cc}$. + \item to build a \textit{voltage buffer}, the op-amp is used in closed loop, with the output fed back to the non-inverting input; if a source at $v$ Volts is now applied to the inverting input, the output will instantly adjust to $v_o = v$. To understand why, assume by contradiction that $v_o > v$; since $v_o = v$ via the feedback, $v_+ - v_- < 0$ and the infinite gain would immediately drive the output down. Similarly, if it were $v_o < v$, the output would be immediately driven up, and so that the only stability point is $v_o = v$. The buffer function of the configuration derives its name from the infinite input impedance, which ensures that no current is drawn from the source applied to $v_+$; the load connected to the output will be driven at a voltage $v$ solely by the op-amp. +\end{enumerate} + +These two properties are put to use in the sampling circuit shown in Figure~\ref{fig:qt:sampler}. + \end{example} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Further Reading} Quantization is a key topic both in analog-to-digital conversion and in signal compression, but an often overlooked topic in standard texts. The book by A.\ Gersho and R.\ M.\ Gray, \textit{Vector Quantization and Signal Compression\/} (Springer, 1991) provides a good discussion of the subject. An excellent overview of quantization is given in R.\ M.\ Gray and D.\ L.\ Neuhof's article ``Quantization'', in \textit{IEEE Transactions on Information Theory\/} (October 1998). + \ No newline at end of file diff --git a/writing/sp4comm.multipub/120-quantization/figs/opamp.ps b/writing/sp4comm.multipub/120-quantization/figs/opamp.ps new file mode 100644 index 0000000..bde2d8b --- /dev/null +++ b/writing/sp4comm.multipub/120-quantization/figs/opamp.ps @@ -0,0 +1,203 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: C:/Work/EPFL/teaching/dspMooc/lectures/slides/module7/opamp2 +%%Creator: XCircuit v3.4 rev10 +%%CreationDate: Tue Jan 15 21:38:43 2013 +%%Pages: 1 +%%BoundingBox: 68 68 258 136 +%%DocumentNeededResources: font Helvetica font Times-Roman font Symbol +%%EndComments +%%BeginProlog +% +% PostScript prolog for output from xcircuit +% Version: 3.3 +% +% Electrical circuit (and otherwise general) drawing program +% +% Written by Tim Edwards 8/5/93--7/13/05 (tim.edwards@multigig.com) +% The Johns Hopkins University (1993-2004) +% MultiGiG, Inc. (2004-present) +% +%%BeginResource: procset XCIRCproc 3.3 0 +% +% supporting definitions --- these are the primary xcircuit types. + +/XCIRCsave save def +/topmat matrix currentmatrix def + +/fontslant { /slant exch def [1 0 slant 1 0 0] + exch findfont exch makefont dup length dict /ndict exch def + { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall + ndict definefont pop} def +/ul { dup type /stringtype eq showflag 1 eq and { gsave + currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_) + false charpath flattenpath pathbbox grestore exch pop 1 index + sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0 + rlineto stroke moveto } if } def +/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave + currentpoint topmat setmatrix 2 index stringwidth pop 3 index + true charpath flattenpath pathbbox grestore exch pop + exch pop topmat setmatrix (_) true charpath pathbbox grestore + exch pop 1 index sub setlinewidth exch pop currentpoint + exch 4 1 roll exch sub add moveto pop 0 rlineto stroke + moveto } if } def +/stW { gsave currentpoint newpath moveto true charpath flattenpath + pathbbox pop exch pop sub grestore } def +/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs + 0 currentpoint pop put} def +/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def +/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt + {currentpoint exch pop moveto exit} {pop} ifelse } for } def +/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt + {currentpoint exch pop moveto exit} {pop} ifelse } for } def +/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def +/hS { qS qS } def +/pspc 0 def +/cf0 { scalefont setfont } bind def +/Kn { dup kY add /kY exch def rmoveto } bind def +/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul + 0.33 mul neg Kn} def +/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul + 0.67 mul Kn } def +/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def +/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def +/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq + { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def} + {fscale0 mul fscale mul cf0} ifelse } def +/ctmk { counttomark dup 2 add -1 roll pop } bind def +/label { gsave translate 0 0 moveto dup scale neg /rotval exch def + /just exch def just 384 and 0 gt {/mshow {pop} def} {/mshow {show} + def} ifelse just 16 and 0 gt {gsave rotval rotate 0 1 dtransform + gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform + gsave pagemat setmatrix idtransform exch grestore dup abs 1e-9 lt + {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse grestore {-1 /rotval + rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse + exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and + 4 ne {12 xor} if def} {1} ifelse scale } if /showflag 0 def + /fspc pspc def /Bline 0 def /Tabs 0 array def /fscale 1.0 def + /kY 0 def gsave dup 1 add copy 0 exch 1 0 dtransform exch atan rotate + {exch dup type /stringtype eq {true charpath flattenpath} {dup type + /arraytype eq {exec} {12 string cvs true charpath flattenpath} ifelse} + ifelse} repeat pop pathbbox grestore 3 -1 roll pop 3 1 roll just + 1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5 + mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4 + and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg} + ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint + translate /showflag 1 def /Bline 0 def /Tabs 0 array def /fscale + 1.0 def /kY 0 def {dup type /stringtype eq {mshow} {dup type + /arraytype eq {exec} {12 string cvs mshow} ifelse} ifelse} repeat + grestore } def +/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label + /pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def +/pinglobal { pinlabel } def +/infolabel { pinlabel } def +/graphic { gsave 4 index cvx exec /DataSource get resetfile translate + 0 0 moveto neg rotate dup scale cvx exec image grestore } def + +/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def +/cRedef {/defColor currentcolor 3 array astore def} def +/begingate {dup type /dicttype ne {1 dict} if begin % default params + dup type /dicttype ne {1 dict} if begin % instanced params + /hlevel hlevel 1 add def /defColor currentcolor sce 3 array + astore def gsave sce translate 0 0 moveto neg rotate dup abs scale + } bind def +/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef + scb end end} bind def + +/hlevel 0 def +/tmpa [1 0 0 1 0 0] def +/gar {8 8 true tmpa {<c0 c0 00 00 0c 0c 00 00>} imagemask} bind +{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind +{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind +{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind +{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind +{8 8 true tmpa {<df cf 8f 9f fd fc f8 f9>} imagemask} bind +{8 8 true tmpa {<ff 3f 3f ff ff f3 f3 ff>} imagemask} bind 7 array astore def +/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll + neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy + gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll + { 3 index exch 5 exch put dup -8 3 index { 3 index + exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def +/setstyles { + currentlinewidth mul setlinewidth /style exch def + style 1 and 0 gt not {closepath} if + style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if + style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if + gsave style 16 and 0 gt { style 224 and -5 bitshift style 256 and 0 gt { + 7 exch sub 8 div dup 1 exch sub currentrgbcolor 3 array astore + {3 copy mul add 4 1 roll pop} forall pop pop setrgbcolor eofill} + {dup 7 lt {gar exch get ppaint} {pop eofill} ifelse} ifelse} + {style 256 and 0 gt {1 setgray eofill} if} ifelse grestore style 8 and 0 gt + style 512 eq or {newpath} {stroke} ifelse grestore} def + +/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def +/xcarc { gsave newpath arc setstyles } def +/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll + 3 index div 1 scale } def +/ele { 0 4 1 roll 0 4 1 roll } bind def +/ellipse { gsave elb newpath ele arc setmatrix setstyles } def +/pellip { elb ele arc setmatrix } def +/nellip { elb ele arcn setmatrix } def +/spline { gsave moveto curveto setstyles } def +/polyc { {lineto} repeat } bind def +/beginpath { gsave moveto } bind def +/endpath { setstyles } bind def +/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def +/psinsertion {/PSobj save def /showpage {} def /setpagedevice {pop} def bop + rotate translate dup scale} def +/end_insert {PSobj restore} def +/setpagemat {/pagemat matrix currentmatrix def} def +/inchscale {setpagemat 0.375 mul dup scale} def +/cmscale {setpagemat 0.35433071 mul dup scale} def + +%%EndResource +%%EndProlog + +% XCircuit output starts here. + +%%BeginSetup + +/opamp { +begingate +0 1.00 -80 -80 -80 80 80 0 3 polygon +(-) {/Symbol cf} 2 5 0 1.00 -61 50 label +(+) {/Symbol cf} 2 5 0 1.00 -61 -46 label +1.000 0.000 0.000 scb +(in.m) {/Times-Roman cf} 2 7 0 1.00 -80 48 pinlabel +(in.p) {/Times-Roman cf} 2 7 0 1.00 -80 -48 pinlabel +(out) {/Times-Roman cf} 2 4 0 1.00 80 0 pinlabel +endgate +} def + +/circle { +% trivial +begingate +1 1.00 16 0 6 0.00 360.00 xcarc +1 1.00 0 0 10 0 2 polygon +1.000 0.000 0.000 scb +(out) {/Times-Roman cf} 2 4 0 1.00 16 0 pinlabel +(out) {/Times-Roman cf} 2 7 0 1.00 0 0 pinlabel +endgate +} def + + +%%EndSetup + +%%Page: 1 1 +%%PageOrientation: Portrait +/pgsave save def bop +1.0000 inchscale +2.6000 setlinewidth 1728 -1264 translate + +-1.00 180 -1216 1536 opamp +1 1.00 -1408 1488 -1296 1488 2 polygon +1 1.00 -1136 1536 -1072 1536 2 polygon +1 1.00 -1296 1584 -1408 1584 2 polygon +1.00 0 -1072 1536 circle +1.00 180 -1408 1584 circle +1.00 180 -1408 1488 circle +($v_+$) {/Helvetica cf} 2 144 0 1.00 -1536 1584 label +pgsave restore showpage + +%%Trailer +XCIRCsave restore +%%EOF diff --git a/writing/sp4comm.multipub/sp4comm.tex b/writing/sp4comm.multipub/sp4comm.tex index efd189f..39444fb 100644 --- a/writing/sp4comm.multipub/sp4comm.tex +++ b/writing/sp4comm.multipub/sp4comm.tex @@ -1,180 +1,185 @@ %% Test book for multipub %% \documentclass[12pt,a4paper,fleqn]{book} % include multipub package and declare desired format (PRINT | EPUB | KINDLE) % (note: cannot use package and option formalism because it breaks LateXML) \input{../multipub/toolbox/tex/multipub} \multipub{PRINT} %\usepackage[margin=30mm]{geometry} % packages included here must be common to all versions, i.e. they need % to have LateXML bindings available \usepackage{makeidx} \usepackage{amsmath, amssymb} \usepackage{graphicx} \usepackage{url} \usepackage[]{fancyvrb} \fvset{% fontsize=\small, numbers=left } % now do target-specific includes and inits \begin{PRINT} \include{styles/printlayout} \include{styles/color} % \include{styles/grayscale} \end{PRINT} \begin{KINDLE} \include{styles/printlayout} \end{KINDLE} \begin{HTML} \include{styles/epublayout} \end{HTML} \begin{EPUB} \include{styles/epublayout} \end{EPUB} % Here we can define some macros common to all versions. This, for instance, % produces numberless sections that still appear in headers and TOC \newcommand{\codasection}[1]{% \section*{#1}% \markright{#1}% \addcontentsline{toc}{section}{#1}} \newcommand{\itempar}[1]{\par\vspace{1em}\noindent{\sffamily\bfseries #1}\hspace{1ex}} \newcommand{\circonv}{\mbox{\,$\bigcirc$\hspace{-1.8ex}\scriptsize{N} \,}} \newcommand{\Real}[1]{\mbox{Re\{$#1$\}}} \newcommand{\Imag}[1]{\mbox{Im\{$#1$\}}} \newcommand{\ztrans}{\mbox{$z$-transform}} \newcommand{\expt}[1]{\mbox{E$\left[ #1 \right]$}} \newcommand{\proba}[1]{\mbox{P[$#1$]}} \renewcommand{\Re}{\operatorname{Re}} \renewcommand{\Im}{\operatorname{Im}} \newcommand{\DFT}[1]{\mbox{DFT\big\{$#1$\big\}}} \newcommand{\DFS}[1]{\mbox{DFS\big\{$#1$\big\}}} \newcommand{\IDFT}[1]{\mbox{IDFT\big\{$#1$\big\}}} \newcommand{\DTFT}[1]{\mbox{DTFT\big\{$#1$\big\}}} \newcommand{\rect}{\operatorname{rect}} \newcommand{\sinc}{\operatorname{sinc}} \newcommand{\de}{\, \mathrm{d}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setcounter{secnumdepth}{3} \makeindex %% OUPUT SELECTOR \newif\ifexercises \newif\ifanswers %% choose one %\exercisestrue\answersfalse % only exercises %\exercisesfalse\answerstrue % only solutions \exercisestrue\answerstrue % both \multipubbegin \begin{document} \title{Test Book for PDF and EPUB} \author{Paolo Prandoni} \date{} \maketitle \frontmatter \tableofcontents %\includefile{00-intro}{00-intro} \mainmatter %\includefile{20-signals}{10-dt-signals} %\begincoda %\includefile{20-signals}{90-dt-examples} %\includefile{20-signals}{99-dt-exercises} %\endcoda % % %\includefile{30-vectors}{00-vs-vectors} % % %\includefile{40-fourier}{00-fa-intro} %\includefile{40-fourier}{10-fa-DFT} %\includefile{40-fourier}{12-fa-DFTtool} %\includefile{40-fourier}{15-fa-DFS} %\includefile{40-fourier}{20-fa-DTFT} %\includefile{40-fourier}{30-fa-tables} %\begincoda %\includefile{40-fourier}{100-fa-realtrans} %\endcoda %\includefile{50-filters}{00-lf-intro} %\includefile{50-filters}{10-lf-time} %\includefile{50-filters}{20-lf-freq} %\includefile{50-filters}{30-lf-ideal} %\includefile{50-filters}{40-lf-modulation} \begincoda %\includefile{50-filters}{90-lf-examples} %\includefile{50-filters}{99-lf-exercises} \endcoda % %\includefile{60-ztrans}{10-zt-ztrans} %\begincoda %\includefile{60-ztrans}{90-zt-examples} %\includefile{60-ztrans}{99-zt-exercises} %\endcoda % %%\includefile{70-filterdesign}{00-fd-intro} % % %\includefile{80-stochastic}{00-rn-intro} %\includefile{80-stochastic}{10-rn-spectral} %\includefile{80-stochastic}{20-rn-adaptive} %\begincoda %\includefile{80-stochastic}{90-rn-examples} %\includefile{80-stochastic}{99-rn-exercises} %\endcoda % % %\includefile{90-sampling}{00-is-intro} %\includefile{90-sampling}{10-is-interpolation} %\includefile{90-sampling}{20-is-sampling} %\includefile{90-sampling}{30-is-processing} %\begincoda %\includefile{90-sampling}{90-is-examples} %\includefile{90-sampling}{99-is-exercises} %\endcoda % % %\includefile{110-multirate}{10-mr-multirate} %\begincoda %\includefile{110-multirate}{90-mr-examples} %\includefile{110-multirate}{99-mr-exercises} %\endcoda % \includefile{120-quantization}{00-qt-intro} \includefile{120-quantization}{10-qt-quant} \includefile{120-quantization}{20-qt-oversampling} +\begincoda +\includefile{120-quantization}{90-qt-examples} +%\includefile{90-sampling}{99-is-exercises} +\endcoda +% % %\includefile{130-image}{00-ip-intro} %\includefile{130-image}{10-ip-improc} %\includefile{130-image}{20-ip-jpg} % %\backmatter %\printindex \end{document}