 data conversion circuits lecture 26. So, far we have seen how noise shaping is achieved determine the effective resolution of the delta sigma loop when you have a noise transfer function and we have seen that having a transfer function of the form 1 minus z inverse to the n divided by d of z inverse is necessary because if you just had all the poles at z equal to 0 and which in which in which case it would mean that the noise transfer function is 1 minus z inverse whole to the n. We found that the stable range of the modulator is very small because the variance of the quantization noise is very large and that is because of the large out of band gain of the noise transfer function. As a fix for that problem we said this can be therefore, solved if we have the 1 minus z inverse to the n kind of dependence in the signal band right while somehow knocking off the gain of the transfer function at omega equal to pi and that can be done by moving the poles away from omega equal to pi that is closer to z equal to 1 right. This way the gain at omega equal to pi reduces. However, this is accompanied by an increase in the in band quantization noise. However, we hope that the increase in the in band quantization noise due to the coefficient going up right. In other words in the signal band the NTF is no longer of the form simply omega to the n it is some alpha omega to the n where this alpha is greater than 1. But we are hoping that the fact that alpha is greater than 1 is offset by the fact that you have an extra factor of omega when you increase the order therefore, the effective in band quantization noises is much smaller than what you would get if the order was lower. And then we saw that in band performance and out of band performance are related if you want to have low in band quantization noise it must be accompanied by high gain of the noise transfer function at high frequencies and that is a fundamental limitation as we saw the integral of the log magnitude of the noise transfer function from 0 to pi is 0 if the poles of the noise transfer function if the closed loop poles are within the unit circle which is something that you definitely want right. And if the zeros of the transfer function are either inside the unit circle or on the unit circle. So, in other words this covers the most practical cases of noise transfer functions that would that one would use. In which case we can see that since the net area is constant if you want to push the NTF down inside the signal band it must automatically be accompanied by an increase somewhere out of band right need not necessarily be at omega equal to pi it just says that the area of the log magnitude of the NTF is 0. So, let us put that down here then we saw how one can systematically design the noise transfer function we start with a high pass filter prototype then realize that a high pass filter transfer function whose gain in the pass band is 1 can clearly not be a noise transfer function. Then we said it is just a matter of simply normalizing the coefficient such that the noise transfer function evaluated at z equal to infinity is 1 corresponding to the first sample of the noise transfer function being equal to 1 or in other words the first sample of the impulse response of the loop filter must be NTF of z equal to infinity must be 1 which is equivalent to saying H of 0 is 1 which is equivalent to saying L of 0 is. So, please note that 1 by 1 plus L of z is NTF of z right. So, these are frequency domain relationships. So, 1 by 1 plus L of z in the time domain corresponds to the impulse response of H of N which means that L of 0 must be must be 0 please recall that intuitively what is the meaning of a delay free loop if you inject an impulse right where the quantizer is nothing comes back before the next sample which by definition means the first sample of the loop filter output is 0 you understand. So, this all these are equal all right. And so once the noise transfer function is normalized or the high pass filter transfer function is normalized such that it evaluates to 1 at z equal to infinity then the modulator loop equations are written and you run a simulation where you measure the peak signal to noise ratio. If the peak SNR is very small then you know that or rather if it falls significantly short of your spec then you know that the out of band gain is not high enough and you increase the out of band gain by pushing the 3 dB corner of the high pass filter towards the right or towards pi this will cause the in band quantization noise to go down and the out of band gain to go up all right and will result in a higher peak SQNR if it means the spec you are done otherwise you keep iterating until you hit the spec all right. So, this iterative procedure you should do it once so that you are familiar with the procedure after which you can use the built in function in the Shire toolbox which will automatically do this iteration for you right and will give you will give you the desired NTF all right. So, now that we know how to get the NTF you can use this relationship to arrive at the transfer function of the loop filter and so far for simplicity sake we have considered only loop filters of this form again this is V, this is Y, this is U the input signal as well as the quantization noise passes through the same transfer function in which case as you can see the STF is L of Z by 1 plus L of Z and the NTF is 1 by 1 plus L of Z. So, once you choose the NTF L of Z is frozen which means that the STF is frozen this is somewhat restrictive situation in the sense that even though the STF in the signal band will be 1 right. Please note that if the NTF has 0 at DC or at omega equal to 0 what does that mean for L of Z at omega equal to 0 what is the DC gain of L of Z infinity. So, if the NTF has is has a 0 at DC it must follow the loop gain or L of Z must have a gain of infinity at DC which means that what does this mean for the STF the STF is 1 all right. So, in that sense the STF in the signal band will still be 1, but you have no control over of what the STF does outside the signal band it turns out that in some situations it is of importance we will come to that a little later. But at this stage all that I want you to realize is that if you choose an architecture like this then you are restricted with respect to you with respect to the signal transfer function in the sense that you have you have to accept what you get all right. There are therefore, more general ways of realizing the loop filter where you denote the loop filter as a system which takes 2 inputs and generates 1 output and what is the expression for NTF and STF can you please calculate. So, y is nothing but a linear combination of u and v this plus quantization noise gives v. So, you do the math and you finally, end up with the signal transfer function is L naught of Z divided by 1 plus L 1 of Z and the noise transfer function is 1 by 1 plus L 1 of Z and as we expect the poles of the STF and the poles of the NTF are the same. This makes sense because in a linear system all transfer functions you can think of will have the same denominator polynomial right or will have the same poles is this clear. So, we will have an opportunity to see noise transfer functions where or sigma delta loops where the transfer function from the signal to the output of the loop filter and that from the quantized output port to the output of the loop filter different. So, you have L naught and L 1 not being the same and the idea is to have freedom in choosing the STF. So, here after you freeze the NTF it just means that L 1 is frozen right and L naught is still left free. So, that you can play around with it and you know get behavior which even though is 1 in the signal band you can kind of play with it in the at frequencies outside the signal band. At this point it is not immediately apparent why you would want to play around with the STF outside the signal band, but later on I will come to situations where it is indeed desirable alright. So, this family of delta sigma converters right where the NTF is realized using a single loop as opposed to a dual loop structure as we will which we will see going forward is quite simply called a single loop structure and these can be of two kinds depending on the resolution of the quantizer inside either single bit or multi bit. Intuitively we saw last time that as the number of bits in the quantizer go on reducing the probability that the quantizer will overload will go on increasing and the worst case as far as the quantizer is concerned is when you have just one bit. So, the quantization noise is now very large and technically the quantizer is overloaded all the time and we saw that empirically it is been found that about an out of band gain of one and a half is a good value to choose for a first cut NTF design in a single bit modulator choosing out of band gains much higher than one and a half a prone to result in or rather usually result in the modulator becoming unstable. This is a very empirical kind of thing and is often called Lee's rule. Now, yet another way of realizing a high order noise transfer function is the following and again I am going to resort to the single loop structure to illustrate the argument with the special case being where L naught and L 1 are the same and V 1 is nothing but, STF into U plus NTF 1 or STF 1 into U plus NTF 1 into E 1. Now, STF 1 is approximately equal to 1 in the signal band. So, this is U plus NTF 1 times E 1. Now, if you choose a small order for the loop filter let us say you choose a second order modulator here. So, that the NTF is of the form 1 minus Z inverse the whole square and you found that the in band quantization noise is not sufficiently low. One obvious option is to increase the order of the loop filter as we have done earlier. So, make this a high order single loop structure and that is accompanied by the usual tradeoffs of you know high order band gain, reduced stability and all this. Another approach is to say hey you know I have something here V 1 consists of something that I want plus something that I do not want right. If I have something that I want and something that I do not want the two approaches to reducing the stuff that you do not want. One is to divide this by a what you do not want by a large number right that is basically what is happening in the negative feedback loop. This NTF 1 is nothing but, 1 by 1 plus L 1 of Z. So, if you want to reduce the in band quantization noise you have two choices. One that we have been seeing so far is to use stronger negative feedback. So, that and that is accomplished by making L 1 a higher order structure right. So, if L 1 increases in the signal band the order of the loop of course, goes up and you have the usual tradeoffs that we have been talking about. Another way of removing what you do not want is to subtract. So, that is the approach that we will investigate next right. So, the idea is that when you are actually building the system you certainly have access to y 1 and 2. So, in principle you can you can determine e 1 by subtracting the 2 alright. So, let us do this. So, what is the output of the red circle here e 1 right, but this is in within quotes analog form. So, what I need to do is converted into a digital sequence. See please note that finally, this sequence that I have right. How is this error getting introduced is because I have a quantizer and that is an a to d converter and a d to a converter correct. So, the v 1 which you are feeding back to the input of the loop filter is the output of the d to a converter correct. Whereas, the sequence that goes to the decimation filter is the output of the a to d converter you understand alright. So, if I subtract the output of the loop filter y 1 from the output of the d to a converter right. I have basically with me an analog quantity right which is of not much use right until I convert it into digital form. So, at then I can do the subtraction correct. So, to convert this into digital form you need an a to d converter correct and one obvious thing to do is to say I give you the delta sigma structure there too why bother with a regular structure you might as well use a delta sigma loop to digitize e 1. So, let me just do that and let us see where this leads. So, I use a second delta sigma loop which has its own quantizer which introduces an error e 2 and has an output v 2 this has an output y 2 alright and this input is e 1. So, what is v 2 now e 1 times s t f in the signal band which is approximately 1. So, let me say v 2 is approximately e 1 plus e 2 filtered by a noise transfer function n t f 2 where n t f 2 is given by 1 by 1 plus l 2 right. So, we have with us v 2 and let me remind you again that the quantizer inside the second delta sigma loop is realized by a cascade of an a to d and a d to a converter. The quantity that you feed back to the input of the loop filter is the output of the quantity that you feed back to the input of l 2 is output of the d to a converter right. Whereas, the digital sequence that goes out of the loop is the output of the a to d converter is this clear alright let me I will come back to that let me repeat that little later. So, we have v 2 is being e 1 plus n t f 2 into e 2 and v 1 is u plus n t f 1 into e 1 and what are we trying to get rid of no we are trying to get rid of n t f times e 1 to the extent possible. So, what should you do I mean so what do you do what do you suggest that I do I have v 1 and v 2 right good. So, I want to multiply v 2 by n t f 1 and subtract that from v 1 correct. So, if I generate v 3 which is v 1 plus minus n t f 1 times v 2 what I will get is u minus n t f 1 into n t f 2 times e 2. So, what do we see we see that the effective noise transfer function after taking v 1 v 2 and what kind of filter must this be what should you do with v 2 multiplied in the z domain with n t f 1 which is equivalent to saying take it and filter it with a filter whose transfer function is n t f 1 what kind of filter is this it is a high pass filter, but in what domain is it it is a digital filter correct and. So, this entire processing is done digitally and this is v 3 and the noise transfer function is therefore, effective noise transfer function is n t f 1 times n t f 2 if for example, we had 1 minus z inverse whole square for both n t f and n t f both n t f 1 and n t f 2 then doing this will give us n t f 1 times n t f 2. So, which effectively gives us fourth order without increasing the order of any one of these loops see please notice that both of these loops have are loops of second order. So, they will have the stability problems or the stability properties rather associated with a second order modulator even though the overall structure is a fourth order structure. So, we do not have to worry about now about order band gain and saturating the quantizer and stuff like that, because the stability of the structure has to only do with the individual loops which are still of second order yes not really I mean in principle at least let us say no not really why. Because y 1 and v 1 are basically the difference between quantizer and the first quantizer correct. I mean I mean in principle you could you could exploit that and actually make the strength of e 2 smaller. You could I mean the point that he is making is that e 1 has got a restricted range. So, the second converter does not have to operate with the signal range as large as the as the first one right. So, it is maximum step size the quantizer inside can have a maximum step size which is much smaller than what there is for e 1. Quantizing the second loop, the job of delta 2 is to simply remove e 2 from outside I mean push it outside the signal band. I mean see another thing you can do is there is not strictly necessary to just process e 1 right. If you wanted for example, to use the same structure as the first delta sigma loop one could multiply e 1 by a factor right. Such that the signal is now much larger copy and paste the same loop as you had earlier right. So, that there is no change at all as far as design is concerned and you divide digitally down by the appropriate number and then subtract you understand. Now, coming back to your point if e 1 has got a reduced signal range right. Then it follows that the signal range of this entire second structure is now just everything is scaled by a small factor that is all. Because the because the step size is now much smaller yes right which is why if a if you use single bit quantizers on both sides then the quantizer designs becomes just the same right or to avoid the problem that you mentioned you can scale up e 1 not necessarily process e 1, but process say 16 times e 1 or 8 times e 1. So, that the all the signal levels are now back to what you had earlier right and then you can divide down digitally later. But at this point all that I wish to emphasize is that we are now having a high order noise transfer function without the accompanying baggage associated with realizing this kind of noise transfer function inside a single loop correct. Please recall that based on our discussions earlier if we try to realize 1 minus z inverse to the 4 in a single loop the stable range of the modulator would be very very small. Because this 1 minus z inverse to the 4 has got lot of gain at omega equal to pi it would simply saturate the quantizer and it would be finished. Now you have that without saturating the quantizer even if the input signal exceeds a small range because the individual loops are still second order. Such a structure is called a cascaded structure or also called sometimes called the mesh structure. Mesh stands for strangely multi stage noise shaping alright. So, I suppose the S H comes from here and M comes from here and A comes from here. So, when somebody says it is a mesh modulator basically he is talking about he or she is talking about a cascaded structure. Of course, now once you understand this you can see that you can say hey why did you stop with a cascade of 2 correct. You can continue you know you can now digitize the I mean you can you can keep doing this and add infinitum correct and use a third structure to quantize the residual error and add it and so on. But please note that when something sounds too good to be true it probably is too good to be true. So, if somebody is telling you that hey you can get away from the stability problems of the high order single loop structure here is this magic new way of doing it you should always smell a rat. And what do you think the rat is here I mean you all realize that basically what we are trying to do is achieve this cancel I mean this high performance by cancellation. And anything which depends on cancellation depends on depends on matching. You are now hoping that the stuff that you add here this NTF 1 times V 2 is exactly matched to NTF 1 times E 1. So, that when you subtract the 2 you get the cancellation that you want is this clear. And why do you think this is a tricky thing to achieve why do you think there is mismatch. So, let us put down the full structure I mean this is also a good time to address or repeat his question address is concerned. So, this is the cascaded structure let me instead draw the actual structure that one would have in practice this is an a to d I will draw all the digital quantities in magenta. And this must drive a d to a and similarly this is an a to d a d to a and what should I do to realize V 3 take V 2 pass it through a filter whose transfer function is NTF NTF 1 correct then subtract it from the signals in magenta are digital signals. So, this filter therefore, is a digital filter this is clear now. See at the input to a feedback loop you can only add or subtract quantities which are in the same domain right which is why you need the d to a converter here and here all right because these loop filters process analog signals all right. So, this is now we need this filter transfer function NTF 1 to match to match which one you need NTF 1 here. So, let me call this NTF 1 d just emphasize that this is the transfer function of the digital filter correct and therefore, it must match NTF 1 which is 1 by 1 plus L 1 should be equal to NTF 1 d if this whole scheme is to work as intent. So, in English the whole scheme is working like this the first loop gives you inside the signal band input signal plus shaped quantization noise. So, we somehow sense the quantization noise digitize it and get a sequence which is that noise and the process of digitization has added some error which is some e 2 which has been shaped through NTF 2 correct. So, we have two sequences one which is signal plus shaped noise of the first loop and a second sequence which is a digitized version of the quantization noise injected into the first loop plus shaped noise of the second loop. We need to get rid of the shape noise of the first loop. So, we take the output of the second loop pass it through a digital filter whose transfer function is supposed to mimic the noise transfer function of the first loop and subtract right and we are hoping that this is the same as this and why do you think there is a potential for error here NTF 1 d is realized as a digital filter. So, can there be any problem in the coefficients at all I mean can temperature change for example, change the coefficients in a digital filter no once you coded the filter it is there right. So, NTF 1 d is fixed and invariant what about 1 by 1 plus L 1 it is realized in the analog domain. So, presumably it depends on gains of amplifiers and that kind of stuff while we can attempt to make 1 by 1 plus L 1 what we want this cannot be guaranteed at all temperatures and over manufacturing variations and the like. So, there will be always a mismatch between the analog loops noise transfer function and the digital filter whose job is to cancel out that shape noise. So, what you will get in practice therefore, is u plus NTF 1 a stands for analog times e 1 minus NTF 1 digital times e 2 I am sorry NTF 1 digital times e 1 minus NTF 1 analog NTF 2 analog times e 2 I made a mistake must be NTF 1 digital times please note that v 2 is being being processed through a digital filter. So, NTF 1 digital times NTF 2 analog times e 2 is this clear all right. So, if the analog and the digital transfer functions match perfectly then the output v 3 is clean because these two have gone away and you get what you expect namely it looks effectively like a fourth order loop if you choose both these basic loops to be of second order is this clear. Unfortunately there will be a mismatch between the analog NTF and the digital NTF. So, the effective in band noise will be what there will be of you will get this of course, right, but you will also get a small portion of e 1 let us say the matching was 99 percent. So, there is only 1 percent mismatch between the analog and the digital filter transfer functions inside the signal band and so if there is a mismatch then you will get e 1 into NTF 1 into delta where delta is the mismatch for example. So, you will see that finally, v 3 which is ideally supposed to have no component related to e 1 at all right does have will have a component of e 1 through this factor delta which is a random number which depends on the mismatch between the analog and the digital transfer functions. So, to that extent you are not truly getting fourth order noise shaping you will get a mixture of second order and fourth order mismatch is very bad of course, it might turn out that this noise may swamp I mean please note that NTF 1 into NTF 2 is a very very small number in the signal band right because both of them are going as omega square right. So, effectively it is omega to the 4 in the signal band right whereas, this is of the form delta times omega square. So, if delta is not very very very small then you do not get any benefit or rather this you do not get the true fourth order behavior that you are expecting you only get something where you are doing about delta times 1 by delta times better than a regular second order modulator is this clear. So, this problem is called the noise leakage problem of cascaded delta sigma modulator of course, one can think of ways of calibrating this error see we have access to all the quantities. So, in principle at least it should be possible to go and tweak the coefficients of the digital filter such that it matches the transfer function of the NTF of the analog structure by in principle measuring the NTF of the analog loop and tweaking the digital coefficients in the in the digital loop, but this involves extra hardware complexity and all that stuff. So, you will see in general that cascaded structures are not as popular as the single loop structures, but there are several people who use cascaded structures very successfully, but there are problems associated with cascaded structure like any like any structure which depends on cancellation there are. So, we will continue in the next class.