Many natural and man-made signals including much of speech and music are well-modeled by the Laplace distribution. Methods of synthesizing such signals are available and sometimes preferred over traditional test signals. However, some- times those Laplace-like signals are clipped or do not exhibit inﬁnitely-long tails. These situations are analyzed to determine their variances with an application of estimating signal-to-noise ratio as they are quantized by an analog-to-digital converter. 1 Background MANY natural and man-made signals including much of speech and music are well-modeled in amplitude by the Laplace distribution [1], [2], [3], [4]. (Reference [5] includes a brief survey of Laplace and similar distribu- tion models in various applications, many outside of au- dio.) Such signals, before processing, are frequently con- verted to digital form by a uniform analog-to-digital con- verter (ADC). Laplace signal models can also be used in testing and simulations thus requiring the synthesis of suit- able signals [5]; in some usage cases the Laplace signal can be a substitute for or used in conjunction with the more common sine and uniformly distributed noise signals, pro- viding for example more realistic real-world estimates of signal-to-noise ratio (SNR) of various equipment including ADCs and communication channels than provided by the more traditional signals. Other applications include heat- ing and excursion studies of loudspeakers and other elec- tromechanical equipment. Laplace signal models are characterized by a high sharp peak near the origin and long tails that are fatter than gaus- sian tails. However, those tails are inﬁnite which is not al- ways a good modeling feature and which do not ﬁt into the ﬁnite range of a normal ADC. In addition, actual signals do not have inﬁnitely long tails and in that respect the Laplace model fails, if modestly. Actual signals can have a Laplace- like distribution except for truncated tails, and synthesized Laplace-like test signals can also have ﬁnite tails by design or default, thus making them perhaps a better model than the unmodiﬁed Laplace shape. With these considerations *Originally published on July 2, 2020. Available at engrxiv.org. This pa- per has not been peer reviewed. Jerry Bauck welcomes comments and can be reached by e-mail at this address after left-shifting each alpha charac- ter by one position, e.g., f becomes e: kfssz@cbvdl.ofu. © 2020 Jerald L. Bauckthere are two practical signal distributions that are derived from the Laplace distribution: a long-tailed distribution that has been clipped by the ADC or associated electron- ics and a truncated, ﬁnite-tailed distribution that has not been clipped. In [6], clipped audio signals are examined to ﬁnd their SNR with restoration attempted by estimating a parameter of a Gamma distribution. A naive use of the Laplace variance for the signal power in an estimate of the signal-to-noise ratio (signal-to- distortion ratio) of the quantizer can yield a number that is too high in cases where a clipped or truncated model is more appropriate. The error in SNR estimate depends upon the range and resolution of the quantizer and the width of the Laplace distribution that is assumed as a sig- nal model. As it happens, the naive application of the usual Laplace variance might be suitable in some situations but the informed engineer knows when that approximation is appropriate. The general equation for SNR in quantizer applications is SNRÆ¾2 X ¾2 E(1) where variance ¾2 Xis the power of the signal and ¾2 Eis the power of the error signal due to quantization. The ratio is commonly expressed in decibels, SNR dBÆ10log10(SNR ). Xshall be replaced herein by Lfor Laplace, Cfor clipped, and Tfor truncated, both for variances and probability density functions (PDF). To be speciﬁc, when considering the tails of Laplace- like signals relative to the quantizer range there are sev- eral possibilities. One possibility is that the tails are small enough that ignoring the problem and using ¾2 Lcauses lit- tle error in the resulting SNR estimate. Another possibility is that the signal is clipped either before or by the quan- tizer so that the signal power in the tails is captured in two 1 2 CLIPPED LAPLACE DISTRIBUTION 2 G<543210-1.0-0.50.00.51.0fL(x) xxM Figure 1: Laplace probability density function for ¯Æ0.1 with hy- pothetical lower and upper clipping or truncation levels indicated by¡xmandxM. particular quantizer regions, usually the lowest and high- est such regions but sometimes other regions depending on how the signal was clipped. A third possibility is that the quantizer is designed in such a way that its lowest and highest regions are open, capturing at least in effect any signal values that extend respectively to ¡1 andÅ1 ; as considered here, this is effectively the same as clipping the signal before encountering a quantizer with closed outer regions. Another possibility is that the signal does not have long tails but instead has distinctly ﬁnite tails that are well- modeled by the truncated distribution. And ﬁnally, there is the possibility that the signal has ﬁnite tails and is never- theless clipped; this situation can be analyzed by the tools provided but the details are omitted. 2 Clipped Laplace Distribution The Laplace probability density function (PDF) is fL(x)Æ1 2¯e¡jx¡¹j/¯(2) where ¯È0 and for present purposes the mean ¹Æ0 which is usually not restrictive for real-world signals. The vari- ance, discussed below, is ¾2 LÆ2¯2. A plot for the central part of this PDF with ¯Æ0.1 is shown in Figure 1. Consider asymmetric clipping of signal x(t)with the lower clipping level at ¡xmand the upper clipping level at xMwith xmÈ0 and xMÈ0. The clipped signal is deﬁned as xc(t)Æ8 >< >:xM x(t)¸xM x(t)¡xmÇx(t)ÇxM ¡xmx(t)· ¡xm. The probability of overload, that is, clipping, on the neg- ative side is PmÆe¡xm/¯/2 found by integrating (2) from 1.00.80.60.40.20.086420PtFigure 2: Probability of Laplace overload (clipping) as a function of¯when and xmÆxMÆ1. ¡1 to¡xmand similarly the probability of overload on the high side is PMÆe¡xM/¯/2 with a total overload probability PtÆPmÅPM. With xmÆ1 and xMÆ1,PtÆe¡1/¯which is plotted as a function of ¯in Figure 2. With a selector func- tion deﬁned as c(x)Æ( 1¡xmÇxÇxM 0 otherwise the clipped PDF is fC(x)ÆPm±(xÅxm)Åc(x)1 2¯e¡jxj/¯ÅPM±(x¡xM) where the weighted Dirac impulses ±(¢)represent the prob- ability masses due to clipping. Consider the integral I(x)Æ1 2¯Z x2e¡jxj/¯dx (3) the integrand of which is plotted in Figure 3 for ¯Æ0.1. The indeﬁnite integral is I(x)Æ8 < :ex/¯³ ¯2¡¯xÅx2 2´ xÇ0 2¯2¡e¡x ¯³ ¯2Å¯xÅx2 2´ x¸0(4) which is plotted in Figure 4 again for ¯Æ0.1. Deﬁnite inte- grals will be represented as I(x)jb a. The variance of the clipped PDF is ¾2 CÆZ1 ¡1x2fC(x)dx ÆPmx2 mÅI(x)jxM¡xmÅPMx2 M. 3 TRUNCATED LAPLACE DISTRIBUTION 3 0.0300.0250.0200.0150.0100.0050.000-1.0-0.50.00.51.0x2e|x|/ x Figure 3: Integrand for computing Laplace variance ¾2 Lwith ¯Æ 0.1. 0.0200.0150.0100.0050.000-1.0-0.50.00.51.0xI Figure 4: Indeﬁnite integral I(x)of (3) related to the Laplace vari- ance ¾2 Lwith ¯Æ0.1. The asymptotic value to the right is 2 ¯2. The integral is I(x)jxM¡xmÆ2¯2¡e¡xm ¯µ ¯2Å¯xmÅx2 m 2¶ ¡e¡xM ¯Ã ¯2Å¯xMÅx2 M 2! . Identifying Pmand PMwithin the expression, the clipped variance becomes ¾2 CÆ2¯2¡e¡xm/¯¡ ¯2Å¯xm¢ ¡e¡xM/¯¡ ¯2Å¯xM¢ . (5) The variance of the clipped signal is reduced from that of an unclipped signal with the same ¯because the impulsive masses in fC(x)are concentrated nearer to the origin than the extended regions of the tails from which they derive. As xm/¯! ¡1 and xM/¯!1 ,¾2 C!2¯2Æ¾2 L. The clipped 0.80.60.40.20.03.02.52.01.51.00.50.02CFigure 5: Clipped Laplace variance ¾2 Cversus ¯with xmÆxMÆ1. variance is plotted against ¯in Figure 5 when xmÆxMÆ1 and against xMÆxmwhen ¯Æ0.1 in Figure 6 3 Truncated Laplace Distribution The truncated Laplace PDF is derived from the Laplace PDF generally by asymmetrically truncating the tails to the left and right, then adjusting the area to restore unity area which is required of a PDF . The area lost by truncating the tails is PmÅPMso the area of the truncated function is 1¡Pm¡PMimplying that the truncated PDF is fT(x)Æ8 >>< >>:0 xÇ ¡xm e¡jxj/¯ ¯¡ 2¡e¡xm/¯¡e¡xM/¯¢¡xm·x·xM 0 xÈxM The variance of the truncated PDF is ¾2 TÆZ1 ¡1x2fT(x)dx Æ1 ¯¡ 2¡e¡xm/¯¡e¡xM/¯¢ZxM ¡xmx2e¡jxj/¯dx Æ1 1¡Pm¡PMI(x)jxM¡xm. Deﬁning BmÆe¡xm/¯¡ 2¯2Å2¯xmÅx2 m¢ BMÆe¡xM/¯¡ 2¯2Å2¯xMÅx2 M¢ the variance becomes ¾2 TÆ4¯2¡Bm¡BM 2¡e¡xm/¯¡e¡xM/¯(6) which is also reduced from ¾2 L. As with the clipped case, asxm/¯! 1 and xM/¯! 1 ,¾2 T!¾2 L. The truncated 4 SIGNAL-TO-NOISE RATIO 4 0.0200.0150.0100.0050.0001.00.80.60.40.20.02C xM Figure 6: Clipped Laplace variance ¾2 Cversus xMÆxmwith ¯Æ 0.1. variance is plotted against ¯in Figure 7 when xmÆxMÆ1 and against xMÆxmwhen ¯Æ0.1 in Figure 8. 2T xM0.0200.0150.0100.0050.0001.00.80.60.40.20.0 Figure 8: Truncated Laplace variance ¾2 Tversus xMÆxmwith ¯Æ0.1. 4 Signal-to-Noise Ratio The SNR (1) requires the noise (distortion) power of the error of a uniform quantizer; the well-known result with identical-magnitude lower and upper quantization ranges xmÆxMÆxmax and quantized output represented by a w- 2T0.300.250.200.150.100.050.003.02.52.01.51.00.50.0Figure 7: Truncated Laplace variance ¾2 Tversus ¯with xmÆxMÆ 1. bit word is ¾2 EÆ1 3x2 max 22w. If the entire Laplace signal range is assumed to ﬁt in the ADC without signiﬁcant error then SNR LÆ2¯23¢22w x2 max and SNR LdBÆ10log106Å20log10¯Å20wlog102¡20log10xmax ¼7.7815 Å20log10¯Å6.02w¡20log10xmax. Many times it is convenient to assume xmaxÆ1 which drops the rightmost term. The pieces required to complete the SNR formulas for the situations studied are available above and will be indicated here for clarity. For the clipped Laplace case, (5) applies so that SNR CÆ¾2 C ¾2 E(7) and for the truncated Laplace case (6) applies and SNR TÆ¾2 T ¾2 E. (8) The forms of these variances do not lend themselves to convenient logarithmic expressions. An application of (8) appears in [5] wherein methods of synthesizing classes of continuous deterministic bandlim- ited test signals with nearly Laplace distributions are de- scribed.