— A method for shaping the power spectral density (PSD) of the total error due to uniform quantisation is proposed. It utilises non-subtractive dithering, generated with a joint specification of the probability density function (PDF) and the PSD. If the dither PDF has certain properties, the expected value of the quantiser output can be linearised and the variance of the error (the error power) can be made independent of the quantiser input. It is demonstrated that making the error power independent of the input enables shaping the error PSD as a separate problem. The method relies on the use of a linear noise colouring filter and a static non-linear transform, which imposes some restrictions on the specification of the error PSD. However, it is possible to synthesise a range of filters that can be used to shape the PSD of the error. Simulations are provided to verify and illustrate the operation of the method. I. INTRODUCTION Quantisation and re-quantisation are fundamental opera- tions in digital signal processing, digital-analogue conver- sion, power electronics and measurement systems. Error is introduced since only a discrete subset of values can be represented [1,2]. Several methods can be used to shape the power spectral density (PSD) of quantisation error. Com- bined with oversampling, shaping the error PSD can be used to reduce the effective error due to quantisation by additional filtering in the frequency domain where the error power is concentrated. ∆Σ-modulation uses quantiser model feedback to shape the PSD at the output [3]. As the quantiser is discontinuous, it becomes a chaotic system with an input- dependent, empirical sense of stability [4]. An alternative is to use model predictive control (MPC) which can offer both higher performance and rigorous stability results [5,6], but comes with high computational cost. Learning control (LC) has been shown to significantly suppress quantisation error [7], and can use actual output measurements, not only model feedback, but is restricted to periodic input signals. Dithering is a feed-forward method with similar properties. An external signal is added to the input of the quantiser, and the resulting quantiser error can have a spectral dis- tribution [8,9]. Dithering has been shown to mitigate the effect of static non-linearities such as element mismatch in digital-analogue converters [10] as well as dynamic non- linearities [11,12] such as glitches in digital-analogue con- verters [13]–[15]. In this paper we study the use of non- subtractive dither (NSD). Alternatively, subtractive dithering (SD) [16] can be used, and may have more conducive properties. However it can only be utilised when the exact dither signal is available for subtraction after quantisation. Ahmad Faza’ ( ahmad.faza@uis.no ), Arnfinn A. Eielsen (eielsen@ux.uis.no ) are with the Dept. of Energy and Petroleum Engineering, University of Stavanger, Norway J. Leth ( jjl@es.aau.dk ) is with the Dept. of Electronic Systems, Automation & Control, Aalborg University, DenmarkThis is challenging to achieve in practical systems [16], and severely limits the applicability of SD in many systems. If the dither probability density function (PDF) is triangu- lar with a range that is an integer multiple of the quantisation step, the averaged response of a quantiser can be linearised and the variance of the error, or for a zero-mean signal, the error power, can be made independent of the quantiser input [8]. For the special case of a triangular PDF (TPDF), it can be produced by applying a simple difference operation to a noise signal with rectangular PDF (RPDF), causing convolution of two RPDFs, and simultaneously producing a first-order high-pass PSD [8]. The shape of the dither PSD is in this case maintained in the output, but the noise- shaping effect is modest. Here we investigate the possibility of improving the error PSD shaping when dithering. A dither signal can be produced using a pseudo-random number generator (PRNG) [17]. These typically produce a RPDF, but arbitrary PDFs can be realised e.g. by applying the inverse of the cumulative distribution function (CDF) to the PRNG output [17]. Coloured noise can be produced by spectral factorisation of a desired PSD [18], producing an implementable linear filter. Combining spectral factorisation with the inverse CDF method is not straight-forward, as the output of linear filters driven with noise will tend to a normal distribution, due to the central limit theorem [19], and conversely static non-linearities will tend to whiten the PSD of the input signal [20]. One solution to the problem of realising a noise-like signal with jointly specified PDF and PSD is to compensate for the whitening effect of the non-linearity when synthesising the colouring filter [21,22]. A. Contributions Results from [8] and the method from [22] are used to provide a novel solution to the problem of shaping the PSD of the total error due to uniform quantisation when applying a non-subtractive dither signal. As TPDF dither with proper amplitude decouples the error power from the input to the quantiser, the method in [22] is extended to find the non- linear transformation necessary such that a desired PSD for the total error is produced in the output. Simulations show that a wide range of PSDs can be realised, and significantly improved ability to shape the error can be achieved compared to the PSDs realisable using the method in [8]. B. Notation A definition is denoted by ≜and the Fourier operator is denoted F. All probabilistic considerations will be with respect to a fixed probability space (Ω,F,P), and for a random variable, g, we typically omit the dependency on ϖ∈Ω, we write g=g(ϖ). The probability density d qx y QwFig. 1. Non-subtractively dithered quantiser, with input x, dither d, quantiser input w, output y, and quantisation error q. function (PDF) of gis denoted by pg(g)and the characteristic function (cf) by Pg(u)≜F[pg](u) = E[ejug], with the ith moment of ggiven by E[gi]≜R Rgipg(g) dg, and the cumulative distribution function (CDF) is denoted Fg(a)≜Ra −∞pg(u) du. The notation is also used if gis a stochastic process, g=g(t) = g(t, ϖ), i.e. all quantities are time dependent. If ψ(τ)≜E(g(t)g(t+τ))denotes the auto- covariance function (ACF) of gwith delay operator τ, then the PSD Ψ(ω)ofgis the Fourier transform Ψ(ω) =F[ψ](ω) with ωthe angular frequency. The Heaviside step-function is defined as Γ(u)≜ 0, u≤0 1, u > 0, and convolution is defined as (f∗h)(t)≜Z∞ −∞f(τ)h(t−τ) dτ . II. ANALYTICAL FRAMEWORK A. Uniform Quantisation A mid-tread uniform quantiser, Qin Fig. 1, with step-size ∆∈R>0can be defined as Q(w)≜∆w ∆+1 2 where ⌊·⌋ denotes the floor operator. The quantisation error q(w)given an input wis defined as the function q(w)≜Q(w)−w . (1) The output can then be modelled as: y=w+q(w) =Q(w). (2) If we consider a mid-rise multi-bit quantiser with a word- size of Bbits, it has 2Boutput levels. With an output range between VminandVmaxthe step-size is ∆ =Vmax−Vmin 2B−1, (3) and in this case Q(w)can be expressed as Q(w) = ∆NTX i=1 Γ(w−Ti)−1 2 , (4) where NT= 2B−1is the number of quantisation lev- els, and the step-functions have the thresholds Ti:i∈ {1,2,3, ...N T}; where, Tj= (j−i)∆ + Tiforj > i and T2B−1= (Vmax+Vmin)/2. Fig. 2. NSD for a mid-tread uniform quantiser by dither dof PDF pd. The conditional PDF (cPDF) pε|x(ε|x)of the total error εfor a fixed input value xis an area sampled version of the quantiser input cpdf pw|x(w|x).Aiis the sampled area under pd(w−x)forw∈[−∆ 2+(k+i)∆,∆ 2+(k+i)∆]. B. Non-subtractive Dithering (NSD) Consider the quantiser configuration in Fig. 1. The total error εis defined as the difference between the output yand input x,ε≜y−x, to distinguish it from the quantisation error qin (1). For NSD ε=Q(x+d)−x=q(x+d) +d. From [8], the conditional PDF of εgiven the input xis pε|x(ε|x) =p−∞+p∞+NT−1X k=2pk (5) with pk=δ(ε+x−k∆)Z∆ 2+k∆ −∆ 2+k∆pd(w−x) dw p−∞=δ(ε+x−∆)Z∆ 2+∆ −∞pd(w−x) dw p∞=δ(ε+x−NT∆)Z∞ −∆ 2+NT∆pd(w−x) dw where δis the Dirac delta function, see Fig. 2. Note that pε|x(ε|x)cannot be rendered independent of xby any choice of dither. For given specifications of the PSD S(ω)of the total error εwe will in the sequel investigate how to generate a dither dwhich both linearises the uniform quantiser in mean, that is,E[y]becomes a linear function of x, and induces a PSD S(ω)having the required specifications. Regarding the linearisation, first note that E[y] =x+ E[ε]. Now from [8] we know that E[ε] =E[d]andE[ε2] = E[d2] +∆2 12whenever G(m) dk ∆ = 0∀k∈Z− {0}, m= 1,2 (6) with Gd(u) = sinc( u)Pd(u),G(m) dthemth derivative of Gd, and sinc(u)≜sin(π∆u) π∆u. Choosing a zero mean dither with a triangular PDF (and cf Pd= sinc2(u)) will result in (6) being fulfilled, see [8]. With this choice of dither it follows that E[ε] = 0 thus linearising the uniform quantiser Smoothing Filterv yr White NoiseQ Quantizer PDF-shaping Non-linearityPSD-shaping Filter d w x Referencey Fig. 3. Block diagram for the proposed method: White Gaussian process η, spectrally shaped Gaussian process v, dither with desired PDF d, input x, quantiser input w, quantiser output y, total error ε, and reconstructed output yr. in mean. Moreover, note how the total error εis now a zero mean stationary process with E[ε2] = ∆2/4. Hence, Var(y) =E[ε2]is constant and independent of the value of x. Furthermore, it follows from the choice of a TPDF dither, that the PSD Syof the output yis just the sum of the PSD Sof the total error εand the PSD Sxof the input x. Thus shaping Salso shapes Sy. When it comes to spectrally shaping S, it is ideally desirable to shape Ssuch that it has minimal power content at frequencies where Sxhas significant power content. For example, the reconstructed output yrafter the smoothing filter in Fig. 3 contains the low-pass power content of y where Sxis concentrated; therefore, it is advantageous to shape Sto have a high-pass power content away from Sx such that yr≈x. The best shaping performance known to be achievable using TPDF NSD is in (Sec.II-C & Sec.III-E [8]): S(ω) = S d(ω) +∆2 122 fs where fsis the Nyquist sampling frequency. Note how the shaping is limited to a quantisation noise floor of∆2 12as in the classical model of quantisation (CMQ) [9]. In Sec- III, the method in [22] is reconfigured to allow shaping the total error due to quantisation to have a desired S(ω)via the proper choice of the shape of Sd(ω)of the dither d. III. S HAPING THE PSD OF THE TOTAL ERROR A block diagram for the proposed method is shown in Fig. 3. A white, unity variance Gaussian process η(with PSD U(ω) = 1 ) is passed through a properly designed linear time- invariant (LTI) colouring filter H(jω)to shape the spectral density Φ(ω) =H(jω)H(jω)∗U(ω) =H(jω)H(jω)∗of v. The coloured noise vis then passed through a probability density shaping static non-linearity 𭟋(·)as a composition of the inverse CDF of dand the CDF of v: 𭟋(.)≜F−1 d(Fv(.)). (7) The resulting dither dwill have the necessary PDF (in this case a TPDF) and PSD for εto have a prescribed PSD S(ω). Since H(jω)is a linear filter and η∼ N(0,1), the filtered input will remain Gaussian at the filter output. However, it needs to be scaled by a factor K≜σ2 η σ2vsuch that the output also has a unity variance (i.e. v∼ N(0,1)). The relation between the PSD Φ(ω)ofv, which can be shaped using H(jω), and the desired PSD S(ω)ofεcan be described by means of the corresponding auto-correlationfunctions (normalised ACFs); ρ(τ)≜ϕ(τ) ϕ(0)where ϕ(τ) = E[v(t)v(t+τ)]andR(τ)≜s(τ) s(0)where s(τ) =E[ε(t)ε(t+ τ)] = E[ε2]R(τ). Indeed, from [22] the relation between R=R(τ)andρ=ρ(τ)is as follows: R=Z RZ Rg(m, n, ρ ) E[ε2] (Q(𭟋(m) +x)−x)(Q(𭟋(n) +x)−x) dmdn. (8) withgthe bi-variate Gaussian joint PDF g(m, n, ρ ) =e−1 2(1−ρ2)[m2+n2−2ρmn] 2πp 1−ρ2; (9) It is a property of the bi-variate Gaussian joint PDF that ∂g ∂ρ=∂2g ∂m∂n. For Q(·)in (4), we therefore get from [22]: dR dρ=∆2 E[ε2]NTX i=1NTX j=1𭟋′(m)𭟋′(n)g(m, n, ρ ) χ{𭟋(m)=Ti−x}(m)χ{𭟋(n)=Tj−x}(n);(10) where χ{}(·)is the indicator function and 𭟋−1(Tk−x)≜ˆdk. Note how varying the input value xis captured by a change in the corresponding ˆdk. Hence, the solution to (10) is a 3D surface of the variables R, ρ, x ; where for each xvalue, ρis varied in (−1,1)to find the corresponding R. Now consider v∼ N(0,1)andda TPDF dither; this means that d(t)∈[−∆,∆]. Hence x+d∈[x−∆, x+∆] , so for all x∈ (T2, TNT−1)there can only be one or two {Tk, Tk+1} ∈[x− ∆, x+ ∆] where pd̸= 0). Hence, (10) can be evaluated for the quantisation levels pair {Tk, Tk+1}when x∈(Tk, Tk+1) or at the single level Tkwhen x=Tkfork∈ {2,3, ..., N T− 2}. dR dρ=k+1X i=kk+1X j=k4𭟋′(ˆdi)𭟋′(ˆdj) 2πp 1−ρ2e−1 2(ˆdi2+ˆdj2−2ρˆdiˆdj) (1−ρ2) (11) Given the choice of das a TPDF dither, 𭟋′(·)is: 𭟋′(u) = ∆  pv(ˆu)√ 2Fv(u), u ∈(−∞,0] pv(ˆu)√ 2(1−Fv(u)), u∈[0,+∞). (12) Note how all terms in (11) are non-negative (i.e. R(ρ)is invertable since the solution to (11) is monotone). Taking R= 0 when ρ= 0, the solution to (11) at x=Tk(i.e. ˆdk=F−1 v(Fd(0)) = 0 ) is: dR dρ= 4(𭟋′(0))2g(0,0, ρ) = pv(0)p 2Fv(0)!2 4∆2 2πp 1−ρ2 Rnum= (∆ pv(0))22 πsin−1(ρ) and so ρ(τ) = sinπ 2R∝(τ) ;(13) where R∝(τ)≜max( Rnum)−min(Rnum) max( R)−min(R)R(τ) (∆pv(0))2 -2.5 -2-1.5 -1-0.5 00.5 11.5 22.500.050.10.150.20.250.3 -2.5-2-1.5-1-0.500.511.522.5Fig. 4. Dependence of E[y], E[y2]overxfor a3-Bit uniform quantiser (TPDF vs. RPDF). is a numerical scaling implemented to assure that both R(τ)and the corresponding ρ(R(τ))are in (−1,1). Note from (13) that Rnum varies in the feasible numerical range of(−(∆pv(0))2,(∆pv(0))2)asρvaries in (−1,1). Hence, to obtain ρ(τ)∈(−1,1)corresponding to a desired R(τ)∈ (−1,1), the feasible ranges (of R, R num) are mapped via R∝(in the case of (13), at x=Tk, it simplifies to R∝(τ) =R(τ)). Once the mapping ρ(R)can be obtained by (numerically) solving (10) (for a general PDF choice) or (13) (in the case of TPDF) over ρ∈(−1,1), the effect varying xhas over the feasible range of Rnum values can be investigated. More importantly however, (13) establishes the proper ρ(τ)corresponding to a desired R(τ). Note that as long as the specified s(τ) =E[ε2]R(τ)corresponds to a Φ(ω)≥0for all ω(PSDs must be non-negative), the desired shaping at the output stage is attainable. Unfortunately, Φ(ω) is not guaranteed to be non-negative at all frequencies for every specified R(τ). This is because when ρ(τ)in Eq. (8) ranges over all possible normalised ACFs, R(τ)ranges only over a subset of possible normalised ACFs [22]. So, H(jω) is synthesised to best approximate Φ(ω)as follows: LetΦ+(ω)≜Φ(ω)X{Φ(ω)≥0}(ω), then H(jω) =p Φ+(ω).(14) IV. S IMULATIONS In the simulations, the output range is set to Vmax = −Vmin = 10 . Fig. 4 shows the effect of using TPDF over RPDF dither for spectral shaping, as alluded to in the discussion of Sec. II-B. Either dither linearises the quantiser in mean, E[y] = E[x], but TPDF dither also results in a constant total power, subsequently shaped to S(ω), with Var(y)=E[ε2] = ∆2/4. The RPDF dither causes a so-called noise modulation effect, i.e. the error power varies with the input x. This effect in the case of RPDF dither can be inferred from Fig. 5, where the range of Rnum is maximum atx=Tk=k∆while it evaluates to zero as it approaches Fig. 5. The dependence of R(ρ)mapping on the input xin the case of RPDF dither. Solving (10)-(13) for Rnum(ρ, x) :ρ∈(−1,1), x∈ [Vmin+∆ 2, Vmax−∆ 2]for a3-Bit uniform quantiser. 00.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-60-55-50-45-40-35-30-25 Fig. 6. Desired vs. Achieved single-sided output PSD S(ω)for TPDF NSD of a 10−Bit uniform quantiser. midpoints between quantisation levels, R∝(R(τ))→0for allR(τ). Algorithm 1 was used to generate randomised PSDs with arbitrary shapes. Desired error PSDs must be feasible, i.e. S(ω) =S(−ω)∈R≥0and scaled to have an area equivalent to an achievable total power at the output,R RS(ω) dω= E[ε2] = ∆2/4. Figs. 6 and 7 show results of the method when shaping the PSD of εto a desired S(ω). V. R ESULTS AND DISCUSSION In order to get an indication of the range of PSDs that can be realised using the method, 3000 randomised PSD function samples were generated as described in Sec. IV. 68% of the generated PSDs were not entirely non-negative, Φ+(ω)̸= Φ( ω), indicating that there are limitations on the properties that a PSD function can exhibit in order to be fully 00.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-40-35-30-25-20-15-10-505Fig. 7. Desired vs. Achieved single-sided output PSD S(ω)for TPDF NSD of a 7−Bit uniform quantiser. Algorithm 1 PSD Generator, MATLAB G = d r s s ( 7 ) ; % Random d i s c r e t e S t a t e Space , S t a b l e SISO Gt f = t f (G) ; St f = G t f*Gtf ' ; % Real valued , non − n e g a t i v e , PSD Snum = S t f . Numerator {:}; Sden = S t f . Denominator {:}; w = l i n s p a c e ( 0 , 2 *pi ,M) ; % Sample whole c i r c l e Sf r = f r e q z ( S num , S den ,w) ; % Frequency r e s p o n s e a t w Sf r2 n o r m = sum ( abs ( S f r ) . *mean ( d i f f (w) ) ) / ( 2 *p i ) ;% 2−Norm % Normailze a r e a S (w) t o a u n i t y power Sf r = ( S f r / S f r2 n o r m ) *Var y ; % S c a l e t o f e a s i b l e power realised using the proposed method. Of the 68%, 72% of the PSDs were not non-negative for ωwhere S(ω)<∆2/12, exemplified by S2(ω)in Fig. 6. Of the 32% PSDs resulting in Φ+(ω) = Φ( ω), 94% produced the desired S(ω). Of these, 75% of the cases satisfied S(ω)>∆2/12for all ω, exemplified by S1(ω) in Fig. 7. The remaining 6% had a deviation from S(ω) when S(ω)had a concentration of power in a narrow band of frequencies, or there was a mismatch when S(ω)dropped approximately 8-dB below the CMQ noise floor, in the 8- bit quantiser case. For higher number of bits the spectral density tended to reach the CMQ noise floor. In general, the results indicate that PSDs that drop below the CMQ noise floor often have a mismatch between desired and achieved results, but the CMQ noise floor apparently is not a general lower bound, as exemplified by S1(ω)in Fig. 6 and S2(ω)in Fig. 7. These examples indicate that increased performance in terms of spectral shaping of the total error via NSD is possible, as compared to the results in Sec.II-C & Sec.III-E in [8]. Future work will focus on determining the limitations and bounds of the proposed spectral shaping method. VI. C ONCLUSIONS It was demonstrated by way of simulation that the pro- posed dithering method can provide a large degree of free- dom in shaping the spectral distribution of the total error power for a uniform quantiser. The choice of a triangular probability density for the dither makes the error powerindependent of the input, enabling shaping of the error power spectral density. This requires a jointly specified probability and spectral density for the dither, and the required results were developed in order to generate such a dither. Simulation results indicate that there are limitations to achievable spec- tral densities, and these should be investigated further. How- ever, the method can in its current form produce improved performance compared to existing non-subtractive dithering methods.