88ET104

Embed Size (px)

Citation preview

  • 7/29/2019 88ET104

    1/5

    Vol 88, July 2007 17

    P T Petrov resides in Drujba 2 Sofia 1582, Bulgaria.P T Petrov resides in Drujba 2 Sofia 1582, Bulgaria.P T Petrov resides in Drujba 2 Sofia 1582, Bulgaria.P T Petrov resides in Drujba 2 Sofia 1582, Bulgaria.P T Petrov resides in Drujba 2 Sofia 1582, Bulgaria.

    This paper (modified) was received on May 4, 2005. Written

    discussion on this paper will be entertained upto September 30,2007.

    A New Approach to Sampling Sinusoidal and CosinusoidalSignals

    P T Petrov, Non-member

    A new approach towards error calculation during the analog to digital conversion of sinusoidal andcosinusoidal signals due to non-sampling of the analog signal into its maximal and minimal value havebeen discussed. Formulae for calculating the sampling factor N, the sampling frequency Fd and thebits into the coding word (number of the converter bits) n are given. The approach is important becausethe sinusoidal and cosinusoidal signals with or without direct current component are basic analog testsignals, for every analog channel and signal conversion system.

    Keywords:Keywords:Keywords:Keywords:Keywords: Sinusoidal; Cosinusoidal; Signal conversion: Digital codes

    INTRODUCTIONINTRODUCTIONINTRODUCTIONINTRODUCTIONINTRODUCTIONConversion of an analog signal (AS) into digital codes andconversion of digital codes into AS (or more precisely intothe analog staircase function (ASF)) are two of the mostimportant problems during the digital signal processing(DSP). In order to be solve these tasks successfully anumber of parameters should be calculated. In this paperthe attention is focused on calculating the followingparameters.

    (i) The sampling factor N

    (ii) The sampling frequency Fd

    (iii) The minimum number of the bits into the coding wordn (or the minimum number of the converters bits-foranalog to digital converter (ADC) and/or for digital toanalog converter (DAC)) in order to guarantee a givenaccuracy or amplitude error

    (iv) The corresponding signal to noise ratio (SNR)

    (v) The amplitude errors.

    SAMPLING FSAMPLING FSAMPLING FSAMPLING FSAMPLING FACTORACTORACTORACTORACTOR

    A parameter1 called sampling factor (SF) (which could bealso called encoding factor or dicsretization factor) has

    been introduced with the definitions given below(i) For a sinusoidal signal (SS) or cosinusoidal signal (CS)with or without a dc component SF is defined with theformula

    N= Fd/ Fs> 0

    (ii) For a band limited signal (BLS) or band wide signal,SF is defined with the formula

    N= Fd/ Fmax>0

    where Fd is the discretization (sampling, encoding)frequency; Fd is constant during one period ot thesampled SS/CS; Fsis the signal frequency (in this casethe SS or CS); Fmax is the maximum frequency ofinterest in the signal band if a BLS is sampled andconverted into digital codes.

    The models discussed in the paper are valid for samplingfactor N> = 2 because the reconstruction of the signal (SSand CS in this case) is simpler than in the case with N< 2.But, it should be noted that sometimes the reconstructionof the SS is still possible with sampling factor N< 2.

    BASICBASICBASICBASICBASIC ANALOG TEST SIGNALSANALOG TEST SIGNALSANALOG TEST SIGNALSANALOG TEST SIGNALSANALOG TEST SIGNALS AND THEIRAND THEIRAND THEIRAND THEIRAND THEIR

    PPPPPARAMETERSARAMETERSARAMETERSARAMETERSARAMETERS

    The basic analog test signals in the (radio) electronics areas mentioned below.

    Direct current,

    Sinusoidal signal (SS) with or without dccomponent,

    Cosinusoidal signal ( CS) with or without dccomponent,

    Finite algebraic sum of SS and CS signals,

    Triangular wave signal (TWS)

    Rectangular wave signal (RWS) usually with dutycycle equal to 0.5 (Thighlevel = Tlowlevel). In factevery real RWS is a trapezoidal wave (TWS) signalwith rounded angles.

    The real TWS and RWS are always with finite slew rate(SR) and rounded angles and should not be approximatedwith ideal rectangles and triangles which have infiniteSR and ideal angles.

    The amplitude errors during the SS and CS signalsconversion into digital codes with ADC are discussed, asbecause

    (i) every finite AS with finite rate of change (finite slew

  • 7/29/2019 88ET104

    2/5

    18 IE(I) Journal-ET

    rate) and finite amplitude could be considered as an finitealgebraic sum of dc, SS and CS signals. (In fact everyartificially generated AS has finite parameters androunded angles).

    (ii) the amplitude is a parameter of the primary

    importance during the AS conversion and reconstruction.(iii) the SS and CS (with or without dc component) are twoof the most important analog test signals.

    Since the dc signals conversion and reconstruction isrelatively easy and well studied, the paper willconcentrate on SS and CS signal conversion.

    The SS and CS with dc component could be presented withfive basic parameters which are

    amplitudeAm,

    function (sin or cosin),

    frequency (F or ),

    phase () and

    dc component (Bdc)

    and with the followings equations

    A(ss) =Am sin (2Ft+ ) + Bdc

    A(cs) =Am cos (2Ft+ ) + Bdc

    The two formulae given above are representing thesimplest possible BLS with two frequency components inits spectrum,one for the dc component and the other for

    the SS/CS component.If the function (sin or cosin) is accepted as a known

    parameter, four basic AS parameters to convert intodigital codes, reconstruct into AS and compare with theoriginal AS are accepted. Consequently, it may besupposed that there is need of at least four samples perperiod (or Nmin=4) in order to recalculate (reconstruct)these four parameters. (The classical sampling theorem

    postulates that the minimum number of samples perperiod is two and the minimum sampling factor Nmin =Fdmin / Fsmax is also equal to two).

    There are two main approaches for AS reconstruction

    Mathematical approach, when the parameters ofthe AS (amplitude, frequency, phase, dccomponent, etc.) are calculated usingmathematical methods from the digital samples.When the function is known, additional pointscould be calculated and used during the ASreconstruction by DAC

    Direct signal reconstruction, when the digitalcodes are send directly to the DAC and thereconstructed signal (which is in fact an ASF) orthe copy at the DAC output is compared with theoriginal at the ADC input.

    In this paper, the second approach is assumed because itis simpler, clear, useful and independent of the digitalsignal processing (DSP). Since, in general, four basic andmany secondary parameters will be converted into digitalcodes, it could be estimated that at least four samplesduring one period are needed for the reconstruction of thefour main parameters of the SS or CS with dc componentor the minimal value of the SF is four (Nmin = 4) as inTable 1.

    Note

    i) The reconstruction of the 'original' AS is possible with enoughamplitude of the samples.

    ii) The App error (defined as difference between peak to peakamplitude of the original AS and peak to peak value of thereconstructed copy) is minimal when N is an even number.

    iii) Number of samples are equal to the minimal sampling factorNmin=Fdmin/Fs.

    iv) Supposed minimal number of samples per period, in order toreconstruct directly the corresponding signal 'parameters'.

    TTTTTable 1 Suppositions about the minimum number of samples for mathematical (arithmetic) reconstruction of theable 1 Suppositions about the minimum number of samples for mathematical (arithmetic) reconstruction of theable 1 Suppositions about the minimum number of samples for mathematical (arithmetic) reconstruction of theable 1 Suppositions about the minimum number of samples for mathematical (arithmetic) reconstruction of theable 1 Suppositions about the minimum number of samples for mathematical (arithmetic) reconstruction of the'parameters' of sinusoidal and cosinusoidal signals'parameters' of sinusoidal and cosinusoidal signals'parameters' of sinusoidal and cosinusoidal signals'parameters' of sinusoidal and cosinusoidal signals'parameters' of sinusoidal and cosinusoidal signals

    Unknown parameters of SS/CS (1)Unknown parameters of SS/CS (1)Unknown parameters of SS/CS (1)Unknown parameters of SS/CS (1)Unknown parameters of SS/CS (1) FormulaeFormulaeFormulaeFormulaeFormulae N(1 ) , (3 ) , (4 ) , (7 )N(1 ) , (3 ) , (4 ) , (7 )N(1 ) , (3 ) , (4 ) , (7 )N(1 ) , (3 ) , (4 ) , (7 )N(1 ) , (3 ) , (4 ) , (7 )

    Principal parameters

    Amplitude, frequency, phase, dc component A = Am (2 F t+)+dc 4( function = sin or cosin)

    Amplitude, frequency and phase for SS A = Am sin (2 F t+) 3

    Amplitude and frequency for SS (5) A = Am sin (2 F t) 2

    Amplitude Am A = Am const 1Additional parameters (6)

    Amplitude peak to peak App App = 2 Am (2)

    Obviously to reconstruct an exact copy of a SS/CS an additionalfilter is necessary in order to convert the reconstructed ASF into ASor sufficiently big number of additional points should be calculated.

    v) Phase and dc components are neglected and function is known.

    vi) Many additional parameters could be introduced as: 'positiveamplitude Ap', negative amplitude An, 'difference between Ap andAn', total harmonic distortion (THD) or spectrum error etc. andcould be controlled during the direct or mathematical ASreconstruction).

    vii) N = number of the samples per period. Fd = const during theperiod.

  • 7/29/2019 88ET104

    3/5

    Vol 88, July 2007 19

    CALCULACALCULACALCULACALCULACALCULATION OF THE MAXIMUMTION OF THE MAXIMUMTION OF THE MAXIMUMTION OF THE MAXIMUMTION OF THE MAXIMUMAMPLITUDE ERROR DURING THE SSAMPLITUDE ERROR DURING THE SSAMPLITUDE ERROR DURING THE SSAMPLITUDE ERROR DURING THE SSAMPLITUDE ERROR DURING THE SS AND CSAND CSAND CSAND CSAND CSCONVERSIONCONVERSIONCONVERSIONCONVERSIONCONVERSION

    Since the amplitude of the original AS to be sampled, theamplitude of the reconstructed copy of this AS and the

    magnitudes of signal samples are of primary importance,they should be evaluated on the first place. Normally,because the AS is not sampled at its maximum value anmaximal amplitude error Emaxcould be introduced (themaximal difference between the maximal value of the ASAm and the maximal digital code produced by the ADCA( max) given with formula Emax =AmA( max)).

    There are two basic cases in practice

    (i) the Fsand the Emax are known and Nand Fdshouldbe calculated

    (ii) the Nand Fdare known and Fsand the Emax should

    be calculated.Consequently the bi-directional relation between thecouples Fsand Emax and Nand Fdis needed.

    This bi-directional relation is illustrated with the formulagiven in Table 2. For example, if the amplitude errorEmax for a SS is given, the sampling factor N iscalculated according to the formula N = 180/(90 arcsin(1Emax)) and it is easy to calculate the samplingfrequency Fdusing the formula Fd= N Fmax or Fd= NFs.

    The utility of the formulae in Table 2 could be seen in

    Table 3. It is possible to calculate the sampling factor N=Fd /Fs when the maximum amplitude error Emax isknown and vice versa. In both the tables the followingabbreviations are used.

    N= Fd/ Fs, the sampling factor

    E max[%] = 100 A( max), is the maximumamplitude error or the maximum deviation fromthe maximal value of the sampled SS or CS.

    A( max) is the maximum value of the guaranteeddigital code when a converter with infinite numberof bits is used (n ) and with the conversion error

    equal to zero (Eadc = 0 or Edac = 0).

    n = log2 (1/E max)+D, [bit] is the suggestedminimal numbers or converters bits. D is aconstant between 0 and 4 and depends on theapplication;

    SNR=(6.02n + 1.76)+12.04, [dB] is the signal tonoise ratio (SNR), corresponding to previouslycalculated number of bits n with D= 2.

    Table 3 is useful to evaluate the relations between some ofthe basic parameters of the sampling process, thesampling factor N, maximum amplitude error Emax, theaccuracy of the converter (n bits) and the correspondingSNR.

    DIFFERENCE OF EDIFFERENCE OF EDIFFERENCE OF EDIFFERENCE OF EDIFFERENCE OF EMAXMAXMAXMAXMAX BETWEEN EVENBETWEEN EVENBETWEEN EVENBETWEEN EVENBETWEEN EVEN ANDANDANDANDANDODD VODD VODD VODD VODD VALUES FOR THE SAMPLING FALUES FOR THE SAMPLING FALUES FOR THE SAMPLING FALUES FOR THE SAMPLING FALUES FOR THE SAMPLING FACTOR NACTOR NACTOR NACTOR NACTOR N

    The amplitude errors during the analog to digital

    conversion depend on the sampling factorNand the phase

    TTTTTable 2 The 'bi-directional' relation between theable 2 The 'bi-directional' relation between theable 2 The 'bi-directional' relation between theable 2 The 'bi-directional' relation between theable 2 The 'bi-directional' relation between thesampling factor Nsampling factor Nsampling factor Nsampling factor Nsampling factor N = Fd= Fd= Fd= Fd= Fd / Fs and the maximum amplitude/ Fs and the maximum amplitude/ Fs and the maximum amplitude/ Fs and the maximum amplitude/ Fs and the maximum amplitudeerrorerrorerrorerrorerror EEEEEmax while sampling sinusoidal and cosinusoidalmax while sampling sinusoidal and cosinusoidalmax while sampling sinusoidal and cosinusoidalmax while sampling sinusoidal and cosinusoidalmax while sampling sinusoidal and cosinusoidalsignalssignalssignalssignalssignals

    Analog Sampling Amplitudesignal factor N= Fd/ error (0==2 Emax = 2 and with an

    ideal converter (n ). When N < 2 the reconstruction of AS issometimes possible but different approaches should be used.

    TTTTTable 3 Example forable 3 Example forable 3 Example forable 3 Example forable 3 Example for EEEEEmax,max,max,max,max, nnnnn and SNR with samplingand SNR with samplingand SNR with samplingand SNR with samplingand SNR with samplingfactor Nfactor Nfactor Nfactor Nfactor N = Fd= Fd= Fd= Fd= Fd / Fs from 2 to 25 with step 1/ Fs from 2 to 25 with step 1/ Fs from 2 to 25 with step 1/ Fs from 2 to 25 with step 1/ Fs from 2 to 25 with step 1

    N Emax [ %] n(adc), [bit] SNR , [dB]

    2 100 0+2 1.76+12.04

    3 50 1+2 7.78+12.04

    4 29.3 1.77+2 12.4+12.04

    5 19.1 2.39+2 16.14+12.04

    6 13.4 2.9+2 19.22+12.04

    7 9.9 3.33+2 21.84+12.04

    8 7.61 3.72+2 24.13+12.04

    9 6.09 4.05+2 26.15+12.04

    10 4.89 4.32+2 27.96+12.04

    11 4.05 4.63+2 29.61+12.04

    12 3.40 4.86+2 31.11+12.04

    13 2.91 5.1+2 32.49+12.04

    14 2.51 5.32+2 33.77+12.04

    15 2.18 5.52+2 34.97+12.04

    16 1.92 5.7+2 36.08+12.04

    17 1.70 5.87+2 37.13+12.04

    18 1.51 6.04+2 38.12+12.04

    19 1.36 6.2+2 39.06+12.04

    20 1.23 6.34+2 39.95+12.04

    21 1.15 6.48+2 40.8+12.04

    22 1.02 6.62+2 41.6+12.04

    23 0.931 6.75+2 42.37+12.04

    24 0.856 6.87+2 43.11+12.04

    25 0.789 6.99+2 43.82+12.04

  • 7/29/2019 88ET104

    4/5

    20 IE(I) Journal-ET

    of the sampled signal. Table 4 gives an idea about theproblem, which represents an (parasitic) amplitudemodulation (AM) of the digital samples produced by theADC due to different Nfor each frequency component into

    the signal spectrum. This concludes is that there is a AM,which depends on the value of the sampling factor N foreach frequency component and its phase. For example, itis seen that peak to peak error Eppmax with N = 15(Eppmax=1.09%) is approximately two times less than theamplitude error with N= 16 (Eppmax = 1.92%).

    In Table 4, the following abbreviations are used

    (i) Epmax is the maximum value for the positiveamplitude error Ep

    (ii) Enmax is the maximum value for the negativeamplitude error En

    (iii) Eppmax is the maximum value for the peak-to-peakerror Epp

    (iv) Emax is the maximum possible amplitude error

    It can be proved that

    (i) when N = Fd/Fsis an even number (N= 2kwhere k=1, 2, 3, 4) the errors Ep, En and Epp could besimultaneously 0 and the range of the errors Ep, En andEpp is between 0% and Emax.

    (ii) when N is an odd number (N = 2k+1 where k=1, 2,

    3, 4) the errors Ep, En and Epp are neversimultaneously equal to zero. Moreover, Epp is never

    equal to zero. The range of the errors Ep and En isbetween 0% to Emax and the range for Epp is between 0 toEmax/2.

    CALCULACALCULACALCULACALCULACALCULATION OF THE NUMBER OFTION OF THE NUMBER OFTION OF THE NUMBER OFTION OF THE NUMBER OFTION OF THE NUMBER OFCONVERTERS BITSCONVERTERS BITSCONVERTERS BITSCONVERTERS BITSCONVERTERS BITS

    Calculating the number of the converter bits (n min) isthe second most important question after the calculationof the (minimal) sampling factor N or the (minimal)sampling frequency Fdin order to obtain the necessaryamplitude error and according to the formula Fd= N Fs.

    It was found that when N for SS or CS is between 2 and50, the calculation of the number of converters bits n1 inorder the converter to be considered as an ideal converter,can be made using the following formula

    n 1 > = log2 (N)+D= log2 (Fd/ Fs) + D, [bit]

    where Dis a constant between 0 and 4. In fact Dis the

    additional number of bits depending on the application. Inmany cases the value ofD can be accepted as 2.

    When the maximal amplitude error Emax (0 < Emax = log2 (1/Emax) + D, [bit]

    If the signal to noise ratio (SNR) is known in dB the wellknown formulae for calculating the number of convertersbits n 3 is

    n 3 > = (SNR1.76)/6.02, [dB]

    When the application of the three approaches asmentioned before is possible and n1, n2 and n3 arecalculated, n should be chosen greater or equal to themaximum possible value of them according to theequation

    n > = max(n1, n 2, n 3), [bit]

    or only the second approach could be applied.

    METHOD FOR CALCULAMETHOD FOR CALCULAMETHOD FOR CALCULAMETHOD FOR CALCULAMETHOD FOR CALCULATING THETING THETING THETING THETING THESAMPLING FSAMPLING FSAMPLING FSAMPLING FSAMPLING FACTOR NACTOR NACTOR NACTOR NACTOR N

    When the model with four basic parameters for a SS or CSis applicable, four basic errors could be defined during theAS conversion.

    Amplitude errorEa

    Function error Efn (or spectrum error Esp)

    Frequency error Efr

    Phase error E.

    The errors during the analog to digital conversion aremore than four. In order to calculate the total conversionfactor N= Fd/Fsthe following method has been developed.

    Depending on the application, all necessary errors

    TTTTTable 4 Comparison between the maximal amplitudeable 4 Comparison between the maximal amplitudeable 4 Comparison between the maximal amplitudeable 4 Comparison between the maximal amplitudeable 4 Comparison between the maximal amplitudeerrors Emax, Epmax, Enmax and Eppmaxwith N=Fd/Fserrors Emax, Epmax, Enmax and Eppmaxwith N=Fd/Fserrors Emax, Epmax, Enmax and Eppmaxwith N=Fd/Fserrors Emax, Epmax, Enmax and Eppmaxwith N=Fd/Fserrors Emax, Epmax, Enmax and Eppmaxwith N=Fd/Fsfrom 2 to 16 with step 1from 2 to 16 with step 1from 2 to 16 with step 1from 2 to 16 with step 1from 2 to 16 with step 1

    NNNNN Amplitude errors,Amplitude errors,Amplitude errors,Amplitude errors,Amplitude errors, %

    E m a xE m a xE m a xE m a xE m a x EEEEEpppppm axm axm axm axm ax EEEEEn m a xn m a xn m a xn m a xn m a x EEEEEppmaxppmaxppmaxppmaxppmax

    2 100 100 100 100

    3 50 50 0 25

    4 29.3 29.3 29.3 29.3

    5 19.1 19.1 0 9.55

    6 13.4 13.4 13.4 13.4

    7 9.9 9.9 0 4.95

    8 7.61 7.61 7.61 7.61

    9 6.03 6.03 0 3.02

    10 4.89 4.89 4.89 4.89

    11 4.05 4.05 0 2.02

    12 3.40 3.40 3.40 3.4013 2.91 2.91 0 1.46

    14 2.51 2.51 2.51 2.51

    15 2.19 2.19 0 1.09

    16 1.92 1.92 1.92 1.92

    Note : When N is an odd number Epp is never equal to zero forexample when when En = 0, Ep = Emax and vice versa

  • 7/29/2019 88ET104

    5/5

    Vol 88, July 2007 21

    are calculated (for example amplitude errors Ea,frequency error Efr, function error Efn and phaseerror E ).

    For each error a corresponding sampling factor iscalculated, consequently four sampling factors are

    calculated (amplitude sampling factor Na, functionsampling factor Nfh, frequency sampling factorNfn and phase sampling factor N) according tothe corresponding errors.

    The total sampling factor Ntotal is calculated asthe maximal value of the four sampling factorscalculated before, or Ntotal= max(Na, Nfn, Nfr,N).

    The sampling frequency Fdis calculated accordingto the formula Fd= Ntotal Fs.

    The method guarantees that the conversion error for eachparameter is less than the accepted limiting values for Ea,Efn, Efr and E.

    CONCLUSIONCONCLUSIONCONCLUSIONCONCLUSIONCONCLUSION

    The paper gives a simple and practical new approach tocalculate as mentioned below, the most importantparameters of every AS conversion system.

    The sampling factor N= Fd/Fs> = 2

    The maximal amplitude error 0 =