 and then you have your actuator which is physically in the analog domain and plant analog domain. Sensors may be analog to digital depending upon whatever is a sensor interface and then you typically have this setup for any megatron system and you may have feedback in some cases like you may be missing the feedback also. The sensor feedback may not be there some systems are like that but in general you have this feedback control happening in especially high fidelity megatron scan of the system. And then we saw some basics of what happens when the signal is sampled especially when you take the sensor signal which is an analog domain and you sample it and like you want kind of represent it in the digital domain. And now we are looking at how the signal is thankfully representing what it is supposed to be. The contents of the signal in some sense are preserved when you sample it. That is what we are discussing and for that the main theorem is about the Shannon sampling theorem. So a couple of these questions you should be keeping in mind and seek answers for. How do we kind of say that the samples are true representation of the original signal? Or how do you recover the signal back from the samples? Are there any method? Is there any method or under what conditions we can do this complete recovery back? And how is it applicable to our case? Like say this PWM is going to the motor as a sampled signal. So now you may have a little bit of a clarity here. See this PWM is itself has this switching signal. It is quite positive and 0 at very high frequency. When we say sampled so for all our practical purposes what we consider this PWM signal when like you know implemented on a motor is that it is giving some average voltage to your motor. And that average voltage is now given as a sampled form. So this average is one value and after some time sampling time it is changing its value. That is how we can visualize this or look at this. Otherwise if you say okay oh my see PWM signal itself is sampled but it is at high frequency and if I want to consider that also into into accounting analysis then it is a different story okay. What we are assuming here is especially for PWM signal. See otherwise if there is an analog interface to control motor then absolutely no problem there to clear analog signal is at some value. During the sampling instant it remains constant okay and then like in the next sampling instant it is a different value. So what is this effect of this kind of a way of you know actually receiving these signals in this kind of a stepped form okay. Every sampling time the step value changes. So we will be looking at that in in new course. Okay so we started off with these fundamentals of sampling and this is analogy one can use our physical thinking can be done based on this. All the concepts that we see later can be you know easily understood if we connect it to this kind of analogy. Because this gives you some kind of a visual kind of a way to to think about stuff and we will see formally as we go mathematically how things work out but we will not derive the equation we kind of use some of these sampling theorems and the reconstruction part and things like that. So as we saw if you sample when this arrow is at a point before the 180 degree position okay. So if arrow is here and the next arrow position if it is before 180 degree position we can see that okay we can carefully kind of see the the field direction and velocity at that. Now you can see that you know see if I sample it here and it completes one rotation and goes beyond and again I take a second sample that is also a possibility okay. But that will indicate you speed which is not reality okay although the direction is same okay. You can see that you know the arrow is pointing here it completes one rotation and comes here and I take that as a sample. So even in that case the direction is is is proper but the speed is speed information is not proper. Further if I say okay oh it completes from starts from here completes one rotation complete second rotation and again comes to the same that position that is also one possibility. So so but that that will give you like the same speed when it is reproduced but actual speed has happened like with the two rotations in between. So this is information that is getting in some way okay. So how to see that in the frequency domain is slowly that we will look at that. So the frequency domain representation would like give you some all these kind of possibilities that that are there for for such a such a sample signal okay. So how that happens like we will see in a while okay. So so same thing extended now to actual signal and its time samples here okay. So you can see that here some models kind of a frequency sign wave is coming up okay. So you have original sign wave which is going at very high frequency and then when you are sampling it your like low frequency sign wave is coming up in the in the signal okay. So if you if you see this problem is similar to like you know this wheel kind of a problem okay. So the frequency at which you are observing the wheel to be moving is much slower okay and in the opposite direction for this particular kind of a case. So like that you will have this frequency of the sinusoid is much lower and its phase is also you know in not in line with the phase of this original kind of a signal okay. So that is how one can kind of connect these two things to kind of think physically what what might happen to your signal. Okay now this is like more kind of a formal mathematical kind of a representation of what we are talking now generalized to a signal okay. So this is a signal f of t which is in general like like you know evolving signal with some frequency content and what we are interested in is is a signal for which the frequency contents are typically of center signal. So so frequency contents are obtained by using like another Fourier transform of the signal and the numerical way of doing that is is past Fourier transforms and those past Fourier transforms would give you this kind of a plot of we saw some example signal here this signal okay. So this is the original signal and this is a past Fourier transform okay and in the in the f of t you can see that the signal has a content which is like know some frequency here and like know some small frequency at at at one end of here okay. So beyond that there are hardly any frequency content. So this signal is kind of bad limited to frequency of about like say 35 or that kind of a value okay. So so like that we can say that this signal typically is represented this triangle as or this is kind of a straight line has no really great meaning here I mean it just to signify that the signal has some content in this in this domain it may be like one kind of a single line or like multiple lines we don't know what the contents are but typically the signal is generally represented in this kind of a form okay. So so actually if you want to really see what is this then you need to take f of t but to us to kind of like know this for the purpose of the discussions people would represent the signal like saying okay it has some content here they represent these contents are in this kind of form and now the the question arises is that okay suppose I sample this signal and get these white dots these are the samples which are recorded in my computer okay this is coming up as a vector array in my in my computer then what is the frequency content of such a such a signal okay. So so this frequencies can have a multiple kind of values here okay how that is happening is is based on some mathematics of Fourier transform so this this signal is represented for the mathematical kind of a transforms the Fourier transform for sample signal the sample signal needs to be represented in in terms of some kind of a math and that is a mathematical representation of the sample signal direct data and then when you take a Fourier transform of this signal and do some kind of mathematical manipulations you end up with this sample signal Fourier transform okay. Now for this sample signal Fourier transform you can see that you can you can see that this this f is a Fourier transform of original signal in the analog program okay so so this sample Fourier transform is is represented in in in terms of some kind of a form of original signal Fourier transform so f of t is original signal and its its Fourier transform is f of j omega so this is f here okay so f of j omega is the Fourier transform but now when it is sampled there is some kind of a scaling that is happening here 1 over t some kind of a scaling factor coming and then there is a summation of multiple of multiple copies of this f of j omega which are replicated at frequency k omega s okay. So for example if k is equal to 0 value you can see that this is nothing but f of j omega here okay so that is one part one so k is equal to 1 then like no it is a shifted by frequency omega s and as omega s is the sampling frequency 2 pi over t okay so so that's how one can interpret these and with these if I want to plot it here say for k is equal to 0 this this will simply replicate here as as the signal f of j omega is this value and this will simply replicate here at f of for k is equal to 0 okay and then for k is equal to 1 it will be replicated at omega s value so you I need to kind of find where omega s s here and at that axis I need to again replicate the signal as it is from here to f of where k is equal to 1 where omega is equal to omega s value so this is what will come like this here okay so when the signal is like this its sampled form will look something of this sort here there is one time there is a replication then there is a second replication here then there is a third replication at the minus so so you see if it is it is minus infinity to infinity k value so it is keeping on replicating everywhere that's is that is the main crux of this sampling theorem that it says that your signal in the frequency domain will get like a mirror mirror itself at multiple omega s values okay and that has some sense I was talking about like you know even after like you know rotation of one complete rotation you'll have you know this the frequency can be same okay some kind of a sense of that information is coming here here your signal is getting replicated at multiple omega s values and and that's how your samples can be visualized so so your samples are just discrete data points okay if I see the frequency contents of those discrete data points they'll be represented in this type of form okay so so now if I start changing this omega zero so my frequency content of omega s okay I decrease the sampling frequency okay so I what you can imagine now this sample is first replica is coming here you can see the scaling also one what is scale scaling is happening here and now this part is going to come more closer to these okay as I start decreasing omega omega s okay as omega s decreases this will start shifting okay in omega s omega axis here and keeping omega zero same if I decreasing omega s then at some point like you know this omega s over two then these two will start touching each other okay so when omega zero becomes omega s over two I still have these two samples that these these signals they are touching each other so if you see there are these signals here still have the same kind of a form like a triangle form that it was there for the analog signal okay it is still preserved here but once you see that my omega s decreases below a certain value okay which is two times omega zero kind of a value then my signals will start interacting with each other and you see that there is a summation of these things okay so when they start overlapping you need to actually sum them up in the frequency domain is the frequency of the sample you you you sum them up in the frequency domain and like you know they they start now missing the information so this earlier signal was something of this sort and the new signal has now lost that information here okay new signal has beyond this frequency lost some some part of the information is getting lost okay so that is what is is is called aliasing and that is why the signal has to have a sampling enough frequency enough so that you know we don't see this loss of a signal okay so any question so far this is what is a crux of like no seven something one part which is you know that the signal should be sampled at least twice its largest frequency content so that it is represented like no in its full form in in in its in samples okay so in the strain gauge for your transfer there weren't any repeating triangles right right so so would it transform would give you a signal let's see which is only up to the first like no first part of the frequency contents okay only up to the the limit here see okay these are done like a digital Fourier transforms okay so this is done in a way that your maximum frequency here depends upon what is the sampling frequency so you you you assume that the signal has whatever aliasing that had happened already and beyond that like you know whatever is the signal content it is produced only up to omega s over 2 omega s over 2 will be the frequency here so if you have sampled the signal at frequency I think in this case to be sampled it at a frequency of 1 millisecond or 1 millisecond what kilohertz so this maximum value here on this frequency axis can go only up to 500 and beyond that it will be we cannot represent because it's going to be a replica of the same thing is is assume it will not come as a part of the numerical you know a 50 method of like no getting a Fourier transform so so this understanding is implied here that okay this part is going to get repeated you know beyond this point and we hurts frequency that is there for the omega s over 2 value perfect god yeah I mean one can kind of set up your plots in a way that you want to kind of see them as plotted like that but a 50 algorithm does not by itself really do that okay so this is the main main part here so so you you see that you know when we take samples you know although these samples are looking as as these kind of points here as something possess in the frequency domain they are not seen as an emphasis okay that is the main thing that you should not confuse about okay they are seen as a continuous signal here okay okay when we do numerically some stuff there is a different story don't worry about that part but because it is sampled here it produces samples here also no that is not correct okay it produces this actually this this is like an analog kind of a signal here in some sense like you know this is analog means like it's a continuous signal here okay is in the frequency domain so see these are different domains of thinking okay so so frequency domain thinking like no easy is different from time domain thinking there is a transform that is happening in between okay so once you say okay this is the samples that I am representing here in the time domain that doesn't mean the frequency domain also I have only the samples no that is not correct that is not main thing one should not fall in that trap okay so clear this part like okay this is how like you know these signals get mingled up or mixed up and gets messed up okay when we start you know sampling it with a lower sampling frequency and now one can see that okay see if if I have my my signal in the form of that rotation suppose we take the field rotation example then omega zero value is what is of my interest so there is one kind of a say what omega zero is a frequency of order or the speed of rotation okay so that value will be represented here as omega zero signal and now if I sample it at multiple kind of you know different frequencies one can see that if the sampling is is not fast enough then then I will see that this omega zero coming up here if I measure from here see this this part is fs here or fs of fs replicated at you know so this is my zero basically okay so when k is equal to zero okay and now this is omega s value of here now omega s it will get replicated here again and omega zero from this side will come up here okay so this frequency is what I am going to see as a first frequency when I start replaying that signal okay and this frequency is now you can see that it is less than omega s over two okay so this is a much lesser frequency than original frequency omega zero that I had here okay that is what is going to be seen in this signal which is you know not sampled enough actually that's how one can start thinking about this and okay so so like that one can see whatever that rotation way of doing things can be seen now in the formal you know mathematical representations yeah okay now Shannon has proposed for the reconstruction now the question is okay you said okay if I sample it you know faster than twice the frequency contents of the signal the signal can be completely decreased I mean the signal can signal contents are preserved so now the question is how do I reconstruct this signal back okay and there is this other derivation mathematical derivation is more than the derivation like now there's how this formula comes up from from basic you know Fourier transforms and like how this expression comes up by considering the filtered version of of that signal okay so you filter this signal by by using so your your sampled signal is like having now many such kind of replicas here we want only for first replica which is at zero the frequency replica that value that that is what we need to kind of preserve and so we filter this signal using this ideal filter which is a flat filter here with the with the scaling t so that we cancel out this one over t by this scaling factor and then we can produce this signal back okay that is how one can think of reproduction of the signal in the frequency domain and by using that those kind of fundamentals one can work out the the what is what is happening correspondingly in time domain and that's where like you get this you know formula for time domain representation of the signal now so this is how like you know the signal can be reconstructed from the samples now let's understand what what is it this this part is doing here okay these are the samples this is FSKT is a is a is a samples of this sample sample of the signal and then each of the sample is multiplied by some kind of a function here okay and then they are all added up together is what gives you this reconstructed signal back okay so and then this particular function is of the form sin theta upon theta okay so we'll see what is this function looks like okay let's kind of see that now so reconstruction part is having this kind of a formula what we have seen and and now we will see how one can construct the the samples back the signal back from the samples okay so say these are the samples here okay so these are different color kind of you know things have been sending samples at T2, T3, T4 things like that now this function as as saying that it's sin theta upon theta kind of a function and if you know from your like mathematics this function will have a if you see sin theta upon theta limit as theta tends to zero its limit is actually one okay so so this function is is is called sometimes sin function sin theta okay and it has some representation of this kind okay so if you plot it against theta when theta takes value of pi then this this function is going to go to zero okay so at zero value all this sin theta upon theta and the limit as theta tends to zero is one and when sin theta is equal to pi this will take value zero and so on and so forth for like no integer multiple of pi values okay that's what is going to happen here okay and and this is a way that the amplitude will go on reducing because as theta increases like the overall value of this coming at one over theta so the amplitude is one over theta which gets reduced for a sin function okay so this is how like now this function evolves in in in theta okay now theta in our case here is actually pi for pi t minus kt upon t okay now what is what does it mean supposed t supposed to say k is equal to zero then this is like pi t over t okay okay and then like this this theta will take this value pi t over t and this this function will will have now variation coming in time okay so now instead of theta it will be coming as a time function here okay and when the time becomes equal to capital T okay this pi t then theta becomes equal to pi this value it will be equal to capital T okay you can see that right like no say k is equal to zero okay so this term is not there and now your t becomes like a capital T value then theta becomes pi and we know that theta is equal to pi this function takes value zero okay so when it gets kind of you know multiplied to this this has the scaling factor here additional scaling factor is f of kt so if this sample will scale this this signal okay so so this suppose this is a sample so instead of this one value at whatever like this value okay other thing okay let us let see when what happens when theta is equal to zero when theta is equal to zero part here this is the theta equal to zero position okay which is this y axis for this function plot at that point t becomes equal to kt that means like for each sample like no this function is going to get placed here okay at a sample value such that this one matches or lengths get scaled by by the sample value itself okay so I will have this say for for say k is equal to one if I want to put this here then t will be equal to capital T here so so at that point my theta is going to be zero so this this value one will get scaled by this f of kt factor and then it will come here so this is signal if I start now drawing and I know from here if I go one t apart I will hit theta is equal to pi value okay so this signal is going to come first as like this okay so for k is equal to one value this function is going to look like here okay and it will have some kind of propagation okay is this this is part clear any questions about this so we are just considering one case k is equal to one and then like no seeing the how this mathematical form or this function it's represented as for k is equal to one okay and then we need to consider there now that for k is equal to like minus infinity to infinity actually but we don't have samples before zero so we consider like a sample starting from zero and for sample here is maybe zero then how this signal is is is dependent okay how this construction is is seen okay so yeah not clear why did you choose this form of function because there will be interference between the consecutive sample reconstruction right right right so it's not it's not interference but this this so say if I now do it for k is equal to two I'll get another kind of a signal which is cached up here like that okay so this is two signal so this is still an approximation of original signal right so so I'm just kind of passing now k is equal to one k is equal to two only I have to consider k is equal to minus infinity to infinity then it is giving me complete signal it's not an approximation it is say if I limit myself to like you know some few values of k alone then it will be approximation if I consider all the values of k okay all the samples that are like you know possible possible for the signal to be considered then it is not an approximation but essentially you're still fitting it between the points right it's just that if you have a lot of points then it might look like an original signal no no it's it's not that so so look so it's not that you need to have in between points also no no but that's not what I'm talking about I'm talking about that it has all the samples are there okay so so right now I'm talking a little bit of a you know from the mathematical perspective saying that okay if I have all the samples known okay from from t is equal to zero to t is equal to infinity or k is equal to zero to k is equal to infinity all the samples I have I have available or beyond certain point I have my signal is zero for example and I know that okay all the samples are there then I'll be able to kind of reproduce my signal back completely so my doubt is if you evaluate this function at suppose t by 2 somewhere in the middle point more or less there will be a slight error right no that's what I'm saying like so so we'll come to that right say say for example between these two values okay t p and 2t like you know you have this signal coming up right now and this signal coming up right now so they are getting added and they'll produce some kind of form here okay then if you see if I consider next sample k is equal to 2 sample or k is equal to 3 sample okay I have this signal coming up so this is also contributing to this part is also contributing to something between t and 2t okay like that every sample okay say I consider this blue part okay blue part has also something to contribute between t to 2t then I consider next part okay like that if I consider all these parts they'll have something to contribute between this t to 2t and that's what is a beauty and problem both for I'll tell you why beauty and my problem okay so this the Shannon reconstruction considers all the samples and like you know every sample has some representation between these two values okay so if I go to 2t to 3t again like you know I can see that you know the previous samples also are contributing something and future samples are also contributing something okay ideally k is going from minus infinity to infinity but if I put it in a numerical software then it depends on how many samples I'm choosing for the summation right that's why you will have if you're doing the numerics anything anytime you'll have some approximation but it will be much better construction than like you know saying that okay I'm just holding this sample here and like you know I'm meeting till the next sample to happen and again I'm changing that value and holding it here again like that it's much better approximation than that okay so or if you have this some kind of some linear kind of interpolation between the two samples that is other kind of a construction that can be possible but that is not still a Shannon reconstruction because the signal is not smooth like it's not getting it feels exactly what it was but if I even if I use like say for this sample I use two future two future values and two past values okay and reconstruct that that itself with the Shannon kind of a formula it will give you give me much better kind of approximation it's a smooth function that is going to come up like that okay your signal is actually in some sense getting reproduced you know in a very smooth manner and if k is equal to infinity then it will be like exactly but now the problem is that for any reconstruction here I need a future values all the future values and in our mechatronics system or real-time control system is impossible to get future values beforehand right because your feedback is happening because based on the feedback the future values will come okay so so you cannot have the channel reconstruction possibility in the mechatronics control systems at all so this is a very important aspect of these that okay whatever reconstruction that we need to have they need to be causal in nature they should be using only the previous samples values okay they should not be using the future values which we don't know okay so this standard reconstruction is not a causal reconstruction it is using all the future values to construct the signal fact that's where like the problem is okay so that's why you cannot use the standard reconstruction or it's ideal kind of a reproduction of the signal for mechatronics or control kind of a domain system okay but then the question is where it is useful can you anybody knows where this standard reconstruction could be useful in some way okay this is useful for for for the cases of like you have heard about like you know you're digitally representing the sound okay so your sounds or like you know any anything sound representation in the digital way if it is done you're only here future and past samples are available right for any kind of you know the sound to be played back played back again okay so this high high fidelity sound systems they would use this kind of a you know future information about the samples to do some kind of reconstruction based on the future value the future values of the samples to get you know the quality of sound produced in the same way as it was recorded okay it's not analog recording it's like a digital recording of a signal and you want to produce really to the very close extend to the analog kind of reproduce that sound again you you you can use these kind of concepts okay so communication industry would use this in some way okay so your digital high fidelity sound representation that they are reproduction of the sound again they can use this standard reconstruction but for our control systems this is not not feasible to do okay so what we do is we hold the values in the register you remember you have this duty register in which like you know once you put the value it will it will not change by itself till the time you put other value there and you will have a chance to put other value only when you kind of like a complete once happening time instance and come back again and I can put other value there so till that time the value with the head constant okay so so the way you are like you know reconstructing the signal is basically holding this signal constant from here to the t to the 2t value okay then it is changed to this value and again that value will be head constant then it's changed to this red value and again that red value will be head constant and again then it will change to blue value it will be head constant is how like you know in some kind of a step form you you you represent that signal as a reconstructed signal okay especially for it for implementation on the on a motor or actuator so so so this is how like you might can think of Shannon sampling theorem and make use of that for for you know sampling the the signals in the in a way to make sure that the contents are preserved to work with best form it's just to think about like you know how what should be the function here which when multiplied by this f of kt and this should be function of t minus kt so that i now produce my you know the stepi function stepi form player so first the stepi function we can use the rectangle yes yes so this is what we're talking about is stepi function here okay and this is already here okay so so this is a frequency domain oh sorry don't not confuse here it is a frequency domain kind of a representation okay so maybe maybe am i am i like you know some writing here is is yes so this is called zero order word i just correct this and and it goes to slides again probably this is called zero order or you may note down like with this ideal reconstruction written here is not a correct thing okay just just delete this part ideal because this is not ideal reconstruction at all okay ideal reconstruction will be this part where you have this p and rectangular window coming out here is a ideal reconstruction this is a different part this is a this is like that rectangle function that that was talking about so instead of this this same function here will this rectangular function will be coming out here okay so this this function when like now you represented in the same form f of kt like you know this function t minus kt what it would give you actually this reconstruction which is called zero order word so the zero order word you'll find in matlab some places people have used this in the in the digital domain to a to d or t to a conversion okay so so the systems we want to transform from from another domain to digital domain like here you'll be asked okay whether they should use binary transforms or they should use zero order word kind of a form or what kind of a form that is to use that time like when you you understand that okay zero order form means like with zero order word means like i'm holding this value uh till the next time so if this is happening and under this scenario if i want to see what my system is responding then like for that that digital system conversion from another digital domain is what is based on this zero order word kind of a form okay so if i reconstruct the signal back like this okay so so we are not yet coming to the system so we are just kind of talking about only the signal how the signal is is represented and reconstructed back from the samples okay please so what we saw so far is like the signal getting uh sampled like this and once this is sampled um what is the happen with frequency contents and uh after that like you know if i want to reproduce the signal what are the different ways i can reproduce the signal and one of the ways is this channel reconstruction reproduce it back like you know completely but that is the completely ideal case we will not do that in the in the in the control system domain we'll rather do it this kind of okay so now this is the way we are kind of reconstructing uh the signal uh into into the sample so so if you see the same sensor signals also when they are sampled and and like let me go to that slide when they are sampled this is the first slide that we are talking about when they are seeing see since the signals are sampled and like you know put in the digital domain their their value is held constant till the next sample comes for the sensor the way it happens for your duty cycle the same way it will happen for the sensor value also the sensor value will be held constant till the next time sensor sample comes okay again that value will be held constant till the next time sensor sample comes all this kind of reconstruction that is happening inside the the the domain although we are kind of representing these values as a discrete time values only and persisting them for what our purpose is they are actually if you see they are held constant or over the samples okay and then that holding constant over the two samples has much more kind of a effect when when it is implemented on the actuator okay it's it doesn't matter too much when you kind of just to persist those values here but it has much more implication than it is implemented on the actuator and how that happens that we can see in a minute