 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. This lecture will be a continuation of our discussion on orthogonal frequency division multiplexing wherein we will discuss how equalization is greatly simplified when using OFDM. To recall our previous discussion on OFDM what we concluded is that if you look at OFDM as repetition of symbols combined with frequency shift that is if you repeat B0 multiple times B the symbol B1 multiple times but multiply them by appropriate vectors then the resulting you know wave form so to speak in the frequency domain exhibits a characteristic wherein B0 occupies a spectrum that is close to 0 hertz B1 occupies a spectrum that is close to W upon 4 hertz B2 occupies a spectrum that is close to W by 2 or minus W by 2 hertz and B3 occupies somewhere close to minus W upon 4 hertz. These are called subcarriers and these subcarriers follow a sync like pattern in the frequency domain and carry data. One remark that I would like to make is that you have to sample in the frequency domain exactly at this particular point. If you think about it sampling in the frequency domain is basically in time domain getting your frequencies exactly right. In other words you must have performed your receiver carrier calibration and carrier recovery phase estimation correctly for OFDM to be very effective. Otherwise you may suffer from some inter symbol interference because if you do not sample at the right point you make a contribution from the neighbouring symbols. Let us now continue we were discussing that we can use the DFT or to be technically correct the inverse DFT matrix to take your symbols B0, B1, B2 etc. and convert them to a format where they occupy these narrow band subcarriers in the frequency domain. Now if you start increasing the number of subcarriers you will see that the spectral footprint of those sync like pulses become narrower and they occupy a much narrower bandwidth yet you are able to parallelize. In this current picture again we have split our bandwidth of minus W upon 2 to W upon 2 into 8 parallel OFDM streams and these 8 parallel OFDM streams are essentially allowing you to send you send this data at the same data rate you know your data rate is unchanged as it stands yet you are able to put your data in parallel frequency bands. So in other words B0 occupies close to 0 hertz B1 in this case will occupy I believe close to so if B5F4 is close to W by 2 then I believe this should be W by 16 this is 2W by 16 3W by 16 yeah I think it should be W by 8, B1 occupies W by 8, B2 occupies W by 4, B3 occupies 3W by 8, B4 occupies W by 2. So it is like this is like and so on and so in this particular instance you have 8 subcarriers these 8 subcarriers are reflecting narrow band transmissions in the frequency domain. If you increase the number of subcarriers to something like 16 then again the subcarriers become narrower and narrower they become very very close in the frequency domain one remark again this is something which we will not cover in this course but something you should remember is that getting the frequency sampling wrong meaning not calibrating the receiver frequency correctly can result in a significant amount of inter symbol interference that reflects in the frequency domain this inter symbol interference that reflects in the frequency domain can significantly hinder your performance that is something that you must remember. Now we will remember we will recall our DFT based picture technically what we said is you can use the inverse DFT matrix which was that 1 1 1 1 j minus 1 minus j and so on to enable this kind of modulation this should be n sorry enable the kind of modulation that you just saw wherein your symbols were put in parallel frequency bins. So how do you do that? So we will now slightly alter the way we looked at it it is the same thing but with just different rotation we will say that our data we will collate into B0 B1 B2 up to Bn minus 1 let us say we take a single block our idea was to repeat B0 repeat B0 multiple times that is why B0 is multiplying the B0 is multiplying the all 1s mid you know column B1 is also repeated n times but being multiplied by e power j omega naught n in this case it is e power j 2 power by n e power j 4 pi by n we are taking n point d f i d f t that is B2 is multiplied by e power j 4 pi by n e power j 8 pi by n and so on and finally, Bn minus 1 is being multiplied by this particular vector this is scaled by 1 by root n this 1 by root n scaling is to ensure that this matrix is unitary. If you recollect in our previous lecture we defined our w which is the inverse dft matrix as 1 for the 4 case 1 1 I believe it was 1 j minus 1 minus j 1 minus 1 1 minus 1 and finally, we had 1 minus j minus 1 j we wrote w Hermitian also it is for posterity write it 1 1 1 1 1 1 minus j minus 1 j I am taking the conjugate 1 minus 1 1 minus 1 and I believe this should be 1 j minus 1 minus j and we said that w Hermitian w was 4 times identity. So, what I am going to do is I am going to just divide this by 1 by root 4 and divide this by 1 by root 4 and I get identity the 4 cross 4 identity this 1 by root 4 is very very useful because it scales w. So, that w Hermitian times w is identity another thing is that the scaling also has another important use this w Hermitian w being identity implies that you are not scaling the vectors energy. In other words if you are multiplying by b then the energy of b does not change how so let us go back and see. So, if you see our x is w times b where b is this particular vector which we have let us just work this out ok. So, suppose that my b vector is b 0 b 1 say b n minus 1 let us actually evaluate expectation of norm b vector square what will it be this is equal to expectation of b Hermitian times b which is equal to summation l runs from 0 to n minus 1 expectation of mod b l square why because b Hermitian b is just sum of the magnitude square of the elements. Now, since we assume that our symbols are generated IID with the same average energy this is going to be n times E s where E s is your signal energy n times E s is the signal energy. Now, our x is w times b the question which we are asking is after doing this IDFT operation are we using more power or less power. So, to do that let us evaluate expectation of this Hermitian x ok because that is summation of mod x i square this is equal to expectation of let us play a matrix trick x is w b Hermitian w b ok. Now, here this is equal to expectation of b Hermitian w Hermitian w times b, but w is a fixed matrix it is not statistical and what did you just show you said w Hermitian w is identity in fact identity n for the n cross n case. So, this is equal to expectation of p Hermitian b which not surprisingly is n times E s this is very very useful result because if you now use this scaled version of w with the 1 by root n we have ensured that the energy usage does not change. In other words the IDFT matrix in this particular form you ensure that the energy usage does not change I will give you a warning in GNU radio the IDFT matrix has a scaling related issue you know issue not issue it just scales the signal differently you have to account for it is very easy you just have to multiply by a factor, but just something to keep in mind that we will be using this particular IDFT matrix picture because if you then have this property w you can check w Hermitian w w Hermitian is identity n of course in the notation it is much more convenient for us to do our analysis. In other words if the budget for your signal power is E s in the transmitter then the x which you get by multiplying b by this particular w is also you going to use the same amount of energy per symbol. Now since w is a unitary matrix we just showed that x Hermitian x is equal to b Hermitian b actually expect in expectation sense of course ok will be equal to n times E s of course if you use a symbol like QPSK right for QPSK this will be true irrespective, but if you use something like quam 16 or something you have to put an expectation. Now x is the inverse DFT of b now here is the key we never spoke about how we can get back b from x at the receiver let us suppose that there is no channel and there is no noise then since x is the DFT of b all you need to do is x is the IDFT of b rather all you need to do is to take the DFT of x because the DFT and IDFT are lossless you know lossless reversible operations. So, at the receiver what you can do is you can just group n symbols take the DFT you will get back your b of course there are some issues you do not know what happens when there is noise you do not know what happens when there is a channel that is something which we will see the bandwidth usage is nominally the same the channel split into K or n narrow band sub channels or sub carriers, but now let us see what happens when we have a channel when we say channel we have a convolution and we have noise addition that is something which that we have to handle. So, we will take a small detour and aside and remember the connection between the discrete Fourier transform and convolution. If you remember from your DSP if you have two sequences let us say x n and h n if you take their n point DFT's and refer them to capital X k and capital H k respectively when we say n point DFT we take the n point DFT to be summation x n e power minus j 2 pi k n upon capital N. So, capital X k and capital H k are defined for numbers between 0 and capital N minus 1. Now, if your y k is h k times x k if you multiply the DFT's of two sequences then the sequence that corresponds to is not the convolution it is the so called circular convolution that is why I have put a C. That means that whenever you perform in the traditional sense if you use DTFT if you multiply DTFT's of two sequences then the inverse of that will be the convolution of those two sequences in the sequence domain unfortunately over here when you have DFT's that are being multiplied then your resulting sequence is something which is circularly convolved. That is your y n is going to be summation l is equal to 0 to n minus 1 x l h n minus l mod n or you just swap h and x is the same thing this is not the same as linear convolution. Now, let us go to our picture of OFDM in the OFDM case we took the IDFT we then it underwent convolution with a channel. Now, the problem is that if you want to exploit this particular property of single tap equalization or just division based equalization let us see I am just saying that suppose your you know h is known and your y is known then to get x you just need to y upon h at least at the for this you know something like a zero forcing equalizer that you just saw you can just do y upon h or for MMSE you can do y upon some you know function of h the problem however is that this is valid only if you have circular convolution, but any practical channel that you saw when we were dealing with this MMSE and zero forcing equalizers performs linear convolution and not circular convolution. So, what do we do? So, see since we want to use the DFT IDFT property we want y k is equal to x k times h k we want that, but the natural way the you know nature is not giving you that it just says I am going to do linear convolution. So, what can we do? The way to do it is we can actually fake circular convolution by including what is called a cyclic prefix that is we group our symbols in this manner b 0 b 1 b 2 up to b n minus 1 we take the IDFT and we what we get we call x 0 x 1 up to x n minus 1 this is your x vector so to speak and we had a cyclic prefix of for the form x n minus 3 x n minus 2 x n minus 1 what is this achieve? Let us actually analyze this. So, let us say that you have x 0 x 1 x 2 x 3 let us take this and let us suppose that you want to convolve this with h 0 h 1 h 2 and you want circular convolution how do we achieve this? To perform the circular convolution what we will do is we will write x 0 x 1 x 2 x 3 and we will write h 0 flipped h 0 h 1 h 2 and we will multiply and add. Now, sadly over here h 0 times h 0 you should the linear convolution give you h 0 times x 0 but the circular convolution will give you h 0 times x 0 plus h 2 times x 3 plus h 1 times x 2 unfortunately that is not there. So, what we can do is we can actually just modify our sequence to append this over here. If you append these over here and then perform the circular convolution in this region let us just look at the output in this region you are going to have h 0 x 0 plus h 1 x 3 plus h 2 x 2 this is exactly the output of the circular convolution that you want. Let us look at this one also we have to shift this by 1. So, you will get h 0 x 1 a linear convolution would also have given you h 1 x 0 no problem, but a circular convolution will need will give you h 2 times x 3. So, by pre-pending these you are able to get the circular convolution in this regime and we will ignore this part. Therefore, the way we achieve this circular convolution in the OFDM cases let us say you have x 0 x 1 x 2 x 3 then you have the next symbol and deliberately adding a gap let us say x prime 0 the next group of symbols you know next these x prime 1 x prime 2 x prime 3. What you do is you take you take these let us say 2 of these just for an example let us say you take these and you prepend them over here. Similarly, you take these x 2 prime x 3 prime and prepend them over here sorry about this then as you perform the convolution with h your h 2 h 1 h 0 moves move moves your h 0 h 1 h 2 you ignore the convolution result at these points just take these you again ignore the convolution result at these points and just take these these points will be circularly convolved. This is the trick that we play and by playing this trick of course you have to prepend some amount of data to the beginning this of course results in an overhead meaning you are repeating symbols it is not like you get something for free for OFDM if you are going to use the cyclic prefix let us say in this case we are using 3 symbols earlier in n time if you have n symbols you are sending them in n time instances. In this case for n symbols you are sending them in n plus 3 samples n plus 3 time instances. So, your overhead is actually n upon n plus 3 in or rather the efficiency is n upon n plus 3 because you are reducing the data rate ever so slightly. This is one of the reasons why if you look at the FFT size n in OFDM the n is essentially chosen to be as large as possible for supporting the data rate and you choose the cyclic prefix length to be close to or just slightly above the expected channel length in number of tabs. For example, we have a 3 tab channel head 0 h 1 h 2 the cyclic prefix needs to be at least 2 in length typically you will choose more because if you then have to run your system in an environment where there are more tabs needed then you do not want it to fail. So, the circular convolution produces overhead and in fact, let us say that you know I can define a term called let us say OFDM's efficiency this is not a very standard term this is equal to you can say n upon n plus c p length or alternately the overhead is c p length in you can think of this as a fraction or n percentage. So, the OFDM efficiency is n upon n plus c p length meaning you want your n to be much larger than c p length or c p length to be much smaller than n of course, c p length has to be chosen to be length of channel typically length of channel minus 1 that is something to keep in mind. So, the key idea that we are doing is we are taking the cyclic prefix and by taking the cyclic prefix even after you convolve with the channel you can ignore the part that comes out the y that comes out after convolution from the channel just previous to this actually this is let us say y prime n minus 2 n minus 3 and take only this part this part is circularly convolved that is within the part after the cyclic prefix at the receiver you have circular convolution what does that give you. If you do this then if you take the DFT of this part which I have highlighted then you are going to get y k which is h k times x k which as we promised is giving you a flat channel. In other words if you manage to do this cyclic prefix based you know extra effort the resulting y k you get has undergone just multiplication by h k which is a much simpler equalization problem because you just have to multiply or divide by a single number let us say it is MMSC or you know let us say it is a 0 to 0 forcing you can come with a simpler equalization in this particular approach that is the key idea. One thing we have not seen is the effect of noise that is something which we will address now the overall model is h n convolution w n sorry h n convolution x n plus w n is what we have if we consider vectors of the form w you know y is y is equal to y 0 y 1 up to y n minus 1 transpose and so on and similarly for x ok. If you assume an appropriate cyclic prefix so whenever we say appropriate cyclic prefix we say that the cyclic prefix length is long enough so that the impact of the channels has been converted to a circular convolution within the region of interest. Then if you now choose the w which we chose earlier the w was the IDFT matrix scaled so that w Hermitian w was identity at the receiver if you do w Hermitian y y is only the part after the cyclic prefix you get w Hermitian h circular convolution x now h circular convolution x if you take the DFT of that you get h k x k. Now what about w Hermitian w now that is something which we call w prime but let us look at what w Hermitian w is let us say our w is w 0 w 1 I will call it noise w n minus 1 and this is distributed as complex normal with mean 0 and let us say we will assume identity covariance it is scaled that is you do not have sigma square i because I have taken the sigma square as a scaling and just go to scale my E s so that E s by sigma square is my new E s. In this case my noise is w if I do w Hermitian times w and call it w prime let us look at the covariance of w prime expectation of w times w prime times w prime Hermitian is equal to we will play the same trick as we did earlier w prime w w Hermitian sorry this will be w Hermitian w w Hermitian w ok let me just redo this carefully yeah w prime is w Hermitian w. So, this is w Hermitian w w Hermitian ok now since this w is a fixed matrix this is equal to w Hermitian times expectation of w Hermitian times w, but this is identity as we saw here. So, this is equal to w Hermitian w which is equal to identity of the same size in other words taking the DFT of the noise results in a noise sequence that is the same distribution in other words because of the fact that this scale DFT matrix is just a circular you know it is it is just like a rotation matrix the noise variance does not change. Therefore, this w k are actually IID because why chose my w is IID they have the same variance as w this is the key this is true only in the case where your w has a covariance which has some scale version of identity which is what we are going to consider. So, w prime k has the same variance of w n and it is IID just like w n. Therefore, this is actually something like a very plain single tab scaling additive white Gaussian noise channel and it is very very easy and simple to handle. Therefore, you are able to now bring back all the tools that you learnt except that it is very very simplified because you just have a single tab it is not a filter your OFDM is converted this convolution filter to a channel like this. Of course, there are some prices you have paid for like cyclic prefix and you know a stranger kind of frequency footprint, but it is very very easy to implement a receiver for this if you look at the tradeoffs. So, let us summarize what we have learnt white band channels can be paralyzed for simple equalization you just want to put your data in parallel frequency bands and using the DFT or an IDFT is a nice way to make the channels parallel channels parallel one key requirement is that we need circular convolution and this is enabled by using the cyclic prefix that is an overhead and because of its ease of implementation and several advantages OFDM is used in several modern wireless standards and in fact all standard like Wi-Fi, LTE use some variant of OFDM and several wired communication also such as ADSL use a variant of OFDM called discrete multi tone and OFDM has seen a lot of success in several wireless standards as well. In the next lecture, we will go through a couple of examples of implementing OFDM on GNU radio that will make the concepts very clear. Thank you.