Digital Oscillator: Final Mini Project Report On
Digital Oscillator: Final Mini Project Report On
DIGITAL OSCILLATOR
Date- 12/11/2012
DESIGN OF A DIGITAL OSCILLATOR The Digital Oscillator is nothing but the special case of one type of a digital band-pass filter. The Band Pass filter is defined by the following transfer function :H(w)=C (constant) ; w1<w<w2 =0 ; otherwise
Figure 1; Transfer function of ideal band pass filter. Taking C=1 for simplification. But ideally the digital oscillator has the following transfer function :H(w) =1 ; w=w0 = 0 ; otherwise
Note. Reference from Digital signal processing Principles, Algorithms and Applications, Fourth Edition by John G. Proakis & Dimitris G. Manolakis.
Figure 2. Transfer function of ideal oscillator. Hence, it is a limiting form of a digital resonator with passband bandwidth zero . For the design of a band - pass filter the pairs of conjugate complex poles lies near the unit circle in the vicinity of the frequency band that constitutes the passband of the filter. The System function of a two pole band pass filter in which the poles are complex conjugate lying near the unit circle. P1= , P2= )(1-r )(1)
If we select r=1, then the complex conjugate poles will lie on the unit circle and it will produce a particular frequency w0 generating a digital sinusoid of required frequency w0. So taking r=1 , eqn. 1 becomes :H(z)=b0/(1)(1)(2) z-2)
Where the filter co-efficient a1 and a2 are found by observation as :a1= -2cosw0 a2=1
3
Implementation of the required Transfer function:H(z) = b0/(1+a1z-1 + a2z-2).(3) Where , a1= -2cosw0, a2=1
Equation can be futher simplified as , H(Z)=Y(Z)/X(Z)= b0/(1+a1z-1 + a2z-2) Or, Y(z) + a1z-1 Y(z)+ a2z-2 Y(z)= b0 X(Z) Taking inverse Fourier Transform on both the sides; y(n)+a1 y(n-1) +a2 Y(n-2)=b0x(n) y(n)=-a1 y(n-1) -a2 y(n-2)+b0x(n)..(4) The impulse response h(n) can be found by taking inverse Fourier transform of equqtion 3, we get h(n)=F-1(H(z)) =b0/(sin w0) x sin (n+1)w0u(n). Putting the scaling factor b0=Asin w0, we get h(n)=Asin(n+1)w0u(n) Hence we can get a digital sinusoid of frequency w0 and the corresponding amplitude (A) by taking the filter co-efficients as ; a1= -2cosw0, a2=1 b0=Asin w0. Therefore putting b0=Asinw0 and x=d(n) in equation 4 , we get y(n)+a1 y(n-1) +a2 Y(n-2)=b0 d(n) y(n)=-a1 y(n-1) -a2 y(n-2)+b0d (n)(5) The block diagram representation of equation is..
Figure 3.Filter for one sample of white noise. Here we take only 1st value of white noise ( i.e. only one value of white noise in one filter) . So if we have m samples of white noise. Then we will need m such filter to design a oscillator.
(n) = (Asin(n
) /m.
ESTIMATION OF AMPLITUDE & PHASE: Let 1st value of white noise is = x=( = 2cos = 2cos =( = 2cos = ( 2cos =( =( =( =( =( and so on. From the above three values |( )|. , we observed that amplitude of sinusoid is * * . ) * sin . . ) * sin . unit. So now, Where is sinusoid frequency that is provided through us.
) * sin )-(
. ) * sin .
}.
So by this method we get total m amplitude (m= number of filters = number of values in white noise). So Final steady state amplitude A = ( + + --+ )/m
Phase
of sinusoid depends on the sign of x i.e. 1st value of white noise. = 0 radian. = radian.
TASK: Task 1: For our filter A(z) = 1 & B(z) = Transfer function TF = = Where TF = So 1 A(z)B(z) = 1 2cos Or, A(z)B(z) = 2cos Put z = A( Case 1: When w = = (2 = 1 + j0 Case 2: When w After solving we get. | = <1 Barkhausens criterion: A criterion used to determine the stability of an oscillator circuit which states that, if the circuit is seen as a loop consisting of an amplifier with gain A and a linear circuit whose gain (j) depends on frequency , then the loop will oscillate with a perfect sine wave at some frequency 0 if at that frequency A(j0) = 1 exactly, that is, if the magnitude of A(j0) is exactly 1 and its phase is 0 or 360. For w = , we get = 1 + j0 for all w < cos2 (At w = ) + j (sin2 - sin2 ) & = 1. ) ) )
So, Barkhausens criterion is satisfied at a generated frequency Task 2: Magnitude and phase response
Figure. 9- Oscillator output (discrete sinusoid) at variance =1. In DTFT plot we are getting peak at two points n = 30 and n = 36 (while calculating the DTFT matlab does not support n=0, so it start from from n=1), so in real peak points exist at n-1 i.e. at 29 n 35. So most signal contains at frequency = (-0.5 + ( )) * 2 =~ (/10).
9
Figure 10. Suitably generated reference signal. Same frequency as generated through oscillator. Effect on output by varying variance of white noise while keeping the frequency constant. From figure 7 and figure 9 we observed that if we increase variance of white noise it leads increases transition error in output. Qn. Does the system output have a STEADY AMPLITUDE, FREQUENCY and PHASE? Ans. Initially up to some point we get transient value then after wards we get steady value. (We can observe same in figure 7 & 9 ). Since we are using ideal oscillator, so we do not get transient frequency and phase. System have steady frequency and phase from initials. But if we will implements filter through mosfet, bjt, resistance or capacitor etc. then we will initially transient value of all the mentioned above then after some time will get steady value.
Qn. Discuss steady state behavior. Is this truly steady state? Steady state behavior and by the name itself we can guess that when a system is in steady state it consists of so many properties which do not change with time or you can say they are steady. And if we want to define it mathematically then, as we know that if any system is not changing any of its properties with respect to time then the rate of change of that property with respect to time is equal to zero, so for instance, let the property be P of the system, then the partial derivative of that property is: P/t=0 Since frequency and phse are not changing with time and after some time transient state also dies out, so we can say it is truly in steady state.
10