(4 votes, average: 5.00 out of 5)

Signal to quantization noise in quantized sinusoidal

by on March 19, 2007

In problem 4.37 of DSP-Proakis [1], the task is to analyze the total harmonic distortion in quantized sinusoidal, $x(n) = \sin(2\pi f_0 n)$ where $f_0 = k/N$.

My take:
As detailed in the previous problem (4.36 in DSP-Proakis [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:

$THD = 1 - \frac{2|c_{k0}|^2}{P_x}$ where

$c_{k0} = \frac{1}{N}\sum_{n=0}^{N-1}x(n)e^{\frac{-j2\pi k_0 n}{N}}$ and $P_x = \frac{1}{N}\sum_{n=0}^{N-1}|x(n)|^2$.

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 $[0\ fs/2)$.

Using $b$ bits for quantization, the signal range of 2 units is divided into $2^b$ steps i.e each step is of range $\frac{1}{2^{b-1}}$ units. The original samples of $x(n)$ are rounded (quantized) towards the nearest bin location i.e. the quantized signal is $x_q(n) = \frac{round(x(n) \times 2^{b-1})}{2^{b-1}}$.

The error due to quantization is $e_q(n) = x_q(n) - x(n)$.

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 $(-\frac{1}{2^b},\ +\frac{1}{2^b})$ and the root mean square value of the error signal ${e_q(n)}$ is
$RMS_{e_q(n)} = \sqrt{2^{b-1}\int_{-\frac{1}{2^b}}^{+\frac{1}{2^b}}e_q^2(n)de} = \frac{1}{\sqrt{3}2^{b}}$.
(For details refer Eq 9.2.7. Section 9.2.3 in [1]).

The root mean square value of the signal sine wave, $RMS_{x(n)}=\frac{1}{\sqrt{2}}$.

Summarizing, the signal to quantization noise ratio (SQNR) in decibels is:
$\begin{eqnarray}SQNR_{dB} &=& 20\log\left(\frac{\frac{1}{\sqrt{2}}}{\frac{1}{\sqrt{3}2^b}}\right) \\&=& 20\log(2^b) + 20\log\left(\sqrt{\frac{3}{2}}\right) \\&=& (6.02\times b+1.76) dB\end{eqnarray}$.

With this mathematical analysis as a background, let us move on to obtaining the results from quick MATLAB simulations with $2^8$ 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 $\frac{1}{\sqrt{3}2^b}$ [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 $f_0 = 1/10000$, 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 $[0\ fs/2)$ is valid.

References:

[2] Application Note from Analog Devices, MT-001: Taking the Mystery out of the Infamous Formula, “SNR=6.02N + 1.76dB,” 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, by Walt Kester, REV. 0, 10-03-2005 (link checked on March19th 2007)

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN.

Collette Sauceda January 13, 2015 at 1:44 pm
UlrichIsrael January 11, 2015 at 1:53 am
Van insurance brokers glasgow January 9, 2015 at 11:41 am

excellent submit, very informative. I ponder why the opposite specialists of this sector don’t
realize this. You should proceed your writing.

house plans January 7, 2015 at 11:18 pm

You’ll find three types of homebuilders today.
There’s the “high end custom show homes auckland”, the “production builder”, along with the “little, hands on builder”.
These will be the fundamental kinds at function nowadays while there are hybrid vehicles and variants within these three classes.
The trick for the prospective purchaser
is to recognize which one might be the best match due to
their pocketbook and home-style demands.

Robbie January 7, 2015 at 7:47 pm

What i do not understood is in reality how you’re no longer really a lot more smartly-preferred than you may be
rigyt now. You are so intelligent. You already know thus considerably with
regards to this subject, made me in my view imagine it from a lot of varied angles.
Its loke woen and men are not fascinated unless it is something
All the time handle it up!

gratis bingo spel January 7, 2015 at 2:07 pm

It’s really very complex in this full of activity life to listen news on Television, therefore I just use web
for that purpose, and obtain the hottest news.

CiaraDarrxnu January 6, 2015 at 6:15 pm
FrederiEfo January 4, 2015 at 8:07 pm
Lemon squeezer January 4, 2015 at 2:03 am

If some one wants to be updated with newest technologies afterward
he must be pay a visit this web site and be up
to date every day.

BrittnyQ02 January 2, 2015 at 10:33 am
RudolphQGXE January 1, 2015 at 8:22 pm
AshliStreetman January 1, 2015 at 4:25 am
Aubrey Noe December 31, 2014 at 10:38 pm
AstridMcAlister December 29, 2014 at 8:33 am
BudiwatEEEO December 27, 2014 at 7:40 pm
LangitSterner December 27, 2014 at 10:31 am
MagaretGoodman December 27, 2014 at 3:44 am
AustinLacy December 27, 2014 at 3:18 am
VirgiePalmore December 27, 2014 at 3:18 am
JGSRoxanne December 27, 2014 at 3:17 am
IsiahMcclellan December 27, 2014 at 12:17 am
WUWEdwinamrixaal December 26, 2014 at 11:58 pm
BrianneBOWD December 26, 2014 at 11:37 pm
WilhemiMagrath December 26, 2014 at 11:34 pm
Juan0234kxmwoog December 26, 2014 at 11:25 pm
StaceyGavin December 26, 2014 at 11:24 pm
KarolinKayser December 26, 2014 at 11:23 pm
EzekielCisco December 26, 2014 at 11:21 pm
TaylaTasman December 26, 2014 at 11:20 pm
MckenziLorimer December 26, 2014 at 11:19 pm
HarrietLkb December 26, 2014 at 9:17 pm
RosemarLawson December 26, 2014 at 6:09 pm
PatsyPJEZcwpf December 26, 2014 at 5:56 pm
Fatima99Sfvbwqy December 26, 2014 at 5:54 pm
AidaChdzjljq December 26, 2014 at 5:54 pm
BrianneFried December 26, 2014 at 5:46 pm
ChauD45rzgm December 26, 2014 at 5:16 am
CyrusJ12xco December 26, 2014 at 5:14 am
MarlaEYTbgf December 26, 2014 at 3:52 am
DennyVennkxoyzlg December 25, 2014 at 11:32 pm
AliLabilliere December 25, 2014 at 10:55 pm
HaroldN56zyfohoy December 25, 2014 at 9:13 pm
Melliss59C December 25, 2014 at 9:08 pm
Marilyn69F December 25, 2014 at 8:47 pm
PaulBruton December 25, 2014 at 8:19 pm
DelmarFellows December 25, 2014 at 7:03 pm
MoraMartinovich December 25, 2014 at 4:45 pm
WaldoBobovmvei December 25, 2014 at 4:38 pm
JanieMackness December 25, 2014 at 4:15 pm
MicahOrrphitnsp December 25, 2014 at 3:38 pm
ClaudetHCNK December 25, 2014 at 3:21 pm
JerriTroutman December 25, 2014 at 12:30 pm
RenateHymel December 25, 2014 at 10:28 am
Cassie25Imhrnn December 25, 2014 at 10:22 am
JaclynWainscott December 25, 2014 at 10:21 am
WYMJuanadtsg December 25, 2014 at 10:12 am
EarleneStansbury December 25, 2014 at 10:06 am
AnnettaVHN December 25, 2014 at 10:00 am
Precious December 25, 2014 at 9:14 am

How useful are the charitable organizations in the do the job they do.

SuzannaSDP December 25, 2014 at 8:50 am
OscarBanks December 25, 2014 at 8:37 am
ShoshanBrant December 25, 2014 at 6:04 am
MaurineEdmonson December 25, 2014 at 4:23 am
TajYeojiasxs December 25, 2014 at 1:40 am
NilaDethridge December 25, 2014 at 1:40 am
JaniTnhdvruoek December 24, 2014 at 5:33 am
HRJVictoryut December 24, 2014 at 4:00 am
Nola75Gbgrgf December 24, 2014 at 2:32 am
ASPMicahnrwlj December 23, 2014 at 6:59 pm
BridgetOVHV December 23, 2014 at 2:14 pm
AliCollierhbia December 23, 2014 at 10:27 am
OliverT58qtvmeyq December 23, 2014 at 9:43 am
MuoiFryman December 23, 2014 at 9:14 am
TGSNadineuj December 22, 2014 at 10:40 am
Nereida December 22, 2014 at 5:39 am

It’s difficult to find knowledgeable people for this subject, but you sound like
you know what you’re talking about! Thanks

homepage December 22, 2014 at 3:15 am

Can I simply just say what a relief to uncover somebody that truly
knows what they are discussing over the internet. You definitely know how to
bring an issue to light and make it important.

More people really need to read this and understand this side of
the story. I can’t believe you are not more popular because you surely possess the

RosemarBramlett December 22, 2014 at 3:03 am
KarolinG04 December 21, 2014 at 9:44 am
AmandaWilcox December 21, 2014 at 7:56 am
AleishaGodwin December 21, 2014 at 6:56 am
Moises3821 December 21, 2014 at 1:42 am
MaxieTreasure December 20, 2014 at 11:15 pm
Maryell4280 December 20, 2014 at 5:37 pm
ViolettWisniewsk December 20, 2014 at 3:08 pm
ChanteCollocott December 19, 2014 at 10:21 pm
AundreaHorrocks December 19, 2014 at 2:36 pm
ClemmieRymill December 19, 2014 at 2:35 pm
NellieGraebner December 19, 2014 at 12:34 pm
RodrigoPat December 18, 2014 at 11:54 pm
FrancisA56 December 18, 2014 at 9:38 pm
LesHovelldcbtsz December 18, 2014 at 9:01 pm
LonnaWatts December 18, 2014 at 4:55 pm
SalQKVwlubkdmg December 18, 2014 at 4:00 pm
VZWMatthia December 18, 2014 at 3:49 pm
TuyetK71kcu December 18, 2014 at 1:54 pm
FerdinaVanderbil December 18, 2014 at 11:43 am
HalleyStrunk December 18, 2014 at 9:59 am
Violet27Knrr December 18, 2014 at 3:43 am
CristinCory December 18, 2014 at 1:28 am
DebraBnqstfdozly December 17, 2014 at 7:44 pm
JensOuhapcoy December 17, 2014 at 12:34 pm
ElbaBoston December 17, 2014 at 11:50 am
MereditBigelow December 16, 2014 at 9:02 pm
TorstenDodds December 16, 2014 at 8:26 pm
Ingrid94Cf December 16, 2014 at 6:05 pm
LouisaP89sragyv December 16, 2014 at 2:47 pm
FawnInouye December 16, 2014 at 2:40 pm
Julienne December 15, 2014 at 8:23 pm

Hi to all, as I am genuinely keen of reading this weblog’s post to be updated daily.
It includes pleasant stuff.

MelindaBisbee December 15, 2014 at 6:52 pm
CheryleGriggs December 15, 2014 at 5:27 pm
HoseaRobledo December 15, 2014 at 4:38 pm
ChangWRFnnpbkpy December 15, 2014 at 2:55 pm
DennyLacroix December 15, 2014 at 8:56 am
KyleHargis December 15, 2014 at 8:14 am
Jodi78Vjgjobr December 15, 2014 at 6:15 am
MargartSaxton December 15, 2014 at 12:15 am
CharityAVL December 14, 2014 at 8:52 pm
grosir sprei online berkualitas December 13, 2014 at 1:07 pm

We are very happy to be here simply because it
is a great site that provides many information about your subjects protected in depth.
I am delighted to view that individuals are in fact talking about this issue ordinary clever approach, displaying you
distinct facets into it. Make sure you thanks.
My partner and i cannot delay to see whats subsequent.

KarenSantos December 13, 2014 at 11:21 am
jual grosir sprei murah December 11, 2014 at 9:48 am

Thank you with this document, Alexandre. Certainly not the kind of factor
My spouse and i comply with on my own, although this really is fantastic and My partner and i looked ahead
in order to turning out to be additional familiar with these kind of functions regarding Bach’s through most of these recordings.

StephanSVR December 11, 2014 at 8:43 am
WilmerBYFfh December 10, 2014 at 3:02 pm
ZoeB99obfvzy December 10, 2014 at 10:07 am
LydaXDXKdafopu December 10, 2014 at 1:12 am
PorterPape December 10, 2014 at 12:32 am
MaybellReginald December 10, 2014 at 12:20 am
EugeniaLzm December 10, 2014 at 12:06 am
FrederiSnow December 9, 2014 at 11:55 pm
DorisGrimstone December 9, 2014 at 11:45 pm
DebraMcCleary December 9, 2014 at 11:36 pm
Lakesha8368 December 9, 2014 at 11:22 pm
VidaPowerld December 9, 2014 at 11:21 pm
AlfonsoRoehl December 9, 2014 at 11:20 pm
ShelliN11irklek December 9, 2014 at 11:17 pm
GraceA27zbu December 9, 2014 at 11:05 pm
AuroraChirnside December 9, 2014 at 10:57 pm
LasonyaGlasgow December 9, 2014 at 10:54 pm
PenelopFlannery December 9, 2014 at 10:51 pm
GildaCapps December 9, 2014 at 10:49 pm
WernerMosier December 9, 2014 at 10:43 pm
EdgarOliva December 9, 2014 at 10:41 pm
SophiaTonkin December 9, 2014 at 10:29 pm
MohamedConlon December 9, 2014 at 10:14 pm
BradleyHite December 9, 2014 at 10:10 pm
TrudyOlive December 9, 2014 at 10:01 pm
Anthony72S December 9, 2014 at 9:56 pm
AntoineLachance December 9, 2014 at 11:41 am
PeggyBlyagvcelw December 9, 2014 at 7:05 am
Debra67Coaks December 9, 2014 at 6:34 am
SeymourSNPN December 9, 2014 at 5:51 am
ReaganLancaster December 8, 2014 at 8:50 pm
PeggyNfwfxwhen December 7, 2014 at 1:41 pm
JacquelLJZ December 7, 2014 at 11:06 am
BarbCopebagl December 6, 2014 at 6:41 pm
PhillipPIGT December 6, 2014 at 12:38 pm
DickD17cyjkxnw December 6, 2014 at 8:42 am
RaymundWollstone December 6, 2014 at 12:59 am
DeenaKnatchbull December 5, 2014 at 7:08 pm
RebekahHolton December 5, 2014 at 3:19 pm
EliMinqdenxyoq December 5, 2014 at 2:35 pm
JordanNewell December 5, 2014 at 7:16 am
JudsonJeffers December 4, 2014 at 6:05 pm
HildaMistry December 4, 2014 at 10:58 am
FlorineSargent December 4, 2014 at 9:07 am
EXUGracehykgewh December 4, 2014 at 8:39 am
FabianAJZu December 3, 2014 at 8:45 pm
JanetteRuyle December 3, 2014 at 6:55 am
JavierBailey December 3, 2014 at 5:34 am
ColumbuHorseman December 3, 2014 at 4:11 am
learn Spanish quick apply September 5, 2014 at 6:26 am

Τhank you for the auspicious writeup. It in fact was once a amusement account it.
ʟook complicated to more delivered agreeahle from you!
Howeveг, how can we keep up a correspondence?

Poppy July 17, 2014 at 11:59 pm

Hey there! Quick question that’s totally off topic. Do you know how to make your site mobile friendly?
My website looks weird when viewing from my apple iphone.

I’m trying to find a template or plugin that might be able to resolve this issue.
If you have any suggestions, please share. Thanks!

lacyzdtv.buzznet.com July 14, 2014 at 8:37 am

What’s up, just wanted to mention, I liked this blog
post. It was helpful. Keep on posting!

ประกันภัยรถ July 5, 2014 at 4:43 pm

I’m not sure why but this web site is loading incredibly slow for me.
Is anyone else having this issue or is it a issue on my end?
I’ll check back later on and see if the problem still exists.

esperanzacampos.pen.io June 21, 2014 at 8:28 am

An outstanding share! I have just forwarded this onto a coworker who had been conducting a little homework on this.
And he actually ordered me lunch simply because I discovered it for him…
lol. So let me reword this…. Thank YOU for the meal!!

short hairstyles 2014 May 30, 2014 at 10:40 pm

Asking questions are truly fastidious thing if you are

online music marketing mike murraco May 29, 2014 at 4:10 pm

obviously like your web-site but you need to check the spelling on several of your posts.
Many of them are rife with spelling problems and I find it very bothersome to inform the truth
nevertheless I will definitely come back again.

top 10 web hosting indonesia 2013 May 24, 2014 at 8:04 am

Greetings! I know this is somewhat off topic but I was wondering which blog platform are you using for this site?
I’m getting sick and tired of Wordpress because I’ve had problems with hackers and
I’m looking at alternatives for another platform. I would be awesome if you could
point me in the direction of a good platform.

ช่างกุญแจ อ่างทอง April 24, 2014 at 12:26 pm

Wow, incredible blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your web site is wonderful, let alone the content!

sap November 16, 2012 at 6:48 am

How to calculate the SNRq for uniform quantizer if the input samples are normally distributed using matlab.

Krishna Sankar November 18, 2012 at 7:01 am

@sap: You can change x to be a picked up from randn() function call.

OGUEGBE VITALIS March 13, 2012 at 11:21 pm

signal to quantization noise ratio for linear quantization