 Welcome to this lecture on digital communication using GNU radio. My name is Kumar Appaya and I belong to the department of electrical engineering IIT Bombay. If you recall, we have been discussing suboptimal equalization algorithms. In that context, our aim will be to implement the zero forcing equalizer first. Remember that the zero forcing equalizer was much simpler to implement and its aim was to completely eliminate the interference wherever possible. We will use GNU radio to implement a zero forcing equalizer for a sample sized mean an equalizer that works at the sample rate and then we will also extend it to work for the equalizer that we have been using as a running example where the receiver samples at twice the rate of the symbol sent by the transmitter. Let's go towards the GNU radio implementation. We will begin our exploration of inter-symbol interference by first putting together a simple psk example to see how inter-symbol interference affects us. For simplicity, we will just be doing a baseband simulation. Let us begin by first getting a random source as usual, Ctrl F type random and we get a random source, we will double click the random source and make the type byte and make it go from zero through four. We will next get our constellation object and constellation encoder and we will set up a qpsk constellation. So Ctrl F, C, O, N, S, T and we have constellation encoder that we will put here and a constellation object that we will place here, we will double click the constellation object, we will call it MyConst and the constellation encoder will be an instance of this object MyConst. We can connect the random source to the encoder, we will grab a throttle Ctrl F or Ctrl F, we will say throttle because we are performing a simulation. Now let us now put together a channel as well and let's keep the channel very simple. We will assume that our channel is just a finite impulse response filter that just adds some extra copy of the signals who to speak. So we are going to perform one sample per sample kind of one sample per symbol a simulation and we are just going to add a channel by just using an FIR filter. So Ctrl F for command F, we will say interpolating FIR filter and this interpolating FIR filter can be connected. We will keep some flexibility in the tabs, we will double click the interpolating FIR filter and we will say the tabs are 1, ISI where ISI is actually a variable. We will control this ISI which stands for inter-symbol interference using a QTGUI range. So Ctrl F for command F, we will say range and we will place the range over here. Let us make the values of this ISI range go between minus 1 and 1, let's make it 0 by default, we will make it go between minus 1 and 1 and step 0.1. So this is basically some amount of the copy of the signal being received. We will also add a bit of noise, so Ctrl F for command F, I will add another range and we will call this range noise STD standing for noise standard deviation, its default standard value is 0, starts at 0, goes to 3, step 0.1, grab a noise source, Ctrl F for command F, noise, we will add Ctrl F for command F, we will say add and finally once we have added we can inspect both the time domain view as well as the QTGUI constellation sync. So Ctrl F for command F, we will say time, we will grab a time sync, Ctrl F for command F, we will say constellation, we will get the QTGUI constellation sync also, we will connect them, QTGUI range has to be linked to noise STD that is something we missed, we will make the amplitude of the noise noise STD, so initially we start with no noise. So now if you look at the constellation, it's a nice QPSK constellation and these are the QPSK values, 1 plus j by root 2 and so on, that's why this goes between minus 1 upon root 2 and 1 upon root 2, everything looks good, we will add a very little bit of noise and with noise this is what you get, everything is good. Now let us actually introduce inter-symbol interference, temporarily let's only view the real part of the signal, if I add inter-symbol interference you can see that there is a split happening, the splitting is because your symbols are essentially now not getting reproduced at the receiver faithfully, you are now convolving it with the filter of the form delta N plus ISI times delta N minus 1, so what you receive is actually for example it is 0.2, so your YN is actually XN plus 0.2 XN minus 1 which is why you have a QPSK constellation superposed with a smaller QPSK constellation, in fact in this particular case if you look carefully the distance between the center of this mini QPSK constellation and any of these is going to be roughly 0.0, this case I chose 0.3, 0.3 times the original, so now you can clearly see that you are now less robust to noise because of this particular aspect. Now the first thing that we are going to do is to perform zero forcing filtering, so how do you do zero forcing filtering? To perform zero forcing filtering the very easy approach is to construct the inverse filter in this case, in this case like I mentioned the filters impulse response is delta N plus ISI times delta N minus 1, so its Z transform is 1 plus Z inverse times ISI, so let us put in an equalization filter, controller for command F, I will say interpolating FIR filter, I will double click this, we cannot use an FIR filter, I will do IIR filter apologies, so controller for command F, we will say IIR filter and we will make it complex to complex, float taps that is fine. Now in the case of IIR filter you have to specify the feed forward taps, in this case it is 1 and the feedback taps, in this case it is 1 comma ISI. One more aspect is that this old style of taps should be tested to false, essentially because this used to be a compatibility setting for use with MATLAB or other software based filter designs, so we will set it to false, so this filter is actually 1 upon 1 plus Z inverse. Now let us connect the output over here, we will connect this output over here to these two to view them simultaneously, so we will double click the QTGUI time sync, we will make the number of inputs 2, we will connect this constellation sync, make the number of inputs 2 and let us connect the outputs over here and execute our flow graph. Now if you see you have our constellation looking okay, if you now increase the noise you will see that they look identical because essentially the ISI is zero, your equalizer is not doing anything, it is actually just ISI is zero, it is 1 by 1, it is just a regular no delay all pass filter, but the moment I add ISI you can see that even though the unequalized values are getting split, the equalized values are essentially coming back to the right point, but one problem is that they are very susceptible to noise, let us now go back to the original and let's say that the noise is let's say somewhat high, okay let's put it like at this particular, let's increase the number of points first to make a better observation, so I am just going to make this 10,000 samples, I am going to increase the number of points in my viewing syncs, both constellation sync and time sync to 10 times the number and now if I increase the amount of ISI, sorry first noise, you can see this, if I increase the amount of ISI, you will see that the constellation spread is there, but now if I make the ISI more and if I make the noise more, you will see that the noise spread significantly. Now in the absence of ISI, let's say in this case the inter-symbol interference is 0.5 over here by our definition, if I reduce this to 0, you will see that the noise enhancement is actually very very little, in the sense this is still a good constellation, but if I start increasing this, then you start having problems because if I start increasing the ISI, the red constellation is spread, why does this happen? This can be attributed to the fact that the zero forcing equalization filter inevitably enhances the noise because to cancel out the interference, cancel out the inter-symbol interference, it has to essentially bring out the required component from the vector space, this is something that we saw in the lecture and therefore you have to suffer the consequences of noise enhancement. In fact, you will see that if the ISI, let's keep the noise at a very small level, let's say the noise is 0.1. Now if I start increasing the inter-symbol interference, you will see that as the inter-symbol interference gets to let's say exactly around 1, you will see that the data is essentially gone and it's like gone far away, why? Because when the ISI is 1, your filter is essentially 1 by 1 plus z inverse that has a, it has a pole at z is equal to e bar j pi which means that it actually is going to amplify the noise significantly, that is it's going to significantly enhance the noise at the near the pi. For example, let's actually just make our resolution of this ISI, this ISI's range, just make it 0.01. Now if you run this, you will see that let's add just a little bit of noise, I'm just going to add a little bit of noise. Now if I make the inter-symbol interference fraction, let's say close to 0.95 or so, 0.95, 0.96, you can see the immense amount of noise enhancement. The reason for this is that the noise at the higher frequencies is significantly enhanced. Now if you similarly go to the negative of the ISI as well, you will see that the, over here the noise at the lower frequencies is enhanced. So you're going to suffer either way, so when you have inter-symbol interference there's really no way out. In fact a hint should be, hint of why the zero-forcing equalizer should be is bad in the low SNR scenarios is clear from this constellation. See your signal essentially spreads and the blue blobs indicate what the received signal is. They are pretty clean and if you perform an equalization such as the Witterby algorithm based maximum likelihood sequence estimation that we saw in class, since the noise is low you are likely to get a much better estimate of the sequence. Of course the slight price you pay is that you have to perform more operations. But if you blindly use a zero-forcing equalizer and in situations where you have this kind of channel, your noise enhancement can be severe and that is something which you can clearly see over here. Now let us evaluate the running example that we discussed in class on GNU radio to visualize how it works. If you remember we had a transmit pulse that was a rectangular pulse whose amplitude was one between zero and two seconds. The effective channel was modelled as two impulses one with an amplitude of one at one sample and other at the second sample with a minus half. If you know convolved GTX and GC you end up with PFT which effectively looks like this where between the first and second samples it is one, second and third samples it is half and the third to fourth samples it is minus half. It is evident that since the rate at which you send the symbols is two samples per symbol the third part this part is definitely going to have some inter-symbol interference because the length of PFT is more than the length of one symbol. Let us now model this on GNU radio. Let us begin by first adding a random source. So controller for command F will say random and grab a random source. As always since I want to use a QPSK constellation I will double click my random source make the maximum go up to four and the data type as a byte. The next task for me is to add a constellation object and an encoder that uses that object. We will use the standard QPSK constellation that is present there. So I will do controller for command F, C O N S T and I will get the constellation object and this default QPSK constellation is suitable. I will just change the ID or the name to my const. We can grab the constellation encoder and this constellation encoder can be connected and double click on it and we will call the object my const. Now before forgetting let us add a throttle controller for command F. We will say throttle and this throttle will ensure that our simulation does not hamper our computer performance. Now the next thing that we have to do is to add the impact of the channel. Now in one shot I will add the effect of P of T. Remember P of T had the response of the form 0, 1, half, minus half and we were sending symbols at two samples per symbol. So I do controller for command F and to do two samples per symbol I need to perform interpolation. So let me grab an interpolating FIR filter. So I'll grab the interpolating FIR filter and I have to now be careful in setting the interpolation to 2 to make my samples per symbol as 2 and the tabs I will set as 0, 1, half, minus half. Now to ensure that we are getting the shape that we want let us actually add a time sink. So controller for command F and type time get the time sink and temporarily just make this interpolation 20 just to see whether we get this response correctly. So if I say okay and we hit execute let me stop this and then just say stem sorry not semi log I'm sorry stem plot. You can clearly see let's focus on the blue one you can clearly see this one half minus half kind of shape of course it's not 1 it is 0.7 because the constellation points are of the form root 2 sorry 1 upon root 2 plus j upon root 2 so the real part will be of the form 1 by root 2 or minus 1 by root 2 which you see here but it's this amplitude half of it and negative half of it and there are a total of 20 samples of gap in between these. So this is correct. So let us now reset this to 2 and let us remove the time sink. Now to complete our transmission to reception phase all we need to do is to add noise. We will take our traditional approach to add a QT GUI range to control the noise so controller for command F we'll say range we'll grab a QT GUI range we will set the range default value to 0 stop at 3 step 0.01 now we can add our noise source control F for command F we'll say noise and double click this make sure that noise STD is the amplitude so that the standard deviation of the noise is what we provide through the range and we'll call our range also as noise STD so everything is set. Next we grab an add block control F for command F we'll say add and we have our signal over here let us just pass it to a virtual sink so control F for command F we say virtual sink connect it over here we'll call the stream as it's a RX signal. So now we need to perform zero forcing equalization on this RX signal. Let us now recall what the optimal zero forcing equalizer was for sampling at twice the symbol rate. Now from our lecture recall that one way to interpret our effective channel that P of T if you sample at twice the symbol rate is two channels one of them having the form 1 minus half z inverse because this corresponds to that symbol that P of T is part where it is one followed by where it is minus half which is two samples later and the second one being half therefore effectively you have h1 of z being 1 minus half z inverse and h2 of z being half. Now what you need to do is you need an equalizer that satisfies summation hi of z gi of z is equal to z power minus d that is you can combine them and effectively get one or just a causal delay a perfect delay. Now if you recall from our matrix operations we found that the zero forcing equalizer was 5 upon 8 5 upon 8 5 upon 8 minus 1 upon 8 2 upon 8. Now if you reverse the coefficients and carefully choose them you get minus 1 upon 8 and 5 upon 8 s g1 of z and 2 upon 8 plus 5 upon 8 z inverse plus 5 upon 8 z power minus 2 as g2 of z and these you can confirm if you do h1 of z g1 of z per each 2 of z g2 of z will give you z inverse therefore in this situation we are going to implement our g1 and g2 in GNU radio to verify that this essentially equalizes our signal. First let us grab a virtual source so that we have the signal that we want to equalize double click this virtual source call it RxSig. Now this RxSig has to be split into two parts because we are sampling it at twice the symbol rate. I am going to add two decimating filters taking the alternate samples. I will do control F or command F as a decimating FIR filter and I am going to decimate by a factor of 2 but in the first filter I am going to take the first set of samples and I am going to do control C control V and in the second set of second filter I am going to take the second set of samples by doing 0, 1. Now if I connect these I now have the first set of samples corresponding to 0 and half and here I have the second set of samples corresponding to 1 and minus half. Now if you recall the h1 of z was our 1 minus half z inverse and for that we had to add the filter which was of the form minus 1 by 8 plus 5 by 8 z inverse. Let's just grab an interpolating FIR filter. So control F or command F let's say interpolating FIR filter and we'll just make the interpolation as 1 and say minus 1 upon 8 comma 5 upon 8. The other one I do control C control V. The other one if you remember was 2 by 8, 5 by 8, 5 by 8. This was what we found in the lecture and then we have to add these up. So control C I'll just grab this add block control C control V and we will add these two up. By adding these two we will get our desired response to confirm I'll get a constellation sync control F for command F C O N S T E oops yeah QTGA constellation sync and let us now run this and you get a nice constellation even if you add noise you end up getting the constellation equalized. Now to ensure that you know we are indeed getting what we want let us do one thing let us add three inputs to our constellation sync we'll make the number of inputs three okay and we'll say the first is blue the second is red and say the third is green maybe not green we'll say magenta dark green okay yeah so now we will add the outputs of our two filters directly so maybe I'll just make this visible to you and if you observe now let's add a bit of noise you will see that the red one looks pretty good the green one doesn't look that good but why now the red one actually if you recall what the red one is the red one is actually the output of that half h2hz equal to half essentially if you remember that P of t had one half minus half and the middle part if you sample properly or one of the parts will not encounter any ISI because essentially when the first and last parts are going to encounter the ISI so you have this particular configuration where this is actually half of 1 by root 2 visible but if you want to do the proper systematic zero-forcing equalization you have to end up getting this which is exactly what you wanted so it zeros out the inter-simple interference and gives you back the same thing with the proper amplitude that is the key of course if you keep adding noise then things start going bad because you're essentially performing zero-forcing equalization just if just like you saw in the inter-simple interference case previously here also you will be not that robust to noise because the zero forcing the equalizer amplifies noise especially in the low SNR case the impact of noise will be significant in this lecture we saw a practical approach to implementing equalization using the zero forcing equalizer in GNU radio as you saw it worked very well for canceling the interference when the noise was limited but in the lower SNR regime because of the fact that the zero forcing equalizer enhances the noise power its performance degraded significantly in the next lecture we will discuss another suboptimal equalization approach that does slightly better than the zero forcing equalizer under some circumstances and then evaluate how well it does in GNU radio as well thank you