**- DSP log - http://www.dsplog.com -**

Signal to quantization noise in quantized sinusoidal

Posted By __Krishna Sankar__ On March 19, 2007 @ 3:15 am In __Analog__ | __7 Comments__

In problem 4.37 of DSP-Proakis ^{[1]} [1], the task is to analyze the total harmonic distortion in quantized sinusoidal, where .

My take:

As detailed in the previous problem (4.36 in DSP-Proakis ^{[1]} [1]), due to imperfections in practical generation of sinusoidals, apart from the power at the desired frequency, there will be non-zero power for other frequency components as well. This undesirable spurious power typically measured as,total harmonic distortion (THD) is:

where

and .

Note that this definition is different from the definition provided from [3] – “Total harmonic distortion (THD) is the ratio of the rms value of the fundamental signal to the mean value of the root-sum-square of its harmonics (generally, only the first 5 harmonics are significant)“.

The definition provided from [1] can be considered as the the signal to quantization noise ratio (SQNR) where the quantization noise includes the noise power at the harmonics of the desired frequency as well as the noise in other frequency components in .

Using bits for quantization, the signal range of 2 units is divided into steps i.e each step is of range units. The original samples of are rounded (quantized) towards the nearest bin location i.e. the quantized signal is .

The error due to quantization is .

In an article from Analog Devices[2], the author has mentioned that – “quantization error for any ac signal which spans more than a few LSBs can be approximated by an uncorrelated sawtooth waveform“.

The error signal lies uniformly in the range and the root mean square value of the error signal is

.

(For details refer Eq 9.2.7. Section 9.2.3 in [1]).

The root mean square value of the signal sine wave, .

Summarizing, the signal to quantization noise ratio (SQNR) in decibels is:

.

With this mathematical analysis as a background, let us move on to obtaining the results from quick MATLAB simulations with levels.

b = 8;x = sin(2*pi*[0:1/50:1]); xq = round(x*2^(b-1))/2^(b-1); ex = x-xq; SQNR_xdB = 10*log10((x*x')/(ex*ex')) y = sin(2*pi*[0:1/100:1]); yq = round(y*2^(b-1))/2^(b-1); ey = y-yq; SQNR_ydB = 10*log10((y*y')/(ey*ey'))

For this example, as the sampling clock is an integer multiple of the signal frequency, the quantization noise is correlated and the energy is concentrated in the harmonics of the signal. However, the root mean square value of the noise remains approximately [2].

This can explain the facts that the simulated SQNR values, are different from the theoretical values by around 0.5dB, 1.5dB for SQNR_ydB and SQNR_xdB respectively.

Probable fix for making the noise uncorrelated is to have either have a slight offset of the frequency to remove the integer relationship [2] OR by increasing the sampling frequency. For example, if we consider a new sinusoidal z with , which is of very low frequency when compared to x, y and simulate the SQNR, we can find that the simulation and the theory are in good agreement.

b = 8; z= sin(2*pi*[0:1/10000:1]); zq = round(z*2^(b-1))/2^(b-1); ez = z-zq; SQNR_zdB = 10*log10((z*z')/(ez*ez')) hist(ez); % can see the uniformly distributed error figure plot(sort(ez)); % can see a nice sawtooth waveform

Note that in practical scenarios as the input to the analog to digital converter will consist of a band of frequencies (and not a single frequency), the assumption of uniformly distributed quantization noise over is valid.

[2] Application Note from Analog Devices, ^{[1]} MT-001: Taking the Mystery out of the Infamous Formula, “SNR=6.02N + 1.76dB,” ^{[2]} and Why You Should Care, Walt Kester, REV. 0, 10-03-2005 (link checked on March19th 2007)

[3] Application Note from Analog Devices, MT-003: Understand SINAD, ENOB, SNR, THD, THD + N, and SFDR so You Don’t Get Lost in the Noise Floor ^{[3]}, by Walt Kester, REV. 0, 10-03-2005 (link checked on March19th 2007)

Article printed from DSP log: **http://www.dsplog.com**

URL to article: **http://www.dsplog.com/2007/03/19/signal-to-quantization-noise-in-quantized-sinusoidal/**

URLs in this post:

[1] DSP-Proakis: **http://www.amazon.com/Digital-Signal-Processing-Principles-Applications/dp/8120311299**

[2] MT-001: Taking the Mystery out of the Infamous Formula, “SNR=6.02N + 1.76dB,”: **http://www.analog.com/en/content/0,2886,761%255F795%255F88014,00.html**

[3] MT-003: Understand SINAD, ENOB, SNR, THD, THD + N, and SFDR so You Don’t Get Lost in the Noise Floor: **http://www.analog.com/en/content/0,2886,760%255F788%255F91250,00.html**

[4] click here to SUBSCRIBE : **http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1348583&loc=en_US**

Click here to print.

Copyright © 2007-2012 dspLog.com. All rights reserved. This article may not be reused in any fashion without written permission from http://www.dspLog.com.