 you know what happens to the system when we sample the system. So all we know from our analysis, our practical implementation that we are doing the sampling. We are like not doing these three steps, okay, reading the sensors, then computing the control and then third one is implementing to the actuator. Okay, this we are doing again and again in some kind of a sampled kind of a manner. Now, then the fundamental question comes like, you know, is what happens to the signal when I sample the signal? Okay, that is the first question. Okay, so we will now see these questions, you know, in more details. So schematically, something of this sort is happening in our system. Okay, you have a, you have a, your plant here, which is a, you know, sorry, some mechanical system, which is inertia or something, which is actuated by some actuator, some kind of a motor or something. So in your case, like, you know, your motor case, you'll have a disk as a plant, and your motor as an actuator or motor inertia plus disk inertia as a plant, and then like, you know, the magnetic is going on in the motor as actuator. Like that one can visualize in some sense. Then encoder is getting your feedback as a sensor, and then you are sampling. Now here, we don't have A2D here, we just have a encoder interface to do this, I mean, to get this reading of the encoder directly into your microcontroller. And then we don't have even the analog interface, we have this PWM interface here to actuate your actuators. So this loop is continuously getting executed. Every sampling time, you read your sensor here, then like, you process that in your control computation, and then like, you implement it on actuator. Again, you read further and like, keep on doing that in an infinite loop, so to say. That's how like, you know, your actual control will happen in any of the systems. Now the question is, because we are implementing something, so this activity happens in the digital domain. So once it is implemented at say, whatever sampling is some instant like, you know, this actuator or, you know, your PWM duty cycle has got updated. And from that update to now, all these things completion, all this other activity is happening with one sampling time completion. And again, it is updated, there is a lag of or there is a delay or there is a time lapse of one sample time. So now the way this would happen for my system is I would, let me sketch it here, I would see the system would see some sort of, let me get a new page here. So I would see some kind of a, you know, my control input is if I see just plot the control input as a part of, as a function of time. So this is my first sampling time, this is second sampling time, this is third sampling time and so on. So I have first duty cycle coming up here, up to this point, then it will get updated and it will become some something here. And now over two sampling instance is going to remain constant, that is a important thing here. So 0 to t, it has some value here. Then from t to 2t, there is other value. This is how is control going on my system. So the next question comes like, if my system is receiving these inputs in this kind of a successive steps kind of a thing. So it is receiving like, no, these kind of successive steps keep on receiving like that kind of input. How my system is going to respond to this kind of input? So that is a question that is addressed, for example, when we talk about this digitization or like digital control kind of consideration. Normally what we do is we just implement control, we develop some controller in another domain and we say, oh look, with a enough fast sampling time, I would be able to kind of implement it faithfully in a digital domain. And then our kind of like no job is finished. And we say that I have enough fast sampling so that this controller will behave as if it is continuous system. Fair enough. That is also a good argument to kind of go. Many times people use that and like, no, they don't bother about getting into digital analysis itself. But we need to be aware as a, you know, so there's we, as a mechatronics engineer, need to be aware that, okay, at some point, like, no, I may not have that flexibility of having kind of a controlled possibility. And so fast implementation possibility is not there, that as if the system will be considered continuous. Okay, in under that situation, we need this analysis of digitization. So we'll have these two parts coming up. One is like, you know, your sensor. Typically, in our case, it is anyway a digital sensor. But analog sensors will have this issue that okay, you sample this sensor signal. Okay, so sensor is read again every sampling time. Actuator is given input every sampling time. So when the sensor is read every sampling time, now I need to know that, okay, if whatever samples that I'm getting from the sensor are representative of the signal that I want. Okay, so what happens to the sensor signal when I sample it? That is another kind of a mathematical question that one can have. So one first question is, like, no, what happens to my system when the input is in, in this kind of a steppy form? And other question is, okay, what happens to my signal when I sample it? So when I see the samples of the signal, how do I see them, you know, representing my signal well or not or whatever? Okay, so there are these other kind of issues. So some practical issues are there, but some of them are related to sampling. Say, for example, if you, okay, maybe this will become more apparent when we start looking at sampling. So basic idea here is to like, you know, see as a continuous domain signal, okay, is now represented as samples in the digital domain. Okay, so you have this signal which is continuous in nature. So let's come back again to our schematics here. So now here we are considering for the sampling, we are considering a question where you have this signal, okay. So this signal, I have some signal, okay. This is say f of t, continuous domain function of time, okay, this is my time here. And I sample, I take these samples of the signal, I sample this signal at say some sampling rate, okay, so this is t2t, the samples are like, you know, coming at these different times, okay. So if I represent this signal only in terms of these discrete points, instead of like, you know, this continuous, because in computer I cannot represent continuous signal. I always will have only this discrete data points which are, you know, coming in some kind of a form of an array. So if I represent signal in this kind of a, you know, sample form, what is that I am missing and how these samples are representing my original signal, how faithfully, those are the kind of questions that come up mathematically actually. So another thing like, you know, this signal has some kind of a frequency. So we need to be familiar with something called frequency content of the signal. So you have learned Fourier transforms in mathematics, okay. So if I take a Fourier transform of some signal, okay, so the signal will have like the frequency contents up to certain frequency, say omega 1 here, okay. So now what I am having here is f of j omega, if you recall your Fourier transform, this is a magnitude of f of j omega, okay. So this will have some magnitude, like some variation up to this omega 1, okay. Now just to kind of give you some sense, if your signal is sinusoidal, oops, what happened? If your signal is sinusoidal of say frequency omega 1, then you think, okay, what will be your, you know, this f of j omega is going to look like, okay. So f of j omega for f of t, let us call this f 1, some f 1 is sin omega t, omega 0 t let us say, okay. So if you recall your Fourier transforms, you know, you will find that it will have some kind of an impulse representation here at frequency omega 0, okay. So we may need a little bit of a, you know, refreshing of your Fourier transforms to really, you know, understand it in real get great depth. Or you can just have a feel for like say, okay, look, my signal has say signal sinusoidal frequency, single frequency omega 0. In the frequency domain, I am not going to see anything other than omega 0. That is kind of a physical sense you can have. So if the signal has two frequencies omega 0 and omega 0 1, okay, then I in the thing, I will see these two peaks here, instead of just one peak omega 0, I will have another peak at omega 0 1 something like that. So like that, I can see my signal to be having this multiple kind of frequencies depending upon what is the nature of a signal, okay. So that is a little bit from the physics perspective. And then to kind of get to precise how this comes, you know, you need to kind of invoke mathematics of Fourier transform, okay. If you use a Fourier transform formula, then like, you know, you'll start like getting the similar kind of results, okay. And for a signal, there are techniques by which like, you know, you can numerically take Fourier transform, okay. It's called discrete time Fourier transform, okay. So for that numerical Fourier transform, there are this very efficient algorithm called FFT algorithm, okay. So this is algorithm called FFT, okay, fast Fourier transform, okay. So if you see in MATLAB also, you'll have this command called FFT. So you can use that command and like see how it kind of given a signal. So I give a signal like this. And I fed in this discrete points of the sample points of that signal with some, we know what is sampling frequency. And you feed them into this function in certain kind of a way. And this MATLAB can give you this, you know, the FFT plot, okay, or this frequency domain representation of the signal. So you can get actually this kind of a signal. And typically all the signals that we consider in the mechanical domain will have some kind of a limit with this omega one here, okay. So you'll have this signal which are limited in frequency. They are not like you cannot have a signal which is having infinitely like many, I mean, you know, the frequency contents, okay. Frequency contents will be limited to by certain higher frequency because mechanical elements in the system cannot move faster than certain speed, okay. So this is what we will consider mostly for signal analysis that, okay, our signal is band limited. It's called like some band limited in terms of some jargons, actually, okay. So this band limited signal by omega one frequency. And then we represent this signal in higher time domain or in the frequency domain. And we should be able to go back and forth in time and frequency domain. That's what would happen based on the Fourier transforms. We'll use make use of Fourier transform analysis to do that, okay. Now the questions are like, you know, are the samples true representation of original signal, okay. So further question will be if it is true representation, then can it be possible to completely recover the original signal from its samples, okay. What is the role that sampling time or the sampling frequency has to play in this business of, you know, getting the recovery of entire signal. Now, this is the other question that we have said, okay, PWM which is going to the motor as a sample signal. So what is the effect of, like, you know, some sampled input going to the inner stepy form, it is going to my system. What is its effect on the system dynamics, okay. So many times like you will find like, you know, the discrepancies that are coming in actual practical stuff and what you are getting in simulation would be because of this insufficient sampling or sampling frequency is not proper. So we will get to this in little more details now. So, okay, so first let's understand what is sampling, okay. So, and how the sampling can be visualized for simple kind of cases. So you all might have, I don't know, you might have observed some old movies, okay, with a horse cart kind of thing, you know, old really black and white kind of movies. They used to have this kind of a film to record the movie and then they replay the film to play the movie, okay. There is no kind of, you know, digital camera for like recording videos and things like that, okay. So this is like a film based recording of the movie. And if you observe there, like, suppose there is a, say, typically this horse cart is moving in the forward direction, but then the wheels will appear to be moving in the opposite direction, okay. And that's very funny. I mean, when I was a child, I was wondering like, okay, why such things are happening there? And then you might have seen like your fan is running, I don't know, now there are tubeless which are having flicker. There are tubeless which flicker, okay. When they're flickering, like under flicker, like the fan will appear to be moving in some different direction, okay, those kind of effects basically. So you have a stroboscope. Nowadays, like, you know, even mobiles have these apps which can give you stroboscopic kind of effect. I might have one, yeah. So, yeah, so this is like, you know, where I can set like some frequency and I can start producing this kind of a stroboscopic signal here, okay. So now I can flash the signal against some kind of object which is moving and you know, it will freeze the images at the time the light is flashed on the surface. And if the frequency of motion and frequency of the strobing matches, then even that moving or vibrating object will look like a stationary, okay. Those kind of effects are all like related to this sampling, okay. For example, if you see this card example, like I take, say this is moving in a forward direction, okay, and like look at this pointer, right now it is pointing this, now it rotates actually complete rotation and comes in the, in this position in the second part that is shown here, okay. Sorry, let me get the mouse. So here if I take second image and here I take, like, no, it's the same speed it is moving forward. And again, it completes one rotation with less, little less kind of degrees and I take third snap. And now I replay the snaps, what will appear is to kind of like this to be moving in the opposite direction, okay. We will start moving in the opposite direction. And this is called aliasing of the signal. This is like some kind of a loss that is in the signal. So I have lost a direction of motion and I have lost like the speed also here, okay. So the speed actually is so fast, but now I am getting like some signal which is now visualizing, it is very slow speed but in and also it in the opposite direction, okay. So this is called aliasing of the signal, okay. So your signal is lost here, okay. Now the question is can we quantify this effect, okay. So one can see now that if this phenomenon is happening like this is a pointer moves from here just to like up to this point, no problem. Up to this point, I mean talking up now, like only the most successive cycle. So from here it is moving here, no problem, 90 degree motion, no problem. If it like, no, again further down here, there's still there is no problem, okay. It comes here, I'll have some issues coming up. You see that this pointer going from here and like, no, I take next snap when this like, no vertically down position, then like, no, I'm on the verge of like, no, losing something, okay. If I go here, then I have already lost that, okay, because now it will appear that I'll move like, no, in this direction, okay. So you can see that there is also sense of that kind of a, you know, speed of sampling needs to be like, this is a wheel has some RPM, okay, or frequency omega for motion, omega zero, let us say. And if I sample like, no, two samples per second per, you know, cycle, okay, for this one cycle, I take two samples, then I'll have one pointer here and other pointer say, here, I'll have some kind of a lossy thing. But if I take now, so if I take more than two, okay, then I'll immediately start seeing that, okay, this comes, so what we are talking about is like, the number of frames per revolution, okay. We are not talking in terms of the time here, okay, not per second kind of a thing, okay, so you don't get confused. So with one revolution, if I have, say, if the pointer comes here, that means in one revolution, I'm taking one, two, three and four samples, okay, I begin here, one, two, three, four, four samples, I'll take if I have 90 degree motion happening here, that is the kind of a sense. So one can always transfer that in terms of the time with considering the frequency of motion to be omega zero, okay, so if my frequency of sampling is two omega zero, okay, two times, that means I'm taking two samples, okay, in one rotation, then the possibility can be only like this sample and other sample is 90 degree, then I'm in some confused state, okay, if it is like more than two, I'm on this side, then it is like, no, I'm safe, I can still determine. And if I'm on other side, then also I can say I'm confused completely, okay, this is less than two, so I'll have one sample here and next sample may be coming up here on here, so then again, I'll have a loss of data, okay, so from that perspective, one can see that the frequency of sampling, if it is more than two or less than two, or equal to two, it'll have a different kind of interpretations of the sample signal coming up. It's like a physics here, yeah. For less than two also, if it is less than one, then I think we can still get the direction right. So if it is less than one, so you have one sample here and next sample coming up here, how can we get it right? It is towards the right of the first sample. So first sample is here. Which means after one rotation, after some time, so one rotation plus some delta t, getting it again, which means there's a lot of delay. So yeah, that is correct, but so what we are talking about then, so loss of, we are talking of this loss not only of the direction. So I'm giving this example for direction loss, but in that case, you would have a speed loss. You'll have like one complete cycle is lost already. The speed has lost so much there. So this is like, that's what we call as a harmonic. So you have one complete cycle has passed and then like the next cycle may forward direction you are started measuring. Perfectly fine. You are getting the direction since right then, but still there is a loss of the, it's not like the original data. It is, I have lost so much of a, so many samples like so much of the data in the sense, I don't know the speed that is I'm getting is correct or not. I definitely do not have correct speed there. So this is just to kind of give you a feel of what is happening. So we can do like a lot of mathematics about it and that is, that follows. But if you have this understanding good here, then you can see that, okay, look, even with samples little less, little larger than two omega zero frequency, I still have a chance to kind of get my reconstruction or signal represented completely. So that will see how mathematically it can come up a little later. Okay, how are we doing time? Okay, we have said that means to go good. Okay, so now, how do we quantify some stuff? So if I give you these frequencies, you may be able to come up with this, what is the speed that I'm going to see actually by doing these such kind of analysis that we are talking right now. But are there any other kind of a formal ways of doing this or like this in terms of the signals eventually? That's what we'll see. For example, now if this is a sinusoidal signal, for that sinusoidal signal, if I am sampling at certain frequency, which is now, so this is one period here. So same thing that is happening here, I'm now representing it in terms of the period. So this is one cycle is one period. Okay, so this one cycle is corresponding to this one period here. So now I'm considering like, you know, a vibrating object, for example, so to say, if you want to connect to the physics, it's like a vibrating object. And whatever these points that are just like, like, snapshots that I'm taking, when I do this proboscopic kind of a measurement on that vibrating object, that is a kind of a sense if you want to kind of understand this in terms of some kind of a physics associated with this. But I mean, in general, this is now exactly what is precisely would be happening when we start taking a signal and we sample it. So one can see that sense in terms of physics by using a vibrating kind of object and like, you know, these are the points where you have a stroboscope applied to that. Okay, so if you see now, these are the like those equi space points, but which are beyond like, you know, this 180 degree phase. Okay, so this is like total 360 degree is 180 degree up here. And beyond that, I'm kind of like, you know, putting somewhere for sample and now equi spaced other samples. And if I start plotting them, I'll see there's some other sinusoid is emerging out of this. I'll see the speed of actually the speed of vibration was this or the speed of oscillation or frequency of the signal was this. And what I'm seeing actually the frequency of sample signal is much, much lesser there. Okay, so original sine wave is completely lost here. We are not representing original sine wave in this kind of a sample scenario. Okay. So under what conditions we can see, like, you know, our original sine wave. So if I say, okay, my first sample is here, next sample is exactly at 180 degree, then all the samples will be like, you know, straight line here. That's complete loss of like, that is also not some kind of a correct representation of the signal. But if I have some sample here, next sample is somewhere here. And then so and so forth coming other samples follow, then I apparently see the signal to be somewhat kind of like, you know, not really sinusoidal. But by using those samples, I can now generate original signal back. Okay, based on my arguments that, okay, look, from that wheel, I can see that, okay, if I'm taking this sample, which is less than 180 degree rotation for the wheel, or less than 180 degree phase for the signal, I'll be able to kind of reconstruct, I'll be able to kind of see my contents or original sense of that signal along with the direction and the frequency or speed that entirely is preserved. So how do we quantify that? So that's where like, now we start now looking at theorems for doing that. Okay, now again, here, we will not have much time or we'll not have time at all probably to get into the proofs of these theorems. Okay, we are trying to kind of understand these theorems and apply. Okay, so we are into that kind of a phase. So the proofs of this theorem will follow by two parts here, like one is like you need to have understanding about the Fourier series and other is understanding about Fourier transforms. And third thing may be about this direct delta function. Okay, so these three are like some base mathematical background requirements to get to the proofs. Okay, so the idea here is that now as we have seen say some signal f of t is there. And as we saw, all the signals mechanical domain or these mechatronic signals will have this limit of the band. Okay, so we don't know what is there in between these two points or here from zero to this omega zero, what is there? We are just kind of trying to represent it somewhat by this kind of a straight line. But this is not a thing that is the actual representation of a signal. This is just to kind of show that okay, your signal exists between like this to this frequency. Okay, so typically you give this f and like you say that okay, it is a band limited signal. And then you construct this kind of a you know, some kind of a representative of that band limited signal. Okay, so this means like no the signal is band limited by this omega zero frequency. So this is this may not be linear variation, it may have some kind of a very skewed variation in this domain, but nothing would exist beyond omega zero no content for f of g omega would exist beyond omega zero. Okay, there will be always zero. Okay, so this is how like no we considered a band limited signal. What it means is the the fastness of the signal is not more than omega zero, it can only be fast as fast as omega zero kind of a frequency, that's it. Beyond that it doesn't have anything which will kind of have the faster variation than that kind of a speed. Okay, and this is a very important concept for signal representation in in time domain to frequency domain, so that we can see the different aspect of the signal better in the in the frequency domain. Okay, say for example, this that the signal has band limit of omega zero, this aspect will not come by just seeing the signal in time domain at all. Okay, you see some variation in time domain, how do you know like okay that okay this signal has no frequency contents more than omega zero. Okay, that will not that is not very apparently coming in the time domain, so that's why we have this different mathematical representation of the signal from time domain to frequency domain and so on and so forth. Okay, so if you see the actual signal, I will show you some actual signal actually, you can see its transform we are here. See, this is the actual signal in time domain. Okay, so this is a time per second actually recorded from our own kind of a strain gauge measurement for a beam which is vibrating. Okay, so these are the strain gauges at the bottom of the beam and the beam is vibrating. So you can see that okay this has some kind of a by seeing the signal, how would you kind of know okay you say okay the somewhat some frequency base frequencies there and some additional frequencies are there but we we only can see that we don't know whether this will be having some kind of a band limit or it is having what kind of frequencies contained in the signal. Okay, for actual signal, so that's where like know this fft of the signal is is very very handy, so what it shows here is like know around 12 hertz we have one frequency coming up and then there is some other kind of a component of frequency which is coming up around 34 kind of hertz frequency. So these are actually two modes of vibration of a of a cantilever beam. Okay, the first mode is here and second mode is here. Okay, and then there are these small small noisy components out there. Okay, so these are kind of safely ignored you just need to kind of see what are the better the major peaks for the for the fft kind of a signal. Okay, so beyond this now there is no other frequency coming up as at least in in this kind of a signal which has excitation given to some extent because because of which it is having this kind of a response and in this response now this signal is band limited to say this the frequency up to say 35 for example. Okay, like that one can see the actual you know signal in the similar way as we have seen this. So you can see that the signal is no way like this triangular kind of a representation at all. Okay, and for the sake of mathematical completeness you actually define this on the other side also. Okay, so we will not get into more kind of a when you get into proofs like no you will see that okay this part is actually needed to to be considered. Okay, so so that is coming mainly from the mathematical kind of a precision of discussion. It has this part has no like no real physical kind of a significance what is a negative frequency will not have a physical significance at all. But for mathematical completeness it needs to be considered when it when you do like further analysis then you know this this will start using on the other side what is happening. Okay, so now I would leave you with this question that okay if my sample this signal okay to represent just this kind of a sample points okay what will happen to this signal in the frequency domain? That is a key question. How do we see that? Okay, how do we see the sample signal appearing in the frequency domain? So that is what we'll cut off in the frequency domain maybe at one by two. At some point it will be cut here no the the frequency so that's what like no we have to see see when these are the samples seen in the in the time domain okay what is that you will see in the frequency domain is given that when there this is a continuous signal the frequency domain signal looks like this as a as a you know frequency content of that continuous signal. Now when sampled what is going to happen is a is a is a question okay and when you so see normally we have a notion that okay oh something is sampled here it will be sampled in the in the frequency domain as we'll know that's not correct notion okay that's what we need to kind of like know wash out that kind of a notion that okay something is sampled in the time domain doesn't mean that in the frequency domain also there'll be some some samples like know that okay you'll see only this kind of a samples here no that is not true okay so what happens like no we'll with this mathematical analysis is this we'll see about is interpretation maybe in the next class but maybe I'll pose these slides you can try to kind of see up to this point maybe to guess okay what is happening here it's not trivial to kind of guess that but see if you can give some kind of a thought to that based on whatever your knowledge about Fourier transforms and things you can apply that to to such a signal which is represented as a as a as a discrete kind of a sample so see see this fs is is a mathematical representation of the samples of the signal okay they are represented as like no summation of this all these direct data functions which are coming up at at each of the sampling time okay so we need not get into all these details but we'll we certainly need to understand what happens here okay by doing this mathematical analysis what is final conclusion is what we need to be very very careful about to understand it and like know apply it to some situations okay that is what we'll we'll do from the next class okay so what does frequency even mean in a discrete sampling setting for a continuous signal I can think as summation of sign terms so they also have an omega right right so so so for a continuous signal you have like the same you can say okay if I need to represent the signal say for example by using so I would I would I would give you some kind of a sense of thinking okay if this signal is has been had been a periodic signal okay let's say this signal is a periodic signal what we would think you would think in terms of like no representation of periodic signal in terms of Fourier series okay and in the Fourier series the coefficients of Fourier series would give you like no contents of the signal at each of the Fourier components okay these are sine and cosine components there right so so they each of the frequencies how much is that signal contributing to will is what I am getting in the Fourier coefficient so this is like a Fourier coefficients that you are plotting here so you have a continuous signal here okay our periodic signal here okay but when you see the few Fourier coefficient Fourier coefficients come as a discrete here okay now when I I say in the limit that my period of the signal goes to infinity okay then it this becomes like a continuous signal okay and that time this this instead of these discrete parts I get also this kind of a continuous domain here continuous representation here okay so that is a kind of a sense one can think about okay so so this Fourier transform is nothing but like you know the Fourier series in the limit as as period of the Fourier series goes to you know the period of the signal goes to infinity this is this is now this period is infinity means this is not periodic signal okay so non periodic signal will have this infinity period okay and for that signal so that is a kind of a sense we can see for the Fourier transform that is happening now if I say in the similar kind of a way like no if I need to represent this multiple kind of a you know peaks that are like coming as as this direct data kind of a functions here how can I represent them by using a Fourier series that is a kind of a way we start thinking and we will get some kind of answers