 this is VLSI data conversion circuits lecture 24. In the last class, we learnt several properties of a noise transfer function. Basically, a noise transfer function is a high pass filter, but with a special property that a noise transfer function evaluated at z equal to infinity must be 1 and this in turn means that if the noise transfer function is plotted on a log scale and the poles of the noise transfer function are within the unit circle and the zeros lie at most on the boundary of the circle which corresponds to practical situations where you want a stable noise transfer function and with zeros of the noise transfer function located on the unit circle, then the fact that NTF evaluated at z equal to infinity is 1 is equivalent to saying that the area of the log magnitude of the NTF below 0 is the same as the area of the log magnitude of the NTF above 0. This therefore, means that good performance in band implies poor performance outside the band and why are we worried about performance of the noise transfer function at out of band frequencies correct. So, as we saw over the last you know 2 or 3 classes increasing the out of band gain basically means that the input to the quantizer which consists of the input to the modulator plus shaped noise will now start to have a large noise riding over on top of the input and since any real quantizer will have saturation, we saw that the moment the quantizer starts to saturate the effective gain of the quantizer for this quantization noise which is going around and on the loop is starting to reduce. If you have a high order loop filter which is presumably what you will have in order to achieve the required low in band quantization noise, the saturation of the quantizer frequently will cause its gain to reduce thereby causing the poles of this system to go out of the unit circle thereby causing the modulator to become unstable right, where all this in band noise you know being small and all that are no longer valid. So, the shape or the gain of the noise transfer function outside the desired signal band is of paramount importance because you are not only interested in reducing the in band quantization noise, you are also interested in making sure that the useful range of the modulator is a reasonable fraction of the quantizer range. We all understand that the maximum stable range at the modulator input cannot be the same as the quantizer range because the quantizer range must be occupied by the input plus some shape noise. So, that range can never be the same as the input range, but given the I mean even though we accept this we want to make sure that the stable range is a reasonable fraction of the quantizer range. We do not want the input range to be 5 percent or 10 percent of the quantizer range right because that is going to reduce the maximum stable amplitude by a large factor is this clear. Now, the next thing is to see what one must do in order to have a noise transfer function which goes as omega to the n in the signal band while the out of band gain is not 2 to the n, but smaller right and the last time around we saw that one can actually move the poles of the transfer function 1 minus z inverse whole to the n whose poles are all sitting at z equal to 0. If we move the poles closer to z equal to 1 then the gain at omega equal to pi will reduce and the gain at omega equal to z I mean z equal to 1 or omega equal to 0 will increase and we were wondering how one can go about systematically designing a noise transfer function. So, what we know are the following. So, presumably we know the order of the loop that we want to design. We know the number of levels of the quantizer we know our signal bandwidth which is equivalent to saying that for a given f s I know f b which means that the OSR is also known. So, order is known n is known the oversampling ratio is known and of course, one should also have obviously, an idea of what signal to quantization noise ratio you want to achieve in the signal band is it not. So, we also know the desired in band s q n given this and given that a noise transfer function is nothing, but a high pass filter transfer function one need not go ahead and start reinventing all of high pass filter synthesis. The design of IIR high pass filters is a very well known thing which is been beaten to death by the DSP people. So, we just write on all the knowledge that has been accumulated in this area over the years. So, NTF design is the same as high pass filter design. So, the steps since we know that we want say a third or fourth order NTF we start looking at third or fourth order high pass filters and there are many families high pass filters in the literature. So, you pick your favorite for example, you know you can have a Butterworth or a Chebyshev or an inverse Chebyshev or even elliptic high pass filters. These are all various families where the properties of the high pass filter transfer function have been worked out and a tool like MATLAB for instance will give you the coefficients of these filters you know in a Jiffy without us having to do any work at all and please recall that MATLAB does not know that you are a delta sigma modulator guy what it will do when asked to generate a high pass filter transfer function is to approximate the ideal high pass characteristic which is 0 in some band and 1 in some other band right. So, this is the ideal HPF and depending on the nature of the approximation you choose you will get different high pass filter transfer functions whose frequency response approximates this ideal brick wall where it is 0 in some bandwidth omega b and goes to 1 in the rest of the band. So, for example, if you wanted to synthesize a Butterworth filter what you will get is perhaps something like this and depending on the order the transition band of the filter will become sharper and sharper. So, do you think this can for example, if I give you this transfer function by looking at it can you give me a simple argument to say that this cannot be a delta sigma modulator noise transfer function that is very good. So, you know that if you plot the log magnitude of a noise transfer function the net area under the log magnitude curve must be 0 right that can never happen if the gain of the high pass filter transfer function is always smaller than 1 correct. So, as such even though the shape of the noise transfer function is what we of the high pass filter is similar to that of a noise transfer function as such the simple argument will tell you that the high pass filter transfer function which approximates the ideal brick wall cannot be a noise transfer function is this clear. So, this is for example, a Butterworth high pass filter all right if you had a Chebyshev high pass filter there will be some ripple in the pass band and the transition band will be sharper. If you had an inverse Chebyshev high pass filter in the stop band of the high pass filter there will be notches and the pass band will be maximally flat. An elliptic filter will have ripple in both the pass band and stop band which means that there will be notches in the stop band as well as ripple in the pass band. And for a given order in the Chebyshev and inverse Chebyshev cases there is a tradeoff between the ripple and the sharpness with which the filter rejects or discriminates between low and high frequencies. These are all well known tradeoffs and filters and you know I am not going to go into the details, but given this let us try and figure out a systematic way in which one can go and figure this out. As I said you can pick your favorite pole locations. So, you either choose Butterworth Chebyshev, inverse Chebyshev, elliptic or whatever you like the coefficients for these approximations are readily gotten from MATLAB. And I will talk about this special toolbox which is being written for delta sigma modulator design by Richard Schreyer from Unlocked Devices. This is an invaluable design aid where lot of these mostly common I mean all the stuff that you would want to do when you design a delta sigma toolbox has been coded into a bunch of very nice routines which fit together and allow you not only to design, but I mean at this stage also allow us to learn and examine the behavior of delta sigma modulators without having to go through the pain of having to write code ourselves. So, like any tool when you must understand what the tool does in order to be able to use it efficiently right. So, we will go over this a little later, but for the time being let us start here let me take an example. So, we choose an order say 3, an over sampling ratio of 64, a 16 level quantizer and an in band desired signal to noise ratio of 115 dB. So, as I just mentioned I will just choose the Butterworth family of high pass filters to illustrate the process and since the signal band. So, for us the desired signal is sitting at low frequencies. So, if this is log magnitude of the NTF and this is omega the desired signal is sitting here correct. So, if I move the high pass filter corner to the right which is the high pass filter corner this frequency here. So, if I move this to the right what do you think will happen to the in band response of the NTF you are moving the high pass filter corner to the right which means that the gain at DC will decrease correct. And I mean from the simple picture if you want to reject a lot of quantization noise in the signal band you cannot choose a high pass filter corner for the Butterworth filter to be in pi by a OSR is sitting here you understand. So, to begin with you need to choose some corner for the high pass filter and a reasonable choice is something which is much larger than pi by OSR is that clear. So, at this point since I do not know anything else I just choose a corner of pi by 8 which is somewhere here and this is pi. So, you plop this into MATLAB once you say the high pass filter is Butterworth then there is only one degree of freedom namely the cutoff frequency because the order is fixed and the fact that you want it to be Butterworth means that the relative locations of the poles is also fixed the only thing you can do is vary the cutoff frequency. So, once you specify this that omega 3 D B is pi by 8 you are done. So, you plop this into MATLAB and this happens to be the command and you see that it gives out a H of z and as I mentioned to you before the pass band gain will be normalized or will be 1. And if you want this to be an NTF even though the shape is the same we know that this cannot be a noise transfer function because H of z evaluated at infinity is not 1 in this particular case it happens to be 0.6735. So, to make this you know a legal NTF what one must do is to make the first sample of the impulse response equal to 1 which is equivalent to saying that H of z evaluated at z equal to infinity must be made 1 and that is pretty straight forward you simply divide H of z by in this particular case 0.6735. So, what will this result in as far as the frequency domain picture is concerned if I divide H of z by 0.6735 the frequency response earlier was going from 0 in the at DC to 1 at omega equal to pi correct. Now, if I divide this by 0.6735 what will happen the gain at omega equal to pi will simply get multiplied by 1 by 0.6735 which is about 1.5 or something like that and sure enough you get this and please recall that a Butterworth transfer function has all its 0's a high pass Butterworth filter has all its 0's at z equal to 1. So, it is no surprise that the numerator of the NTF you get after removing the constant is 1 minus z inverse the whole cube is this clear I mean as a digression how do you think these you know these transfer function coefficients are calculated I mean have you done this before or anyway it turns out that there is a lot of class and knowledge about these transfer functions in the S domain in continuous time I do not know if you people have done impulse invariance in that kind of and bilinear transforms and that kind of thing in the DSP class have you or anyway. So, the all these are derived from the analog the so called analog prototypes and analog Butterworth filters and analog Chebyshev transfer functions have been worked out long time ago and the digital filter the IIR digital filter responses are basically you know taking the continuous time Butterworth Chebyshev or elliptic whatever filters that there are and converting them from continuous time into discrete time using what is called the bilinear transformation right and so whatever happens at 0 in the high pass continuous time Butterworth case happens at z equal to 1 in the discrete time case all right and the high pass continuous time Butterworth filter is of the form s cube by d of s so all the zeros are at s equal to 0 and when translated into discrete time the zeros all land up at z equal to 1. So, 1 minus z inverse the whole cube and you have some d of z inverse right where clearly the poles of the denominator are not at they are not at z equal to 0 correct. So, you have indeed managed to move the poles away and that is also reflected in the out of band gain of the noise transfer function if the poles were at z equal to 0 you would get 8 and now you can see that the gain is significantly fallen right. So, you do have the omega cube dependence at low frequencies within the signal band, but at omega equal to pi we see that the gain of the noise transfer function is only about 1.5 here thereby significantly reducing the variance of the quantization noise that is present at the input to the quantizer is this clear great. Now, once you know the noise transfer function you can go and find the loop filter transfer function which will give this desired noise transfer function if the modulated topology was assumed to be of this form then the noise transfer function is simply 1 by 1 plus L of z. So, once L of z is known all that one needs to do is simulate this system right because this is straight forward you can I mean you assume some initial conditions inside the loop filter then you have a quantizer here this is actual quantizer correct. So, you can you can write the non-linear difference equations that govern the whole system the system is non-linear because of the presence of the quantizer correct. So, you can write the equations you can put in a sinusoid at low frequency which where the frequency is within the signal band you will get an output which is a quantized version of the input and there will be shape noise and you can compute the in band signal to quantization noise ratio as you keep increasing the input amplitude eventually at some point the quantizer will saturate and the modulator will become unstable and the signal to noise ratio will form. So, you can find the peak signal to noise ratio of this modulator which corresponds to this particular noise transfer function where the out of band gain is in this particular case about 1.5 is this clear right there are now. So, once you compute the peak SNR this is mind you done through simulation there are only 2 possibilities it either meet your spec or it does not meet your spec. So, it turns out that in this example I did run the simulation and obtained SNR of 102 dB where as I said the OSR is 64. So, I integrate the quantization noise between 0 and 5 over 64 alright and using the techniques that we described last time that is I put in a slow ramp and you know find the point at which the input to the quantizer just blows up. I found that the maximum stable amplitude is about 85 percent of the range of the quantizer ok. So, this is interesting because if we are done 1 minus Z inverse the whole cube without reducing the out of band gain the maximum stable amplitude probably be about 10 percent of the quantizer range because of the amount of shape noise that is riding over the input is this clear alright. So, our spec was 115 dB we are at 102 dB. So, obviously, we are not meeting spec in this particular example. So, what do you think I should do next. So, what I should do is this is basically because the gain of the high pass filter within the signal band is obviously, not is not low enough correct. So, I need to reduce the gain of the high pass filter within the signal band and there can only be done by pushing the corner of the high pass filter to the left or the right to the right. So, I will choose another 3 dB bandwidth last time I chose pi over 8 now I must choose a frequency higher than pi over 8 alright. So, if the SNR is not enough which is the case that we are facing at this point we repeat the entire procedure with a higher cutoff frequency for the Butterworth filter. This will increase the out of band gain and why does this make intuitive sense. So, the area both also should increase. So, the intuition is that earlier this was pi and let us say we had a Butterworth transfer function like this. Please note for all these Bode sensitivity integral type plots the x axis is on the linear scale it is only the y axis which is on the log scale. So, this is NTF 1 and this is say pi by OSR let me just remove this so that there is no confusion alright. So, obviously the in band SQNR is not high enough because the gain is the average gain within the signal band is too high. So, what one would do would be to attempt to increase the out of band gain or decrease the in band gain by pushing the cutoff frequency of the Butterworth filter towards the and by the intuition we gained about the Bode sensitivity integral where the in band performance and the out of band performance are correlated. Pushing the in band response down will cause the out of band response to go up. So, we pushed this down and not surprisingly this goes now if the out of band gain goes up what do you think will happen to the maximum stable amplitude it will reduce alright, but hopefully the reduction of in band quantization noise will be much larger than the factor by which the MSA has fallen. So, that you get a net improvement in the peak SQNR does make sense the peak signal to quantization noise ratio is ratio of the signal power to quantization noise power. If the signal power is made too high the modulator will become unstable and the quantization noise in band will go up right. On the other hand if the signal power is too small then the signal to noise ratio will be small because the quantization noise remains I mean constant and the signal power is very small. So, as you go on increasing the signal power the SQNR will go on increasing at first because the numerator goes on increasing while the denominator remains constant. The moment you start to saturate the quantizer the numerator increases albeit slowly, but the denominator just increases dramatically because the modulator has gone unstable. So, the peak signal to quantization noise ratio is achieved when the input amplitude is equal to the maximum stable amplitude of the modulator loop and therefore, if you make the noise transfer function more aggressive and when I say aggressive it means that the in band gain is small or reduced automatically the out of band gain becomes large thereby causing a reduction in the maximum stable amplitude. So, at this point we only know that the MSA should be expected to reduce it is not immediately obvious by how much it will reduce and for this we just resort to simulation it is quite straight forward to figure that out is this clear. So, in this particular example the signal to noise ratio is not enough. So, we need to make the noise transfer function more aggressive and as we just discussed this will increase the out of band gain and will also thereby cause the maximum stable amplitude to reduce. If the opposite were true in other words if our desired SNR was not as high let us say our desired SNR was only 90 dB and then we chose some cutoff frequency for the Butterworth and found that the SNR was you know 110 or 115 dB clearly we are doing we are overdoing it. So, what one can do is say we do not need the SNR to be so much. So, you can reduce the cutoff frequency thereby increasing the in band gain of the noise transfer function which will automatically cause the out of band gain to decrease thereby mildly pushing up the OSI you understand. So, whether we end up with this scenario that scenario depends on the spec and we repeat this process until the in band SQNR is equal to the spec that we are shooting for and that is when we are done right this is an iterative process. So, in our example choosing omega 3 dB is pi by 8 is inadequate. So, I the next thing to do is to increase the cutoff frequency I mean quite arbitrarily I chose pi by 4 and then recomputed the high pass filter transfer function and normalize it. So, which is the so that evaluated it is equal to infinity it reduces to 1 and when I did that it turned out that the out of band gain has gone up now to 2.25 we should it should be larger than 1 and a half correct and the maximum stable amplitude when ran simulation has fallen down from point 85 or 85 percent of the quantizer range to 80 percent of the quantizer range all right is also in the right direction it makes intuitive sense. And the peak SNR is now upon simulation turns out to be 116 dB it is a close enough to 115 dB and I decide that I am done and I am not interested in you know iterating to get exactly 115 dB and this is ok all right. So, as you can see systematic design of the noise transfer function to achieve a given in band signal to noise ratio is an iterative process all right and I mean the such things are easily done in software right. So, in this tool box which I will talk about later there is a routine which does this automatically right while we have a tool to do it always is better if you know what goes behind the tool and what the what the intuition behind the process is ok. Now, let us say for argument sake that the spec is so tight that I go on increasing the cutoff frequency of the Butterworth filter and I still do not seem to be meeting my spec what do you suggest. So, one thing you can do is increase the order what do you think will happen if I increase the number of levels by a factor of 2 same order, but number of levels have gone up by a factor of 2 what do you think will happen to the peak in band s q and r increase the number of levels from say 16 to 32 it will increase by how much by 6 dB right because delta has gone down by a factor of 2 which means that increasing the number of levels to from 16 to 32 is only going to increase the SNR by 6 dB all right and what do you think it will happen to the maximum stable amplitude do you think it will get higher or it will get lower it will get higher and why does that make sense. Variance of noise. Very good. So, variance of noise riding over the input right is delta square by 12 integral 0 to pi you know NTF e to the j omega minus 1 you know the whole square right and clearly if the quantization noise variance goes down the variance of the shape quantization noise also goes down thereby causing the MSA to increase though when you go from 16 to 32 the increase will be very small right I mean the intuition for this is that let us say for 16 in this particular example the maximum stable amplitude is 80 percent of the quantizer range. So, the you know the 20 percent of the quantizer range is getting eaten up by. By the shape noise. By the shape noise now the shape noise becomes one half its original value right same noise transfer function just increasing the number of levels will cause the shape noise variance still simply one become one fourth of the standard deviation of the variance to become go down by a factor of 2. So, if this is occupying 20 percent before it will now occupy 10 percent. So, the MSA will go from you know 0.8 you can expect it to go to 0.9 right. So, if you want I mean if you are off from the spec by a large amount clearly increasing the number of levels in the quantizer is only going to give you approximately about 16 per every doubling of the number of levels in the quantizer. In which case you conclude that this is not good enough and you shoot for you switch order where you get an additional omega term in the noise transfer function and that pushes the gain of the noise transfer function does make sense. Now, one thing that I have not discussed so far is the fact that all our NTFs so far have had zeros at the origin. In other words our noise transfer functions have been of the form 1 minus z inverse whole to the n divided by d of z inverse. So, at omega equal to 0. So, let me blow up the region between 0 to pi by OSR we find that this will simply go as. So, if this is mod NTF this will go as omega to the n and in fact it will be of the form some alpha into omega to the n where alpha is greater than 1 less than 1 it should be greater than 1. So, the in band SNR will be of the form integral is delta square by 12. So, the in band noise is delta square by 12 pi integral 0 to pi by OSR times alpha square omega to the power 2 n e omega. Now, it is not really necessary to have all the zeros at d c it turns out that you can spread the zeros over the pass band of the modulator. In other words the stop band of the noise transfer function and get a lower in band quantization noise. In other words what I am saying is that instead of having this let us say let us for argument say this is alpha omega cube you can in fact choose 1 0 at d c and move 2 zeros to some location inside the pass band. In other words in the pole zero diagram all the zeros being at d c is equivalent to having all the zeros there pi by OSR in a grossly exaggerated sense is this is pi by OSR. Now, all that I am saying is that one could move the zeros from d c and spread them around in the pass band. So, as to minimize the in band noise. So, the intuition is that it is possible stems from the fact that in this integral where do I think where do you think I am picking up most of my noise where is most of the contribution to this integral coming from in the region 0 to pi by OSR and most of the contribution to this integral is coming from from this region. So, then I will say hey what is the point in trying to put all my zeros at d c where a zero is basically making attempting to make the value at and around that point equal to 0 correct. So, you might say if I chose my zeros smartly in other words I moved my zeros away from z equal to 1 to say somewhere here for example, please recall that the zeros must be complex conjugate. So, if you had a third order noise transfer function if you move one zero away automatically another zero also must go away. So, you can have a pair of complex conjugate zeros which are on the unit circle and one continues to be at z equal to 1 or omega equal to 0. In the frequency response the intuition being that you will get if you have one zero at omega equal to 0 clearly the NTF will be zero here. If you have a pair of zeros at some other frequency omega z what will happen to the NTF it is zero at origin and it will do this and around omega z how will the noise transfer function look like again pick up and then do this you understand. So, now what do you see you see that I mean the contribution since most of the contribution to this term was coming from frequencies in the neighborhood of pi by OSR it makes sense that if you move the zeros around in the pass band you can reduce the in band noise for the third order case you can actually go and compute the location of omega z which will minimize the in band quantization noise and that by minimizing you it turns out that you will be able to get 8 dB more in the third order example. You can I will give this as an exercise you can do this work out the math. So, in other words choose the location of omega z that will minimize the quantization noise which is now of the form delta square by 12 pi integral 0 to pi by OSR the two NTF square in the third order example will have will be of the form omega square only because there is one zero at the origin correct NTF must be of the form NTF square must be of the form omega square times omega square minus omega z square the whole square d if omega z is 0 you must get omega to the 6 the intuition is that around this point this must behave like a parabola correct. So, the NTF around the NTF square around omega z must be of the form omega minus omega z the whole square there must be a similar kind of expression because of the conjugate of the negative frequency. So, that must be omega plus omega z the whole square and around the origin mod square of the NTF must goes omega square. So, you combine all this together and you get omega square times omega square minus omega z square the whole square right integral integrated from 0 to pi by OSR will give you the noise. And you can go and differentiate this the value of this integral with respect to omega z and you will find the location of omega z in and that will obviously, be in relation to the bandage right. So, it will be a fraction of pi by OSR and in third order example you turns out that the SNR you evaluate for the optimal location of omega z is about 8 dB lower than what you get with all 0's at the origin is this clear I mean we must be doing better is that intuitively at least clear. And the NTF will look for example, if I plot the magnitude of the NTF for the Butterworth's it will go to minus infinity dB only at 0 right. The inverse Tavishov approximation is one approximation where the 0's are complex. And there you will have notches in the stop band and you can also optimize the 0's according to the approach I just mentioned and you will find that the NTF now does something like this. So, complex 0's will result in a lower in band quantization noise for the same out of band gain. I mean because the 0's have slightly moved that will be so small that you would not all right. So, once you compute the out of band gain which will meet your desired SNR spec you can go and plot the root locus of the modulator again as the k goes from 1 which is what happens when you are when you are not overloaded to lower values which is what will happen when the quantizer gets overloaded. And at k equal to 1 the poles will start off here and just like in the case where all the 0's were at all the poles were at is equal to 0 reducing the gain will cause the poles to move like this. And eventually the modulator will also become this modulator will also become unstable what I want to point out is that in either case if you have a high order loop filter whether you choose a high order band gain or a low order band gain modulator will become unstable. The only thing is how much MSA you get all right. So, we continue in the next class but take a break.