c# convert pdf to image : Convert word document to pdf fillable form control software system azure windows html console sampling0-part1981

Sampling: What Nyquist Didn’t Say, and What to
Do About It
TimWescott,WescottDesignServices
TheNyquist-Shannonsamplingtheoremisuseful,butoftenmisusedwhenengineersestablish
samplingratesordesignanti-aliasingfilters.Thisarticleexplainshowsamplingaffectsa
signal,andhowtousethisinformationtodesignasamplingsystemwithknown
performance.
April14,2016
Convert word document to pdf fillable form - C# PDF Form Data fill-in Library: auto fill-in PDF form data in C#.net, ASP.NET, MVC, WinForms, WPF
Online C# Tutorial to Automatically Fill in Field Data to PDF
pdf fillable forms; convert fillable pdf to html form
Convert word document to pdf fillable form - VB.NET PDF Form Data fill-in library: auto fill-in PDF form data in vb.net, ASP.NET, MVC, WinForms, WPF
VB.NET PDF Form Data fill-in library: auto fill-in PDF form data in vb.net, ASP.NET, MVC, WinForms, WPF
convert word to fillable pdf form; asp.net fill pdf form
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
What Nyquist Did Say
Theassertion made by theNyquist-Shannon samplingtheoremissimple: if you have a
signal that is perfectly band limited to a bandwidth of f
0
then you can collect all the
informationthereisinthatsignalbysamplingitatdiscretetimes,aslongasyoursample
rateisgreaterthan2f
0
.Astheoremsgothisstatementisdelightfullyshort.Unfortunately,
whilethetheoremissimpletostateitcanbeverymisleadingwhenonetriestoapplyitin
practice.
OftenwhenIamteachingaseminar,workingwithaclient,orreadingaUsenetnewsgroup,
someone will say “Nyquistsays”, then follow thiswith an incorrect use of the Nyquist-
Shannon theorem. Thispaper is aboutexplainingwhatthe Nyquist-Shannon sampling
theoremreallysays,whatitmeans,andhowtouseit.
ItisacommonmisconceptionthattheNyquist-Shannonsamplingtheoremcouldbeused
toprovideasimple,straightforwardwaytodeterminethecorrectminimumsamplerate
for a system. While thetheorem doesestablish some bounds, itdoesnotgive easy an-
swers. Sobeforeyou decidethesamplingrateforyour system,youhavetohaveagood
understandingoftheimplicationsofthesampling,andoftheinformationyoureallywant
tomeasure.
ThedifficultywiththeNyquist-Shannonsamplingtheoremisthatitisbasedonthenotion
thatthesignaltobesampledmustbeperfectlybandlimited.Thispropertyofthetheorem
isunfortunatebecausenorealworldsignalistrulyandperfectlybandlimited. Infact,if
asignalweretobeperfectlybandlimited—ifitweretohaveabsolutelynoenergyoutside
ofsomefinitefrequencyband—thenitmustextendinfinitelyintime.
What this means is that no system that samples data from the real world can do so
perfectly—unless you’re willing to wait an infinite amount of time for your results. If
nosystemcan sampledataperfectly,however,whydowebother withsampledtimesys-
tems?Theanswer,ofcourse,isthatwhileyoucanneverbeperfect,withabitofworkyou
candesignsampledtimesystemsthataregoodenough.Often,infact,theadvantagesone
gainsbyprocessingsignalsin sampledtimefaroutweighthedisadvantagesof sampling,
makingmanysampledtimesystemssuperiortotheircontinuous-timeequivalents.
Tounderstand howto make a sampledtime systemthat’sgood enoughwemustunder-
standwhathappenswhenasignalissampledintothediscrete-timedomain,whathappens
when itisreconstructedin thecontinuous-time domain,and howtheseprocessesaffect
thequalityofthesignal.
Sampling
Sowhatissampling,andwhatdoesitdo? Samplingistheprocessbywhichcontinuous-
time signals, such asvoltagesor water levelsor altitudes, are turned into discrete time
signals.Thisisusuallydonebytranslatingthesignalinquestionintoavoltage,thenusing
TimWescott
1
WescottDesignServices
VB.NET Create PDF from Word Library to convert docx, doc to PDF in
VB.NET Tutorial for Creating PDF document from MS Office Word. Convert multiple pages Word to fillable and editable PDF documents.
change font size in fillable pdf form; convert an existing form into a fillable pdf form
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
C# Demo Code to Create PDF Document from Word in C# Program with .NET XDoc.PDF Component. Convert multiple pages Word to fillable and editable PDF
convert word to pdf fillable form; create a pdf form that can be filled out
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
0e00
2e−02
4e−02
1e−02
3e−02
5e−02
0
2
−1
1
0e00
2e−02
4e−02
1e−02
3e−02
5e−02
0
2
−1
1
Figure1: TheresultsofSampling
ananalogtodigitalconverter(ADC)toturnthiscontinuous,analogsignalintoadiscrete,
digitalone.TheADCbothsamples
1
thevoltageandconvertsittoadigitalsignal.
Thesamplingprocessitself is easytorepresentmathematically: given acontinuoussig-
nalx(t) to be sampled,anda sample intervalT, the sampled version of x is simply the
continuousversionofxtakenatintegerintervalsofT:
x
k
=x(kT);k2I
(1)
Figure1showstheresultofsamplingasignal.Theuppertraceisthecontinuous-timesig-
nal,whilethelowertraceshowsthesignalafterbeingsampledoncepermillisecond. You
maywonderwhythelowertraceshowsnosignalbetweensamples. Thisisbecauseafter
samplingthereisnosignalbetweensamples—alltheinformationthatexistedbetweenthe
samplesintheoriginalsignalisirretrievablylostinthesamplingprocess.
1OlderADCsandsomeveryspecializedsystemsmayrequireexternalsamplingcircuitry,butnearlyall
newlydesignedADCintegratedcircuitshavetheirownsamplingcircuitrybuiltin.
TimWescott
2
WescottDesignServices
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
using RasterEdge.XDoc.Word; How to Use C#.NET Demo Code to Convert ODT to PDF in C#.NET PDF document can be converted from ODT by using following C# demo code.
change font in pdf fillable form; create a pdf form to fill out
VB.NET Create PDF from Excel Library to convert xlsx, xls to PDF
C#.NET convert PDF to text, C#.NET convert PDF to images DNN, C#.NET Winforms Document Viewer, C#.NET WPF Document Viewer. How-to, VB.NET PDF, VB.NET Word, VB.NET
adding signature to pdf form; convert word form to pdf fillable form
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
Aliasing
By ignoring anything that goes on between samplesthe samplingprocess throws away
information abouttheoriginalsignal
2
. Thisinformation lossmustbetakenintoaccount
duringsystemdesign. Mostofthetime,whenfolksaredesigningsystemstheyaredoing
theiranalysisinthefrequencydomain.Whenyouaredoingyourdesignfromthispointof
viewyoucallthiseffectaliasing,andyoucaneasilyexpressitandmodelitasafrequency-
domainphenomenon.
Tounderstandaliasing,considerasignalthatisapuresinusoid,andlookatit’ssampled
version:
x
k
=cos(!kT)
(2)
If you knowthe frequency of the originalsinewave you’llbeable toexactly predictthe
sampledsignal. Thisisaconceptiseasytograspandapply.Butthesampledsignalwon’t
necessarilyseemtobeatthesamefrequencyastheoriginalsignal: thereisanambiguity
in thesignalfrequencyequaltothe samplingrate. Thiscan beseenif you consider two
signals,oneatfrequencyf andoneatfrequencyf +
1
=
T
.Usingtrigonometry,youcansee
thatthesampledversionofthesetwosignalswillbeexactlythesame:
cos
2
f+
1
T
kT
=cos(2k+2fkT)=cos(2fkT)
(3)
Thismeansthatgivenapairofsampledversionsofthesignals,oneofthelowerfrequency
sinusoidandoneofthehigher,youwillhavenowayofdistinguishingthesesignalsfrom
oneanother. Thisambiguitybetweentwosignalsofdifferentfrequencies(ortwocompo-
nentsofonesignal)isaliasing,anditishappeningallthetimeintherealworld,anywhere
thatareal-worldsignalisbeingsampled.
Figure2onthenextpageshowsanexampleof aliasing. Twopossibleinputsine waves
areshown: onehasafrequencyof110Hz,theotherhasafrequencyof1110Hz.Bothare
sampledat1000Hz. Thedotsshowthevalueofthesinewavesatthesamplinginstants.
Asindicatedby(1)thesetwopossibleinputsbothresultinexactlythesameoutput: after
samplingyoucannottellthesetwosignalsapart.
Itisrare,however,for real-world signals toresemblepure sinewaves. Ingeneral,real-
world continuous-time signalsare more complex than than simple sine waves. But we
canusewhatwelearnaboutthesystem’sresponsetopuresinewaveinputtopredictthe
behavior ofasystemthatispresentedwithamorecomplexsignal. Thisisbecausemore
complexcontinuous-timesignalscanberepresentedassumsofcollectionsof sinewaves
atdifferentfrequenciesandamplitudes
3
.Formanysystemswecanbreakthesignaldown
2
If thesignalisperfectlybandlimitedthenno realinformationis lost—butyoucan’ttellthatjustby
lookingatthesampledsignal,aswe’llseelater
3
ThiscanbeexpressedformallyusingtheFouriertransform;Iwillrestrictmyselftoaninformaldiscussion
here,butworkssuchas[Opp83]giveverygood,formaldiscussionsoftheunderlyingmathematics. Fora
lessformal,butstillvalid,treatment,see[Lyons04].
TimWescott
3
WescottDesignServices
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
C#.NET PDF SDK- Create PDF from Word in Visual C#. Description: Convert to PDF/TIFF and save it on the targetType, The target document type will be converted to.
pdf form filler; convert pdf fillable forms
C# Create PDF Library SDK to convert PDF from other file formats
Best C#.NET component to create searchable PDF document from Microsoft Office Word, Excel and PowerPoint. Create fillable PDF document with fields.
convert word document to pdf fillable form; create a pdf form to fill out and save
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
0e00
1e−02
2e−03
4e−03
6e−03
8e−03
1e−03
3e−03
5e−03
7e−03
9e−03
0
−1
1
−0.8
−0.6
−0.4
−0.2
0.2
0.4
0.6
0.8
Figure2:Aliasingoftwosinewaves.
intoit’scomponentparts,analyzethesystem’sresponsetoeachpartseparately,thenadd
theseresponsesbacktogethertogetthesystem’sresponse
4
.
Whenyou break a signaldown intoitscomponentsine waves, you seethatthe signal’s
energyisdistributedasafunctionoffrequency. Thisdistributionofasignal’senergyover
frequencycanbeshownasa plotofspectraldensityvs. frequency,suchasthesolidplot
inthecenterofFigure3onpage5.
When you have a signal such asthe one mentioned above, and you sample it, aliasing
willcausethesignalcomponentswillbereplicatedendlessly.Thesereplicasignalsarethe
signal’saliases.Thespacingbetweenthesealiaseswillbeevenandequaltothesampling
rate. These aliases are indistinguishable from realsignals spaced an integer number of
samplingratesaway: thereisnoway,oncethesignalissampled,toknowwhichpartsof
itarerealand whichpartsarealiased. Tocompoundour trouble,any real-worldsignal
willhaveapowerspectrumthat’ssymmetricalaroundzerofrequency,withnegativefre-
quencycomponents;aftersamplingthesecomponentsoftheoriginalsignalwillappearat
frequenciesthatarelowerthanthesamplerate.
Figure3onpage5showsthiseffect. Thecentralfrequencydensityplotisthesignalthat’s
beingsampled; the othersare the signal’s aliases in sampled time. If you sampled this
signalasshown,thenaftersamplingthesignalenergywouldappearto“foldback”at
1
=
2
thesamplingrate.ThiscanbeusedtodemonstratepartoftheNyquist-Shannonsampling
theorem:iftheoriginalsignalwerebandlimitedto
1
=
2
thesamplingratethenafteraliasing
therewouldbenooverlappingenergy,andthusnoambiguitycausedbyaliasing.
4
Thisispossibletodowhenasystemislinear,i.e.whenitobeysthepropertyofsuperposition.
TimWescott
4
WescottDesignServices
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
multiple pages PowerPoint to fillable and editable doc = new PPTXDocument(inputFilePath); // Convert it to PDF document can be converted from PowerPoint2003 by
convert pdf fillable form to word; c# fill out pdf form
C# PDF Field Edit Library: insert, delete, update pdf form field
A best C#.NET PDF document SDK library for PDF form field manipulation in Visual A professional PDF form creator supports to create fillable PDF form in C#.NET.
create fillable form pdf online; add attachment to pdf form
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
−2/T
−1/T
0T
1/T
2/T
Figure3: Aliasingofasignal’sspectruminthefrequencydomain.
Reconstruction
The opposite process from sampling isreconstruction. The fundamental difference be-
tweencontinuous-timeandsampled-timesignalsisthatacontinuous-timesignalisdefined
everywhereintime,whileasampled-timesignalisonlydefinedatthesamplinginstants.
Becauseasampled-timesignalisn’tdefinedbetweensamplesitcan’tbeuseddirectlyina
continuous-timesystem.Touseasampled-timesignalinacontinuous-timesystemitmust
beconverted intoa continuous-timesignalbeforeitcan beuseful. Thisconversion from
sampledtocontinuoustimeiscalledreconstruction.
Reconstruction is done by interpolating the output signal. Interpolation is the process
wherethevalueofthecontinuous-timesignalsbetweensamplesisconstructedfrompre-
vious values of the discrete-time signal. In discrete-time control and signal processing
systemsthefirststepofthisinterpolationisalmostuniversallydonewithdigital-to-analog
converters(DACs)whichcontainanintrinsiczero-orderhold.
Azeroorder holdissimplyadevicewhichtakesonthevalueofthemostrecentsample
andholdsituntilthenextsampletime:
y(t)=y
b
t
T
c
(4)
wherethefunctionbxcissimplythefloorfunctionasyoumightfindintheCmathlibrary.
In a block diagrama zero-order hold isindicated by a block containinga picture of an
interpolatedsignal,asshowninFigure4onpage6. Thisisexactlythefunctionprovided
TimWescott
5
WescottDesignServices
VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to
Password: Set File Permissions. Password: Open Document. Edit Digital VB.NET PDF, VB.NET Word, VB.NET Convert multiple pages PowerPoint to fillable and editable
convert pdf into fillable form; create fillable forms in pdf
VB.NET Create PDF Library SDK to convert PDF from other file
SharePoint. Best VB.NET component to convert Microsoft Office Word, Excel and PowerPoint to searchable PDF document. Gratis
create a fillable pdf form in word; create a writable pdf form
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
Figure4: Asample-and-holdblock.
by mostdigital-to-analogconverters: the processor writesa number tothe DAC,which
drivesacorrespondingvoltage(orcurrent)outputuntilthenextnumberiswritten.
Theresultofusingazero-orderhold isshown inFigure5onpage7. Thesampled-time
signal isat the top, and the interpolated signal is on the bottom. Note the “stair-step”
natureoftheinterpolatedsignal,aswellasthefactthatonaverageitisdelayedfromthe
originalsignal
5
.
Reconstruction causes a form of aliasing
6
: when a signal at a certain frequency is re-
constructedthecontinuous-timesignalwillhave componentsatthe sampled-timesignal
frequency, aswell asall multiplesof the sample rate plusand minusthe sampled-time
signalfrequency.Forexample,ifthesampled-timesignalis
y
k
=cos(2f
0
k)
(5)
(which only hastwofrequency components, atf
0
), then the reconstructed signalwill
havecomponentsat
f2f
0
;
1
T
s
f
0
;
1
T
s
2f
0
;
(6)
Inadditiontothiseffect,thezero-orderholdinterpolatoractsasalow-passfilterforthe
signalsgoingthroughit,withafrequencyamplituderesponseof
A(f)=sinc(T
s
;f)=
(
1
f=0
sin(T
s
f)
T
s
f
otherwise
(7)
Thismeansthatwhile all of the components shown in (3) will be generated, the high-
frequencycomponentswillbeattenuatedbytheactionofthezeroorderhold.
5
Dependingonyoursystemrequirementsthislittlebitofdelaymaynotmatteratall,oritmaybreak
yoursystem’serrorbudget—butthatdiscussionisbeyondthescopeofthisarticle.See[Opp83,Wes06]for
additionaltheoryonthissubject.
6
Dependingonyourpointofview,youcanclaimthatreconstructionreflectsthealiasingthatwasalready
there.ThisisthecaseifyouunifythesamplingandreconstructionprocesseswithcarefuluseoftheFourier
transformandtheDiracdeltafunctional. Suchanalysis s is powerful,andcanbeausefultool,butwould
requirealengthlydigression(see[Opp83]).Soforthepurposesofthispaperwewilltreatthesampled-time
andcontinuous-timedomainsascomplementarybutseparate,andwewilltreatreconstructionandsampling
separately.
TimWescott
6
WescottDesignServices
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
0e00
2e−02
4e−02
1e−02
3e−02
5e−02
0
2
−1
1
0e00
2e−02
4e−02
1e−02
3e−02
5e−02
0
2
−1
1
Figure5:Asignal,reconstructed.
TimWescott
7
WescottDesignServices
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
What Nyquist Didn’t Say
TheNyquist-Shannonsamplingtheorem,withitslimitonsamplingratevs. spectralcon-
tent of the signal, does give you some clearly stated boundstolook for in your system
design. Butasweshallsee,inpracticetheseboundsaren’tnearlyasclearastheyarein
theory.SotheNyquist-Shannontheoryappearsonthesurfacetosaythingsthatinpractice
aren’t true. What the Nyquist-Shannon sampling theorem—absolutely and positively—
does notsay,isthatyou can designyour systemto operate rightatthe Nyquistrate, at
leastnotwithanyreasonablechanceofsuccess.
Here are some system design decisions that I have heard made using the Nyquist rate
asaguidinglight. Eachoneof thesedecisionsisbasedona faultyunderstandingof the
Nyquist-Shannonsamplingtheorem.Someofthesedecisionsarefalselyoptimistic,leading
to a faulty system; some are falsely pessimistic, leading to an unnecessarily expensive
system. Sinceitisadesignengineer’sjobtomakethemostproductoutoftheleaststuff
(andhavetheproductwork),neither ofthesedesigndecisionsendupbeinggood ones.
I’lllistthesedesigndecisionshere,thendevoteasectiontoeachoneexplainingwhyitis
basedonfaultyreasoningabouttheNyquistlimit.
1. “Iamgoingtosampleat8kHz,soIneedtouseafilterwitha4kHzcutoff.”
2. “Ineedtomonitorthe60Hzpowerline,soIneedtosampleat120Hz.”
3. “Myradioworksat5MHz,soIhavetosampleabove10MHz.”
4. “Wehaveasignalat1kHzweneedtodetect,soIneedtosampleat2kHz.”
5. “WhatisthespectrumofanEKGsignal? IwanttofigureouttheNyquistrate.”
6. “Mycontrolloopsamplesat8kHz,soIneedtouseafilterwitha1kHzcutoff.”
NyquistandFilters
“Iamgoingtosampleat8kHz,soIneedtouseafilterwitha4kHzcutoff.”
Nyquistdidn’tsaythatifyouaresamplingatrateN thatyoucouldusean anti-aliasing
filterwithacutoffatfrequencyf =
N
=
2
.
Let’stakeavoicesignalasanexample. Assumethatwewanttosamplethehumanvoice,
andfurthermorethatwewanttosampleitforacommunicationsapplication—sowhilewe
caredeeplyabouttheintelligibilityofthesampledsignal,wearen’tlookingforthekindof
qualityyou’dgetinamusicalrecording.
Ifyouweretostartyoureffortwiththegrandoldengineeringtraditionofcopyingsome-
thingthatworks,youwouldbewellservedtocopythesamplingrateandencodingthat’s
usedtotransmittelephoneconversationsdigitally. Landlinetelephoneconversationsare
TimWescott
8
WescottDesignServices
Sampling: WhatNyquistDidn’tSay,andWhattoDoAboutIt
0
2 000
4 000
6 000
8 000
1 000
3 000
5 000
7 000
0
1
0.2
0.4
0.6
0.8
0.1
0.3
0.5
0.7
0.9
frequency, Hz
relative amplitude
Figure6: Samplingwithacutofffrequencyof
1
=
T
.
sampledat8000samplesper second,andaretransmitteddigitallywithan effectivepre-
cision of 12bits
7
or so. We’dliketo be abletosample thesignalthattheenergy in the
aliasedsignalisinsignificant.I’llchoose40dB(that’safactorof1:10000ofenergy)foran
aliasedsignalenergy,assumingthatthespectrumofthesoundhittingthemicrophoneis
evenacrossallfrequencies.
Possibly the worstthing you could do in this case would be to design a system where
you gostraightfromamicrophonetoa samplerorADC.Inthiscaseallof theenergyof
theincomingspeech—andanybackgroundnoise—thatoccursabove4kHzwillbealiased
backintoyoursampledsignal;theresultofsuchasoundacquisitionsystemwouldsound
terrible.
Sowhatdoeshappenifyouuseafilterwitha4kHzcutoff,alongwithyour8kHzsampling
rate? Figure6 on page9 showswhathappenswhen we use a 4kHz1st-order lowpass
filter. The solid curve shows the spectrum of the filtered audio to the ADC, while the
dashed curve shows the aliased audio. You can see thatthis is notgoingto give good
performance.Infact,ifyoutakeallthealiasedenergyintoaccounttheratiobetweenthe
correctsignalandthealiasedsignalisexactly1:1!That’snotgoodatall.
Can you fix this problem by increasing the filter order? Not really. Figure 7 on page
10showstheresultofusinga6th-orderButterworthlowpassfilterinsteadofa1st-order
filter.We’veimprovedthesituation–wenowhavebetterthana50:1signalenergytoalias
ratio,andthealiasingisconcentratedintheupperendofaudiobandwhereitpresumably
won’tsoundasbad.Butthealiastosignalratioisn’tevenclosetothe40dBthatwe’dlike
7Capturingthemeaningof“effectiveprecision”getssmokyhere—ifyouwanttoknowhowthisoperates
indetail,searchon“Mu-lawcompanding”and“A-lawcompanding”.
TimWescott
9
WescottDesignServices
Documents you may be interested
Documents you may be interested