Hello readers, Welcome to another tutorial about the signal and system. In this lecture, you are going to read details about the ramp response of a signal. In the past lectures, we have been dealing with different types of responses of LTI systems, and therefore, we know that linear invariant systems, or LTI systems, are those which follow the rules of linearity and are also time-invariant. So, at present, our focus is to examine what happens when the ramp signals are fed into the LTI system and which type of output signal we receive. Here is a glimpse at today’s topic that we will learn deeply.
What is the RAMP signal?
How can you define the ramp response?
How to use the ramp function in MATLAB to get the ramp response?
What are some important properties of the ramp function?
How is ramp response used in different fields in different ways?
We all know that a signal is a function of one or more variables that are independent and contain some information in them. When talking about ramp signals, we get the following definition:
“A ramp signal is the one that always has its initial condition at 𝑡 = 0, and with time, this signal increases exponentially. Therefore, it is linear in its behavior with time.“
So, when representing these with the help of graphs, we get a smooth result all the time instead of any abrupt change in the pictorial representation.
As with other types of signals, ramp signals can also be described in two ways:
Continuous-time signal
Discrete-time signals
When the ramp signal is in the form of continuous values, we represent them as:
r(t)= { t for t=>0 } and {0 for t<0}
Similarly, the same condition in the discrete-time format is described as
r(n)= { n for n=>0 } and {0 for n<0}
Let us clarify the meaning of the statements given above. In both cases, the value of t or n increases with time simultaneously. Therefore, we get the smooth slop in the case of continuous signals and smooth points when we are dealing with discrete ramp signals. In other words, the values on the x-axis and the y-axis for a ramp signal are always equal if we are plotting a graph for them.
As we have discussed at the beginning of this lecture, linear time-invariant systems have the linearity property, and you can use the ramp function in the time-invariant system. It has the input at one end, then the input faces some procedures according to the conditions, and from the other side of this LTI system, we get the output. So, in simple words, we define the ramp response as:
“The ramp response is one of the responses of the LTI system when the signal used as input is the ramp signal and the output of that system has the same features.”
In some places, the ramp function is defined in other ways, but the basic definition remains the same as we have provided you before. Other ways to introduce the ramp function are:
The resultant value is when the mean is calculated between the independent variable and its absolute value, which is called the ramp response.
R(x)=(x+|x|)/2
Here,
R= ramp function
x = the variable based on which R is taken.
Code:
num=[0.9 0.18 0.27];
den=[1 0.2 0.3 0.4];
n=0:0.1:7;
x=n.*(n>=0);
y=filter(num,den,x);
stem(n,y)
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('Ramp Response in CT')
Output:
We have used the filter function in the previous tutorials as well. But, for a revision, it is important to know about it again.
The filter function is used when the digital filters are to be applied to a vector in MATLAB. The information that is to be fed into this function is delayed before this function. The syntax is given as
filter(b,a,x)
Where
b=co-efficient of the numerator
a=co-efficient of the denominator,
And x is different in different conditions.
Filter returns the filtered data as a vector with the same size as x if x is a vector.
The filter operates along the first dimension of a matrix if x is one, and it returns the filtered data for each column.
If x is a multi-dimensional array, the filter operates along the first dimension of the array whose size is not 1.
In our case, num and den are the matrices. So we are using the second case.
Have you seen the code? For a super easy-to-understand, we are going to discuss every step in detail.
In the first step, we declared two arrays and stored their values in the num and den separately.
In the second step, the time is provided to MATLAB, which shows the time has an upper limit of seven and a lower limit of zero. The interval between the times is taken as 0.1.
Now, we have just used these two arrays for the multiplication and used the dot along with the multiplication sign so the compiler may understand that it has to multiply every term in the loop.
In the next step, we are going to use all the results in the filter function, and this is the step that provides us with the results in a better manner.
The results are then fed into the variable y.
In the end, to get the result graphically, we used the stem function and provided the values of n as time.
Note:
If you want to have the same graph in the continuous-time signal, you just have to:
Replace the n with t for the best representation.
Replace the stem function with the plot function.
In this way, you will get the same graph, but the slope will be smooth.
To deal with different types of cases when using ramp response, one must know the properties of ramp response in detail to avoid the long calculation all the time. So here are some of these:
The Laplace transform is used to convert the system from the time domain to the frequency domain, and when talking about the ramp function, it says that the Laplace transform of a ramp function results in a calculation that is equal to the square of the variable based on which the integration of that ramp response occurs.
Observe that this property is valid for the single-sided Laplace transform.
The Fourier transform is another way to convert the function from the time domain to the frequency domain so that it may become easy to deal with that particular function. The process of Fourier transform on the ramp function provides us with the following results:
At the start, we mentioned that the ramp function does not exist in negative values and that the values are always in positive coordinates. So, we can represent this property mathematically as
∀ x ∈ R: R(x)>=0
In this way, the definition and nature of the ramp response are now clearer in our minds. There are certain conditions when the negative values of the ramp function and in return, ramp response are obtained. In such conditions, the negative values are always ignored.
To know about this property, you must know about the Heaviside step function. It is the type of step function that always has a zero for negative values and one for positive values. It is usually denoted with a capital H. When we take the derivative of the ramp function, we get the Heaviside step function. When writing it mathematically, we get the following equation:
R’(x)= H(x) for x !=0
There are different conditions and properties of the Heaviside step function, but we are not going to explain them because it is out of the scope of this lecture. For now, you just have to remember the equation that we discussed just before this paragraph.
We know the signals are important in almost every type of field of science and therefore, we have the emphasis learning more and more about them. When the topic is ramp response, there are different ways in which ramp signals are used, and therefore, ramp response also has an application in that particular field. So let’s discuss the important fields where ramp function and, in return, ramp response are used.
We know that in the ramp function, the values on the x-axis are equal to the y-axis and these are always positive values. Therefore, we can guess the results before the time. This property is easily used in different systems for testing different conditions or when starting a new system, it is used to check particular features.
In different engineering fields, signals are used in different ways, as we are learning in one such subject, “Signal and System”. Electrical, computer, civil, and other engineering disciplines involve the use of ramp signals and ramp responses.
Those who belong to the field of finance know that the payoff of the call option is in the form of a ramp function, and therefore, ramp response has major usage in this field. The put option is set by flipping the ramp horizontally, and the short option is obtained when the ramp is flipped vertically. The graph formed in this way is called the "hockey stick" because of its shape.
It becomes easy to deal with the results, and we get accuracy.
When we use the ramp function, we face different conditions while studying statistics. Some cases are
Multivariate Adaptive Regression Splines or MARS
Hinge Function
To deal with such complex calculations, it becomes easy to use the ramp properties so that unnecessary work may be ignored. For example, the non-negative property of the ramp function provides us the facility to ignore the negative values and focus on the calculations of positive values.
It may look unusual, but the real-time application of the ramp function is in the traffic signals. A bottleneck is a situation when on the highway several vehicles are entered in an unmarred way and it results in the blockage of traffic. A ramp signal is used to break up this blockage, which is a cost-effective way to deal with this situation. The work is done. When the ramp signal is applied to the traffic lights effectively, this is one of the easiest ways to deal with this situation.
Today, we learned a lot about the ramp response, ramp function, and unit ramp signal. We saw the introduction of all of these and the interesting thing about the ramp response was the code of the ramp response in MATLAB because it was so clean and easy to understand. In addition to this, we have learned about some properties of the ramp function that helped us to clear the concepts and to know how we can skip long calculations all the time if we know the properties of the ramp function. In the end, we had a glance at the application of the ramp function in different fields of science, such as statistics, engineering, and finance. We hope it was an informative lecture for you. Stay with us for more interesting lectures about signals and systems.
Hey readers, welcome to another interesting lecture of this series in which we are studying signals and systems. In the present lectures, we are learning the details about the responses of LTI systems, and today, you are going to learn the step response. We also talked about the impulse response and frequency response, and therefore, this lecture will be easy for you to understand because it is, somehow, related to the impulse response. If you are new to this concept, do not worry because there will be a revision of important points side by side. Have a look at the list of today’s concepts:
What is an LTI system?
How do you define the step response of an LTI system?
What is the code to run the step response of signal in MATLAB using different functions?
How can you find the detail of the graph of the step response?
What is the difference between step response and impulse response?
We are going to learn each of them in detail so that if you know any of these already, you may have a revision about the topic.
We all understand that a system is something that receives input at one end and produces output at the other end after performing specific operations on the input. We define the LTI system as follows when discussing it:
The term "linear time-invariant system," or "LTI system," refers to a system that simultaneously possesses both linearity and the time-invariant property.
So, keeping this in mind, we are going to discuss the whole concept of a step response in the LTI system. Refresh the definition of convolution in your mind so that it says convolution is the process in which two signals are overlapped in such a way that they form a third signal. So, keeping in mind the above image, we can use this concept to define the step response of the LTI system.
First of all, let us clear that step signals are the one whose values always lies in just positive time and for the negative time, these signals does not have any value. The unit step signals are usually denoted as u(t). So, mathematically, we can say the step step signals are formed with the value only when t> = 0, and for t<0, signals do not exist. In this way, we get the signal at the right area of the graph, that is, the positive side values of the time. By the same token, the step response is the behavior of the LTI system when the input is provided in the form of a step signal and the output then depends upon the integral of the impulse response of that LTI system. We’ll see the proof of this statement in just a bit, but prior to that, have a look at the definition of step response:
“The step response of an LTI system is obtained when the input provided to the system is unit step and, therefore, the output also has similar characteristics.”
Using all this information, we can derive the formula for step response:
s(t)=h(t)∗u(t)
Where:
s(t)= step response
h(t) = impulse response
u(t)=unti step response
Then,
S(t) = H(t). U(t)
S(t)=(1/t).U(t)
Now, applying the inverse Laplace transform to the equation given above, we get:
s(t)=∫h(t).d(t)
So this is the final formula that is used to calculate the value of the unit step function in an LTI system. You must know that here h(t) is the impulse response of the system that we also have read in detail in the previous session. You can have stronger concepts if you examine the example that we are going to discuss in the next section.
Code
num=[9];
den=[6 1 8 7];
a=tf(num,den);
step(a,0:0.1:8)
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('Step Response of LTI System')
Output:
There are some functions that are used here but are new to you. So, have a look at the details of each of them and then try to understand the code.
It is an important function in MATLAB that gives us the facility to have the same results by using this function instead of using many lines of code. Using this function, we can represent the numerator and denominator in polynomial form. The syntax of this function is
y=tf(num, den)
where num and den are specified before using this function. These are the numerator and denominator in descending power of s and are in the form of a polynomial. For example, in the code given above, the equation we used is
9/6(s)^3+1(s)^2+8s+7
Before the introduction of this function in this series, we used different and relatively complex calculations in the code to achieve the same results. In short, this function has made our work simpler.
MATLAB has a built-in function step that is used to get the step response of an LTI system. The syntax of the step function is given as:
step(x,y)
Where
x = the equation whose step function is required.
y = the time interval of the step function.
Usually, the equation is in the form of a polynomial and it is pre-defined when this function is called. You can also use the variable in which the time interval is stored before using it. Yet, we have used the exact time interval so that you may have the concept of doing so.
First of all, we have declared the values of the polynomials of the numerator and denominator and stored them in the variables num and den, respectively.
We have used the transfer function to convert these values into a polynomial equation and then saved the result into the variable a to use later.
Next, we used the step function and put all the required values in it.
Notice that we have not used the stem or plot function to represent the results in the graphical format. We have just used the labels on the graph. It means the step function itself provides you with the information in a graphical format.
Another thing to notice is the visibility of the text “Second” on the time axis of the graph. We have not used it in the x-label but it is automatically defined in the step function.
Here is an interesting thing about the step response. You can directly examine the graph by following some simple steps.
Write the code in the editor window.
Run the code
Provide the path and save the program.
A graph will appear as shown in the code given above.
To examine it clearly, left click on the graph.
Different options will appear on the screen. Hover the mouse over the characteristics.
You can tick the feature on the graph you want and can choose more than one at a time.
Once you follow the step given above, you will get the details according to the graph. A great overview of the graph is given in the image given below:
Let’s understand what is going on the each step and why these terms are labeled so.
In the graph of step response, overshoot is the area that shows the highest bump in the graph. Basically, it shows that values that are shot over the targeted values, which is why it is named so. At its start, the values indicate the values are exceeded to their steady state and at their end, the values indicate the transition from different values.
The rise time in the graph of the step response is the area that indicates the time required by the step response to reach 10%-90% of the final value to bring the system to a condition called overdamped. It also indicates the time limit when the system takes the time to reach 0%-100% to meet the underdamped condition.
The peak time of the step response is the specific value of time in the graph of step response when the overall response of the system reaches its maximum position. Usually, you can see that it is the peak value of the graph.
The response's settling time is the amount of time needed to calm oscillations and maintain a 2% to 5% error (or tolerance) band from its final value.
So, in this way, you can understand what is going on in the step response. It is a common question how the step response is different from the impulse response because the basics of both of them are similar and why do we find both of them in the signal?
Many times, when dealing with the signal, people are confused between these two because of the similarity in the system and some other resembling features. Therefore, we have made a comparison between these two, and here are some important points about them.
Impulse Response |
Step Response |
It is the derivative of the step response with respect to time. |
It is integral to the system with respect to the time of impulse response. |
The impulse response shows the behavior of the system when it gets a sudden start and it also provides information about the time at which this behavior will be experienced. |
It provides information about the system when a person wants to know the behavior of the system or if the signal lasts for a long time in it. |
The impulse response shows the values that are at a higher level at the start, but with the passage of time, it shows the smooth path that lasts for a long time, and we get a smooth result. |
It is the sudden change in the values of the system. It is the straight-up change in the values of signals, and if we plot the values of step response, we get a stair-like structure. |
There are several cases where it is more useful to have the step response over the other types of response. Some of the major reasons are listed below:
The step response is used because it does not require information about the dynamics of the system; hence, it can be run with the help of less information.
If we have the values of the step response, we can find the impulse response by simply differentiating the step response. In this way, we can solve the system even if we do not know the initial condition.
It is important to notice that integration has noise rejection characteristics, and we have discussed before that step response is the inherited integral of the impulse response.
In this lecture today, we have read a large piece of information about the step response. To have a solid foundation for the topic, we have to refresh the concept of the linear time-invariant system and the step signal in our minds. Moreover, we have also seen the example of step response in MATLAB. For a clear idea, we also read a detailed description of each function used in the code, and then we read about the flow of the program in MATLAB. In the end, we read the details of different terms used during the examination of step response and also differentiate between step response and impulse response. In the next lecture, we will learn more about MATLAB and signals. To learn more, be with us. Till then, have a nice day.
Hello learners, Welcome to another tutorial on signals and systems. We are learning about the responses of the signals. We all have experience in situations where the change in the frequency of a system, such as radios or control systems, results in a change in the working or result of that system. So we have the idea that frequencies play an important role in different types of systems. In the previous lecture, we saw the impulse response of the system. Our mission today is to learn about the frequency response of the LTI system. We will learn all the basic information about the topic and will revise some important points as well. To do this, have a look at today’s concepts:
What is the LTI system?
What is frequency response?
How is frequency response performed without the function in MATLAB?
How is frequency response performed in MATLAB by using the function?
What are the applications of frequency response in other fields?
We all know that a system is something that has input at one end and, after certain procedures on the input, the output is obtained from the other end. When talking about the LTI system, we define it as:
“The linear time-invariant system, also known as an LTI system, is one that possesses both linearity and the time-invariant property simultaneously."
Now, to make a solid foundation, let's recall that a signal is represented in the form of a wave, and all the waves are made of three basic quantities:
Magnitude
Phase
Frequency
The time period of the wave is the inverse of frequency, and in this way, if we know the magnitude (amplitude is used interchangeably), frequency, and phases, we can form a wave or signal.
We are using discrete-time signals to learn the frequency response of the LTI system. The frequency response is the steady output of the system when the input is in the form of a sinusoidal signal. Before going into the proper definition of frequency response, you must know about the types of responses in the system.
Responses are the types of behavior or results that a system represents. There are two types of responses in the LTI systems:
Transient response
Steady-state response
The details of both of these are not necessary here. To make it simple, we are not discussing the transient response here.
As we have read a little bit about this function, we know the type of response we are discussing. You must know that frequency is the steady-state response of the system, which means the frequency repose tells us how the system will work in the steady state.
The frequency response of the LTI system is a type of steady response, and both input and output are in the form of sinusoidal waves with the same frequency but with different values of amplitude and phase angle.
r(t)=Asin(ω0) (eq. 1)
Similarly,
G(s)=G(jω) (eq. 2)
If we represent the equation 2 in the form of phase and amplitude. then,
G(jω)=|G(jω)|∠G(jω)
Replacing ω with ω0 we get,
c(t)=A|G(jω0)|sin(ω0t+∠G(jω0))
So, by using these equations, one can calculate the magnitude and phase of the wave through frequency response.
If you have the idea of impulse response that we have discussed in the previous lecture, then you must have an idea of how the LTI systems work. Yet, in the case of frequency response, we are going to study it in another way. It is now time to discuss some examples in which we will get the different procedures to perform the frequency response efficiently in MATLAB.
Code:
w=(0:10:600)*pi/300;
z=exp(-1i*w);
x=3*(1-0.9*z).^(-1);
a=abs(x);
subplot(2,1,1);
stem(w/pi,a)
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
title('Magnitude')
grid on
b=angle(x)*180/pi;
subplot(2,1,2);
stem(w/pi,b)
xlabel('Angle /The Engineering Projects.com')
ylabel('amplitude')
title('Angle')
grid on
Output:
We have used a new function here, and we want to discuss it before elaborating on the program given above.
To find the angle at which the wave or, in return, a signal is working, we use the following function:
angle(x)
This function calculates the angle of the wave whose value is stored in x and, after that, using the stem function of results, provides us with the resultant wave. Now let’s move toward the code and match the statements given next with the code.
It is a simple program that uses some basic operations. We are using these operations in a different way to get the output of the frequency response. Let’s discuss what happened in this code.
First of all, we have provided the value of omega. Here, time is represented in a simple way, as we have been doing it from the beginning so far in this series. Yet, multiplying the whole time period t with pi provides us with the value of omega.
This value is used in the exponential form while it is being multiplied with the imaginary number. So, we are providing a variable z in which the whole value of the is saved.
This is used to provide the equation that we want to work with.
Once we get the equation, we are then using the absolute value of this signal and plotting it on the y-axis where the time period is on the x-axis as always.
To get the angle of the wave, we are multiplying the angle results by 180 degrees and simply representing the data in the form of a discrete value graph.
Code:
a=-4*pi:0.4:pi;
num=[7 1] ;
den=[1 -0.32] ;
h=freqz(num,den,a);
subplot(2,2,1);
stem(a/pi,real(h))
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('Real Part')
subplot(2,2,2);
stem(a/pi,imag(h))
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('Imaginary Part')
subplot(2,2,3);
stem(a/pi,abs(h))
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('Magnitude')
subplot(2,2,4);
stem(a/pi,angle(h))
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('Angle')
Output:
We have used some built-in functions of MATLAB here, and the description of all of them is here:
This is an interesting function that takes a signal or wave and provides us with the value of the real part of the wave by ignoring the imaginary part containing values of iota and other imaginary numbers. You just have to feed the value of a signal into it. The syntax of this function is
real(x)
where x is any signal.
Yes, you are guessing right. This is the function used to get only the imaginary part of the wave, and the real-time values are ignored with this function.
imag(x)
Here, x is the number/signal, and you just have to put the results into this function.
Let’s understand the code now.
At the beginning of this code, we provided the time period and stored it in the variable a. We used the variable t for this purpose, but I just want to show that it's just a variable and you can name it anything.
After that, we provided the information for our equation and then fed it into the built-in function of frequency response to get the results.
In the end, the results are shown with the help of a graph for better representation.
The equation provided by us had different parts, and for the best understanding of the concepts, we used each part of the signal and shown it in the form of a separate signal.
In the second part of the code, we are using the stem operation, in which we use the time period on the x-axis and the imaginary part of the resultant signal on the y-axis.
We all know that magnitude is the absolute value of some wave, and here, we are using the absolute function to represent the magnitude. We have also used this function in the other codes in this series.
The last part contains the angle of this wave, and we have used the angle function here. In this way, the changing angles of the wave throughout this procedure are shown on the graph with the help of stem operation.
Let’s try to use some of the concepts of the signal and system that we have learned till now to calculate the frequency response in another way.
In the previous lectures, we have said that the transforms are used to convert the signal from the time domain into the frequency domain. We are using this concept and converting the frequency domain, and in return, we are simply presenting the signal in graphical form. For this, let’s try the shortest method, which is the Fast Fourier transform, and to make it simpler, we will use the built-in function in the code. All these concepts are used in the code given below, so have a look at them.
Code:
signal=[11 44 12 27 53 19 34 ];
a=fft(signal);
subplot(2,1,1);
stem(signal,a)
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('(n,fft(n))')
subplot(2,1,2);
stem(a);
xlabel('n /The Engineering Projects.com')
ylabel('amplitude')
grid on
title('(fft(n))')
Output:
Here you can clearly see that we have provided you with the two types of signals. One has the time on the x-axis and the frequency part on the y-axis. On the other hand, the second wave represents the frequency part of the wave only.
As you can see in the information given above, frequency response is the measure of the magnitude and phase of the signals in the LTI system. There are several applications of frequency response, and some of them with their details are given below:
We all have experienced the role of frequency in sound devices, especially in the music system, where changing the frequency of the sound system results in a change in the quality of voice and some other features. Frequency response evaluates whether and how well an audio component reproduces each of these audible frequencies, as well as whether it modifies the signal along the way.
There are certain frequencies that come in different regions and using these regions results in interesting applications. Changing in the frequency spectrum results in the usage of frequency response in the field of different cables, such as
Video switching
Twister pair cable
Coaxial cables,
and some other types as well.
When changing the radio spectrum of the cables results in a change in the behavior of the cables in working condition and the data rate and other features.
Frequencies are used in different ways to measure the infrasonic frequency response. We have seen that the prediction of earthquakes in the past was done with the help of the change in frequencies of waves. Moreover, some specific types of waves are used in the diagnostic and working of brain waves. In this way, frequencies are used in the medical field as well.
Today we read about the frequency response and worked in MATLAB to get the concept through the practical implementation of the signals. In digital systems, frequency response is an important concept, and we have seen its multiple applications in different fields. These are just the introduction and when studied deeply, they can be used in complex systems efficiently. Get ready for other topics related to signals and systems that we are going to discuss with you soon. As for homework, you must practice more and more on these topics and try to solve the problems. Examples are given in MATLAB theoretically by your own research and match the result to whether you get the same results when trying the theoretical procedures.
Hello learners, welcome to another topic of signals and systems. We hope you are having a reproductive day and to add more information in the simplest way to your day, we are discussing the responses in discrete-time signals. If you do not get the idea of the topic at the moment, do not worry because we are going to learn it in detail and you are going to enjoy it because we are making interesting patterns in MATLAB as the practical implementation of the topics. Have a look at the points that we are making clear today.
What is the LTI system?
What is impulse response?
How can we get the impulse response in MATLAB?
How can we have the output signal using codes and impulse response in MATLAB?
As we have learned so far in this series, there are two types of signals based on the shape of the signal we obtain, and these are
Discrete-time signals
Continuous-time signals
The focus of our topic is discrete-time signals in which the points of the signals are not connected with each other, but we get a line for each point in the graph, and in this way, we get a non-continuous wave. There are different types of operations that can be performed on discrete-time signals to get useful results from them. The types of operations that we are going to discuss on discrete-time signals are
Impulse Response
Frequency Response
Both of them are simple yet different from each other, and we are going to discuss all the necessary details about the impulse response in the next section. But to make a solid foundation, let us first define the LTI system.
We have read about the types of systems at the beginning of this course, and we know that:
“The LTI system, or the linear time-invariant system, is those which have both characteristics at the same time, that is linearity and the time-invariant property."
We are now moving towards the introduction of the impulse response.
Recalls that a system is something in which we provide the input at one end of the system, the operations in the system take place on the input, and from the other end of the system, we get the output.
Now coming towards the impulse response, it is the procedure or the operation that is implemented on the discrete time signal and after the application of this signal, we get the required output. To clarify this statement, have a look at the image given below:
The impulse response here is the procedure that converts the input into the required output. When calculating the result theoretically, we use the mathematical form of this image.
x[t]=h[t] * y[t]
Considering the equation given above, we see that it is in the form of a time domain, and if we want to change it into a frequency domain, then we are using the Laplace transform (if you don't know it, recollect from the previous lectures).
L(x[t])=(h[t] * y[t])
Y(s) =X(s). H(s)
And in this way, we can also change the form of the equation to get the required quantity.
Y(s) =X(s). H(s)
Or
H(s)=Y(s)/X(s)
So, in this way, we can calculate the impulse response of the discrete-time signals. The H(s) here is called the transfer function, and these are used interchangeably. When we use the function in the time domain, we call it an impulse response, and in the case of the s-domain, we call it the ratio of input and output transfer function. Both of these are used for the LTI system.
While performing the transform, the signal from the time domain to the frequency domain, you can also use the other forms of transforms as well, if you do not want to use the Laplace transform. The other two types of transform that we already know are
Z transform
Fourier transform
Once you know the basic definition of the impulse response, you might be interested in the example. We are describing the two methods to perform the impulse response and instead of making two different programs, we are merging them into one. Suppose we want to perform the impulse response operation with the equation given below:
½(y[n]-⅓[y-1]+2/7[y-2]+1/7[y-3]=(x[t]+x[x-1]+x[x-2])/6
Have a look at the program and if it confusing for you at the moment, do not worry, we are going to discuss it in just a bit.
Code:
fs=25;
t=0:1/fs:1;
c=(t==0)
num=1/3*ones(1,3)
den=[1/2 -1/3 2/7 1/7]
y1=filter(num,den,c)
subplot(211)
stem(t,y1)
xlabel('Using filter method /The Engineering Projects.com')
ylabel('Amplitude')
grid on
y2=impz(num,den,length(t),fs)
subplot(212)
stem(t,y2)
xlabel('Using impulse Function /The Engineering Projects.com')
ylabel('Amplitude')
grid on
Output:
The function of a filter is used to apply the digital filters to the equation with the values that are stored in the num and den. We all know that when dealing with the equations representing a signal, the ideal format is the one in which the values of the variable y are on one side of the equation and the values of the x variable are on the other side of the equation. So keep this point in mind and look at the representation of the signal. The syntax of this function is given next:
d= filter(b, a,x)
Where:
d= variable in which the result is stored
a = values with the x
b = values with the y
c = time
There is a built-in function in MATLAB to perform the impulse function, and you do not have to do much work to perform it. It will be clear with the help of the following syntax:
impx(b,a, l, f)
Where:
b=values with y
a = values with x
l= length of the time duration
f=frequency of the signal
We have to declare the variables first and then just use them in the formula. We have used this formula in the code, and you will get the concept of working when you will learn the flow of this code. So let’s try to understand the whole code.
In the first part, we are providing the frequency with which we want to produce the output.
The time here is from 0 to 1, and the interval is the inverse of the frequency that we specify. We all know that frequency is the inverse of time.
The equation is presented as a numerator and a denominator.
In the first part, we are using the method of filtering.
In the second part of the code, the built-in impulse function is used and here we have to specify the length of the x that depends upon the time period of the signal that is specified by us in the code.
After applying the values in the function, just use the stem function and the results are here in front of you.
You can compare the results in the code. Both methods produce the same output, and it is now totally up to you which type of method you prefer to solve your impulse response problems. Your homework is to look at the numerical values that are present in the command window and the workspace area to get the concept of the graph represented.
Now moving towards an interesting concept. Keeping this in mind, we can reverse the whole procedure easy to get the output of the system. At the start of this lecture, we said that by the convolution of impulse response and the input, we get the output. Let's look at this statement in action with the help of this code.
Code:
fs=100;
f=5;
t=0:1/fs:1;
x=cos(2*pi*f*t)
n=-0.9+(0.1+0.3)*rand(1,length(x));
nx=n+x;
num=1/3*ones(1,3)
den=[1/2 -1/3 2/7 1/7]
imp=impz(num,den)
subplot(211)
stem(t,nx)
xlabel('Input /The Engineering Projects.com')
ylabel('Amplitude')
grid on
y=conv(nx,imp,'same')
subplot(212)
stem(t,y)
xlabel('Output /The Engineering Projects.com')
ylabel('Amplitude')
grid on
Output:
Isn’t it interesting? We have used the same equation and we can get the required results by using some different functions of MATLAB. We are going to introduce some functions used in this code one after the other, and after that, we’ll discuss the code.
As the name of the function suggests, the results themselves. You can see it is used to choose any random number between the two that will be specified by us. The syntax of this function is:
rand(x,y)
Where:
x= starting limit
y = ending limit
So, you just have to provide two numbers and this random function will choose any number between those limits and provide you with the random number. Keep in mind, that these are not the chosen numbers by the compiler but the limit of the quantity of the random numbers. It helps a lot in many systems and calculations where we want different results every time we run the code.
This is a different kind of work that we have done in this code, and it will be new to you because we have not used it before in this series. While performing the operation of convolution, we require an equal length of both of the signals. If we do not do so, we’ll get an error because we know that convolution is the procedure in which two signals are overlapped with each other in such a way that we get the third signal. So, we just used the word “same” in the formula of convolution to get the same length of these signals.
First of all, we are going to provide two types of frequencies. One is for the time period and the other is used to provide the equation of input in which we are using the cosine function.
We want to add noise to the signal. So here, we have specified a signal that is represented by the variable n. This has an upper limit of 0.1 and a lower limit of -0.1 (the difference between both of these is the plus sign). So in this equation, we are specifying two things:
The limits of the number from which the values of noise signals will be picked and the number of digits that will be picked by the compiler as the length of the noise signal.
Do not be confused between these two types of limits. By using these kinds of conditions, we will always have a different type of signal with different lengths all the time when we run the code.
Once the noise signal is generated, we’ll have the input signal containing both parts, the noise signal, and the cosine function.
We have used the same equation that we used in the impulse function, so the impulse is the same as in the previous code.
The input signal is shown with the help of a subplot and stem to represent the input signal.
In the second half of this code, we are convoluting the noise and the input signal by using the same length of both these signals.
The result is then stored in the variable y, which is represented in discrete values by using the stem function.
So, it was an interesting lecture in which we learned the impulse response in detail, and with the help of codes in MATLAB, we studied the input, output, and impulse generation in an easy way.
Hey, pupils welcome to the next session about the Fourier transform. Till now, we have learned about the basics of Fourier transform. It is always better to understand all the properties of a mathematical tool to understand its workings and characteristics. You will observe that most of its properties are similar to the topics that we have discussed before, and the reason is, that all of them are transforms, and the core objective of these transforms is the same. We have learned about the simple and easy discussion of the Fourier Transform, but when dealing with complex problems, it involves the usage of different properties so that we do not have to repeat the calculations all the time to get the required results. Have a look at what you are going to learn today:
What are the basic properties of the Fourier transform?
How can you ding the inverse Fourier Transform?
How to implement inverse Fourier transform in MATLAB?
What are some applications of the Fourier transform?
So let’s start with the properties of this transform.
First of all, the Fourier transform is linear. It means if we have two expressions of the Fourier transform that are denoted by G(t) and H(t) then combining them with the help of mathematical operations such as multiplication or addition results in an expression that is also linear.
It is an attractive property of the Fourier transform that says when a discrete-time signal is transformed into the frequency domain, then it can be regenerated into its time domain form by multiplying it with a negative factor, but in this way, we will get the reverse of the original signal.
The modulation of the Fourier transform occurs only when both the signals, that are to be modulated are in the form of functions of time.
This property of Fourier transform says that if we are applying it on a function g(t-a) then it has the same proportional effect as g(t) if a is the real number. If you have a clear idea of the procedure of time scaling, it will be easy for you to understand the situation here.
This theorem is related especially to the Fourier transform. It says that the sum of the squares of a function x(t) is equal to the Fourier transform of the function x(t).
It is an important theorem because once we have this clear theorem, we do not have to calculate the square of the whole series of Fourier transforms. So, it becomes easy to deal with these quantities with the help of this theorem.
Scaling of the signal is the process in which there is a change in the independent variable or the data features in the form of a range of the signal. This property says that if the values of the signals on the x-axis in the time domain are inversely proportional to the values on the x-axis when we convert them into the frequency domain. In other words, the more stretched a signal is in the time domain means less stretched and a taller signal in the frequency domain and vice versa.
If
f(t) = F(w)
Then,
f(at) = (1/|a|)F(w/a)
Convolution is the process in which two signals are overlapped on each other in such a way that we obtain a third signal that is different from the first two. When we talk about the convolution of the two signals, we get results that are equal to the convolution of the same function in the Fourier transform.
Mathematically,
If
f(t) = F(w) and g(t) = G(w)
Then,
f(t)*g(t) = F(w)*G(w)
In this way, it becomes easy to predict the result if we know the value of one function and are interested in knowing the other.
We all know the procedure of differentiation, and when we are differentiating the Fourier transform, we may get confused about following the rules of both these procedures. So, with the help of using this property, you can easily guess the results. This property says that:
If
f(t) = F(w)
Then,
f'(t) = jwF(w)
Where j is the variable and w is the function based on which the differentiation is occurring.
So far, we have learned how DFT is used to obtain the signal in the frequency domain. But what if we want the inverse results? What if we want our original signal back? Well, it is the requirement of a large number of applications, and then the inverse Discrete Fourier Transform is used. It is not a new concept to use the inverse methods, as we have also read it when we were discussing the previous transforms.
To perform the inverse method, we just have to simply follow the formula given below:
All the other variables are the same. We just have to remember the formula and we are good to go.
Code:
clc;
x=input('Enter the Input')
N=length(x);
m=zeros(1,N)
for n=0:N-1
for k=0:N-1
m(n+1) = m (n+1)+((1/N)*(x(k+1)*exp(((i)*2*pi*k*n)/N)));
end
end
disp('m=')
disp(m)
Output:
Let’s understand this code. There are a few things that we have used for the very first time in this series, and therefore, I want to describe them all.
It is a very common and useful command that you will often see in the first place of almost every MATLAB code. The purpose of using this line is to clear all the data that you are looking at on the screen of your display window.
There is a window just below the working area of MATLAB called the “command window." main reason why we are discussing this line here is that we have not used the input function till now in this series, and therefore, I do not feel any need for this clear screen command here. This will be more clear when you learn about input functions.
In MATLAB, when we want to input the values of a particular quantity on our own, we use the following function:
input(x)
Where x is the quantity that we want to have the input of. Moreover, you can also use it to provide the statement on your own (as we have done in our program), but the statement should be enclosed in inverted commas if you want to print the statement as it is.
This is another function that we have used for the first time in this series. Well, this is the display function, and it is used to display the result or quantity that we want. Here in this code, for instance, we wanted to show the value of the result that we have stored in “m”. Therefore, we first displayed the m in inverted commas so that it was printed as it was, and after that, when we used the same function without the inverted commas, we got the value of the m that was stored before.
Loops are used in many programming languages, and if you have the basic concepts of programming languages, then you must know that “for loops” in MATLAB are used when we want that compiler to stay at a particular line and repeat the same line until a particular condition is fulfilled.
In our case, we started the first loop when m=0 and it stayed at that particular line till the value was one less than N. The same case was with the second loop. Once the condition was met, the compiler moved toward the next line.
The syntax of the for loop in MATLAB is:
for x:y
Statement
end
Where x is the starting point of the for loop and y is the ending point of the for loop, both of these are specified by the programmer, and a statement is a calculation that we want to perform again and again.
Clc clears the screen of the command prompt in case you are using the code for the second or more time.
The input function displays a message to the user that input is required from him/her.
The input by the user is stored in the variable x.
Now, we are introducing another variable, m, that stores the result calculated by the length function. It is the total number of values provided by the user.
Here, we are calculating the number of zeros between the number 1 and the length of the input by the user that was stored in N.
The interesting part starts here. We are using two for loops, which means we are nesting the loops. The condition of both of them has been discussed before. The formula that we have hardcoded inside these loops is used till the conditions provided by us are met. To perform the functions on the series of signals, loops are used in this way so that we do not have to write the same lines again and again.
In the end, when we have the results stored in the variable m, we just display it with the label m, and our program is completed.
As we have mentioned that Fourier transform has great importance in many fields of education and science and therefore, great work has been done by using this technique. Some important fields and applications of the Fourier transform are discussed in this section.
In medical engineering, where we get complex and hard results. The Fourier transform is an old technique and therefore, it is used in the field of medical engineering for a long time. The impulse response and delicate results in the form of the signal are fed into the compilers where these signals are tested and examined deeply in a better way.
Here is an interesting application of the Fourier transform. We all know that cell phones work with the help of signals and therefore, there is a lot of work that can be done by using the Fourier transform. If you are wondering how the Fourier transform is performed in the cell phone then you are at the right point. Actually, while making, testing, and designing cell phones and other such products, the rules and calculations of Fourier transform are used widely because of its precise result and research.
As we discussed from the beginning, the Fourier transform works great with the signals. The optic is the field that works in the waves and delicate signals and therefore, the Fourier transform is used to sum all the results in a great way and to find the results according to the need. Most of the process occurs in the optics when the light or other rays are merged into one point, and with the collaboration of other techniques, the Fourier transform works great to make all the procedures easy and accurate. Moreover, the Fourier transform is also useful for the smoothness of the signals and filtering of the results as well.
So, today we learned interesting information about the Fourier transform, and now we can say that we have all the basic information about the Fourier transform. We have seen the properties of the Fourier transform and also learned about the inverse Fourier transform, along with the MATLAB code for a perfect concept. The concept of the for loop, clc, and input method was new to us. In the next session, we are going to talk about the comparison of all these transformations. So be with us.
Hey fellows, Welcome to another lecture in the signal and systems series in which we are moving towards another transform. Till now, we have studied the Laplace and z transform and we, therefore, know the basic purpose of transforms, that is, to convert the signal from one domain to another. In today's lecture, we will be discussing the Fourier Transform, and you will enjoy its information because now we have a clearer idea of what we are doing and what the purpose of this transformation of a signal is. Here are the key points that we are going to consider:
What is the Fourier transform?
What is the journey Fourier transforms from start to end?
How do you define the types of Fourier transform?
Why is the Discrete Fourier transform important?
Why is the fast Fourier transforms named so?
How can you implement a fast Fourier transform in MATLAB?
Just like the Laplace transform, the Fourier transform is also named so because of the name of its inventor. It is a 200 years old transform that is still in use in mathematical subjects in which there are minute calculations and the user wants to have accurate results in a simple way. The name of this transformation is taken from the French mathematician Jean-Baptiste Joseph Fourier. From 1807 to the current age, people found this transform useful, and when we talk about subjects like signals and systems, it becomes necessary to learn this because it is majorly used in the field of practical work. We define the Fourier transform as:
“The Fourier transform is a mathematical tool or model that is used to generalize the Fourier series in a simple way and is used to represent the calculator in the frequency domain.”
The definition must be clear in your mind because we have read about the transform before, but for a clear discussion, let me say that this transform is used to convert complex calculations into a simpler way by changing the domain of the values so that we may get the best results accurately in less time.
The complex Fourier series is converted into the one with the limit from minus infinity to plus infinity. The mathematical formula for this transform is given below:
At first, this formula may be confusing for you. But do not worry, when we discuss the details, you will get a clear idea. For now, keep in mind. This is also called the forward Fourier transform. We will also learn about the inverse FFT in the coming session.
You can see that we have taken the name of the Fourier series in the introduction given above. If you are new to this, let us recall.
“A Fourier series is the one in which the decomposition of periodic functions occurs and we get the sinusoidal components that have an infinite sum of sinusoidal functions.”
It is important to introduce the Fourier series when solving the Fourier transform. Whereas a periodic function is the one that follows the formula given below:
f(t+T) = f(t)
It means that a periodic function has the same value before and after a certain period, and no change occurs after that period.
The story of Fourier's transform starts in 1807 when Jean-Baptiste Joseph Fourier found that he could represent the summation of sinusoidal functions that are sine and cosine. He worked hard on the same topic, and his work was published under the title "Analytic Theory of Heat" because he used his work to find the calculations of heat. Moreover, after this publication, scientists found that this theory can also work in other ways. It is possible to use the Fourier series of the amplitude of a sinusoidal function when the integer is used in this work. Hence, other studies were also used with the Fourier series and, as a result, many useful invasions and calculations occurred.
In computer-based applications, you will hear a lot about two types of Fourier Transforms:
Discrete Fourier Transform or DFT
Fast Fourier Transform or FFT
We will discuss both of them in detail.
We all know that discrete quantities are those with a non-continuous sequence. These are different ways to deal with signals, but when we talk about DFT, one must know that it is one of the most accurate and powerful tools to find the spectrum when dealing with finite duration signals.
For instance, take the case in your mind, when we get the output of the LC oscillator, we get a sinusoidal wave, and we want to know the amount of noise in the output to find an accurate result, then we use the Discrete Fourier Transform. Just like digital filters, DFT is also a powerful tool to analyze the signals in the best way.
Mathematically,
To make a clear difference between DFT and DTFT (you will learn more details soon), we have shown this equation with the variable X(k). Here,
N =Total number of samples
j, k = variables
Pay heed to the formula and you will see that it consists of some finite numbers. Therefore, we can say that DFT is used to determine the spectrum of the sequence with a finite number of samples.
Here is another type of Fourier transform that, as the name implies, is a fast method of performing Fourier transforms. Have a look at the simplest definition of this simple Fourier transform:
“FFT is the type of Fourier transform that converts the signal into a single spectrum and, therefore, it provides the information about the frequency of that signal easily."
Let’s hear the story of the simple signal when it is fed into different procedures of FFT.
First of all, the signal is decomposed into a complex N time domain signal that is a complex signal. This signal has two parts:
Real part
Imaginary part
Then different procedures occur at these parts. They are multiplied, and we get different chunks of information.
After all the information from the N-1 number of samples is collected, the procedure to merge all the information into a specific pattern starts.
Once we get the information in that particular sequence in the frequency domain, we use the calculations to get the final result.
You might be wondering why this method is named "fast transform." Well, FFT is the form of DFT that skips some procedures, and in this way, we get a short form of the Fourier transform that is fast to perform.
It is a fast algorithm that works on the rule of divide and conquers. It takes the signal and divides it into two smaller signals. In this way, it becomes easy to solve the signal.
Code:
t=0:0.01:1;
x=sin(2*pi*15*t);
subplot(211)
plot(t,x)
xlabel('Time /The Engineering Projects.com')
ylabel('Amplitude')
FFT=fft(x,1024);
xabs=abs(FFT);
subplot (212)
plot(xabs)
ylabel('Amplitude')
Output:
As you can guess, it is the pre-defined function to perform the Fourier Transform, and we just have to provide the parameters, and all the tasks and calculations are here in front of you in seconds. The syntax of the FFT function is given as
fft(x)
fft(x,y)
fft(x,y, dim)
Where
x is the equation that we want to use to perform the FFT.
y represents the number of points for the DFT.
Dim is the dimension of the Fourier transform. If you have any, you can write them here.
In our code, we have used the second form. It is up to you which kind of syntax you want to use. The more details you provide to MATLAB, the better results you will get.
Another function that we have used in MATLAB is the abs function called the absolute function. This function is used to have the absolute values in the MATLAB codes. The result we obtain from the fft function may have real and imaginary parts or it may also have some negative values in it that are complex to deal with. For our convenience and the accuracy of the result, the abs function converts it into the absolute value that has the positive integers and we get the accuracy in our answer.
While looking deeply into the code given above, we can understand the concepts of the fast Fourier transform. Here is the flow of code through which we are performing it:
First of all, t specifies the time period at which the Fourier transform will be shown on the graph. Here, we have provided the starting point as 0 and the ending point as 1. The value between them is the period on the basis of which the shape of the wave will be shown.
To store the equation of the Fourier transform, we have used the variable x. This is the basic question and as we all know, there is a compulsion to write the signs of arithmetic operations and brackets all the time.
The result is then fed into the plot command where we specify the time on the x-axis and the value of the question that we have saved in the x variable is specified on the y-axis.
The whole work is done by the single function of fft. You just have to input the values and you will get the result.
To improve the work of this transform, we are using the abs function.
You can also use the same function without the plot and subplot commands if you do not want any graph. Take it as your homework and find what value you get when you simply put the value of x in the fft function. The results will be shown on the right side of the screen and each value can also be examined separately as we have specified in our code.
In addition to the two types, we also experience another type of mathematical tool named the Discrete Time Fourier Transform. At first, you may think it is DFT, as we have discussed before, but in reality, it is a slightly different form of Fourier Transform, and it is important to know about it so that you may clear some concepts.
Once you get an idea of its application, you can understand the mathematical form of DTFT. If for a given spectrum of signals, we have the sequence named x(n) then the DFT of that particular sequence can be found with the help of this general formula given below:
Note that x(n) is in the form of time domain signals. whereas the resultant X(ω) is in the form of a frequency domain with the complex variable ω that is omega.
There is a different notation on the same formula on the internet with different types of variables. So, do not be confused and get the core concept and apply it in your own way.
DFT |
DTFT |
|
Full Form |
Discrete Fourier Transforms |
Discrete-Time Fourier Transform |
Continuity |
Non-continuous Sequence |
Continuous Sequence |
Periodicity |
Non-periodic |
Periodic |
Variable |
It does not have any variables like omega. |
It comes with a continuous variable called Omega. |
Type of frequencies |
It has only positive frequencies. |
It contains both positive and negative frequencies. |
Accuracy |
Less accurate |
More accurate |
Today we have learned a lot about the Fourier transform and also seen some practical implementation of some types of Fourier transform. We have introduced the Fourier transform, learned about the type of this transform, and also saw the DTFT with the comparison of DFT. The code on the FFT was explained deeply where we had the details of its function and also saw the graph as a result. We have a lot of information about the Fourier transform, and we are going to discuss it in detail in our next session.
Hello, readers. Welcome to another lecture on signals and systems where, on the previous day, we studied the transforms. A Z transform is used to change the domain of a signal or function. It is used to convert the signal from the time domain into the z plane. Now we are going a little deep into the discussion. Have a quick promo of the topic of today:
What are the properties of z transform?
What is the unit impulse of z transform?
What is the unit ramp of z transform?
What is the difference equation and how is it related to the z transform?
What are some important applications of z transform?
We’ll go through each of these topics in detail, so stay with us to learn about all of them.
Till now, we have seen the introduction of z transform along with some basic information. It's time to discuss some properties of z transform in this lecture. We always mention the properties of the topic if possible to clearly describe the nature and workings of that particular topic. It will be correct to say that while discussing the properties of a mathematical tool, we provide you with a wide domain of learning and experimenting about that particular topic.
The z transform is always linear. It means, if we have two statements and apply the z transform individually on both of them, then we always get the linear results. Mathematically,
If
F(z) = Z{fn}
and
G(z) = Z{gn}
Then
Z{afn + bgn} = aF(z) + bG(z)
When we talk about the time shifting property of z transform, we come to know that while passing through the time shifting process while we are performing the z transform, we get the following results:
If we take n-m instead of n in the property given above, we’ll find the results in which the signal in the z plane multiplies with the z complex number having the exponential power equal to the m with a negative sign with it.
The time reversal property of z transform states that if we have the following condition:
x(n)⟷Z.TX(Z)x(n)⟷Z.TX(Z)
Then after applying the z transform, we will get
x(−n)⟷Z.TX(1/Z)
You can see that after the application of z transform, we get the z in that is present in the denominator of the resultant X value. Therefore, this property is named the reversal property.
Convolution is an important process in signals and systems and we have also read great detail about it in this course. While merging the concept of convolution and z transform, we get to know that if,
x(n)⟷Z.TX(Z)x(n)⟷Z.TX(Z)
and
y(n)⟷Z.TY(Z)y(n)⟷Z.TY(Z)
Then we can easily guess that
x(n)∗y(n)⟷Z.TX(Z).Y(Z)x(n)∗y(n)⟷Z.TX(Z).Y(Z)
Keep in mind, the convolution is not same as the multiplication of the signal. It is the process in which two signals are overlapped in such a way that they form the third signal that has a mix of the properties of both the signals that are convoluted.
If you have studies about the convolution, you will surely have the information of correlation as well. This property of z transform states that if we have
x(n)⟷Z.TX(Z)x(n)⟷Z.TX(Z)
and
y(n)⟷Z.TY(Z)
Then after the process of correlation while you are using z transform, you will get the following results:
x(n)⊗y(n)⟷Z.TX(Z).Y(Z−1)
If you are new to the correlation then you must gpo to our previous lecture about correlation where we have descried this briefly.
Based on different experiments and studies, a theorem has been introduced and the initial theorem is one of them. This theorem is used to find the initial value of of the statement without using the inverse z transform and it states that:
x(0)=limz→∞X(z)
This theorem is only applicable to casual signals.
This is another theorem that is usually introduced while discussing the initial value theorem. It states that if:
x(∞)=limz→1[z−1]X(z)
It is also used in cases where you do not want to apply the inverse z transform and use the alternative way.
The unit impulse function is used in physics and mathematics. It indicates the function that has zero width and a unit area that is the area of value 1. Unit step function using z transform is simple and easy and it results in the sequential series. Suppose we have the following function:
Then after applying the z transform of this statement, we get a geometric series. Recall that geometric series is the one in which every value is the result of the multiplication of the previous value with a particular constant depending upon the condition given for the geometric constant.
A unit ramp function is one that after the implementation of different operations, provides a graph that has a straight slope. Such functions are widely used in the formation of complex operations. While using the z transform, it is defined as:
x(n)=r(n)={n For n≥0 0 For n<0 }
Then we can solve this by using the procedure of z transform as:
The multiplicative property of z transform is also called the complex convolution property of z transform. It is because, it results by the multiplication of two signals of time domain that corresponds to the complex number of z domain. You can have the idea of this property with the help of the code given nex that is the extension of the code that we have worked with before.
Code |
Output |
syms n; f=sin(2*n) F=ztrans(f) G=iztrans(F) H=F*G |
|
The difference equation is somehow a special case in the equation and the z transform is used to solve this in an effective way. It is defined as:
“The difference equation is the special type of equation in which there exists a difference (minus operation) of different variables. These show the relationship between an independent variable and the consecutive difference of a dependent variable.
These are not complex equations, and usually they depend upon arithmetic operations. Here is a simple example of the difference equation:
y(n)− 34y(n−1)+y(n−2)=x(n)+x(n−3)
Another example of the difference equation is:
𝒚-(𝒏+𝟐)−𝟔𝒚-(𝒏+𝟏)+𝟗𝒚-𝒏=𝟐^𝒏
There are certain steps that are used to solve the difference equation, and these are given next:
Convert the difference equation into the algebraic equation using the specific procedure of the z transform.
Calculate the solution of the resultant equation in the z domain.
Take the time domain equation of the result by using the inverse z transform (that we learned in the previous lecture).
Code |
Output |
fs=1000; t=0:1/fs:1 f=2; x=cos(2*pi*f*t) n=-0.1+(0.1*0.1)*rand(1,length(x)) nx=n+x; num=[1 0.3 1/3] den=[1] y=filter(num,den,x); plot(t,y) |
|
Here, you can see that we have used the plot command to see the signal graphically. You can skip it if you want to have the numerical values only. By changing the frequency value, you can have different types of results. Other parameters that qwe have used are the same that we have described in the previous sections of this series.
Z transform has great significance in the mathematical field, especially in the signal and system and other branches where the signals have a fundamental role. Till now, we have learned a lot of things about this transform and therefore, we expect that you will understand the reason why this transform is used in almost every field of mathematics.
As we have said earlier, z transform deals with discrete-time signals. This is the main reason z transform is used in the process of digital filter analysis. The interesting fact is, laplace transform can not be used in this regard because they can not work on the discrete signals.
The digital filters are the mathematical algorithms that are mainly used in the implemetnatation of digital input signals to obtain the digital output signals.
One of the property that we have learned till now is the linearity of z transform and this property is also used in the analysis process of linear discrete system. The are the system that takes the discrete system as input and after different operations, it also restun us the discrete signals again. Z transform is used to maintain the stability of the result throughout the system.
We all know that the z transform is used to obtain the result in the z plane. It converts the signal with the time domain into other formats, such as the frequency domain. Therefore, while working with the signals, the z transform is used in finding the frequency response.
In the field of telecommunication, all systems are based upon the transfer of a number of bits from one place to another. Z transform is used there to stabilize the flow of the bits as they are in the form of discrete signals. Other techniques are also useful for the same purpose, but while using the z transform, it becomes easy to predict the results and the time at which the communication will occur.
A Z transform is used to overcome the feedback control problems of the system. It is done by using different types of signals, including continuous time and discrete time signals. This transform can be used differently when practically implemented.
In operations where experts want to know the exponentially changing values of the signals, they prefer to work with the z transform according to the nature of the signal.
As we have learned previously, there is a z value that is used in the work of z transform. This is an important feature of the z transform because of its complex nature. It is used to perform complex calculations easily, which were not possible with the Laplace transform.
Z transform is widely used in signal processing ( as we are reading it from the start). Basically, it is a signal processing tool that is efficiently used in the analysis and interaction of different signals. The poles and zeros used in this type of transform help to recognize the nature of the signal; that is, is it casual, stable, or inverse in nature?
It was a long article based upon interesting facts about the z transform. We were having the discussion of the z transform from our previous session where we saw the basics of the z transform. We saw the properties of the z transform and discussed the important points to clarify our concepts. We also use MATLAB for the implementation of a difference equation. In the end, we learned the simple description of the z transforms application to make our minds about the importance of this topic. If you want to learn more, you can find examples of each property and Use them as your homework. The next lecture is also going to be a little bit complex yet interesting because we are going to learn another transform, which is the Fourier transform.
Hey learners! Welcome to another exciting lecture in this series of signals and systems. We are learning about the transform in signals and systems, and in the previous lectures, we have seen a bulk of information about the Laplace transform. If you know the previous concepts of signal and system, then this lecture will be super easy for you to learn, but if your concepts are not clear, do not worry because we will revise all the basic information from scratch for our new readers. So, without wasting time, have a look at the topics of today.
What is z transform?
What is the region of convergence of z transform?
What are some of the important properties of the region of convergence?
How to solve the z transform?
What is an example of the z transform in MATLAB?
What are the methods for the inverse z transform?
You must have an idea that the Laplace transform is a general case transform and converts the signal from a time domain into a frequency domain. The same is the case with the z transform, it changes the domain of the signal but in another way. The Laplace transform is associated with the power signal and the z transform has some other characteristics. Usually, the z transform is used to understand the stability of the system. Z transforms are used in
Energy signals
Power signals
Neither power nor energy signals
Yet it is applicable to a certain level, and after that level, it is not that much more effective. The Z transform is a powerful mathematical tool and is widely used in mathematical courses and applications including signals and systems. We introduce the z transform as:
"The Z transform is a mathematical tool that, after different procedures, converts the differential equation (with time domain) into the algebraic equation of the z domain."
Mathematically, we show it as:
As you can see clearly, the summation sign contains the limits from negative infinity to positive infinity which means it is a bilateral function of the z transform that we have shared with you.
By the same token, you can also predict that the z transform also has another region that lies between the zero to positive infinity. It is called the unilateral z transform and it works a little bit differently than the first case discussed here. We describe it as:
Let’s discuss the whole statement in detail but prior to starting, recall in your mind the definition of discrete-time signals. We know that:
“A discrete-time signal is one whose value can be measured at discrete intervals." When working with a discrete-time signal, there will be time intervals of n during which you will not have a value. In the representation of DT signals, the form x[n] is used. Discrete signals approximate continuous-time (CT) signals."
Therefore, when talking about the z transform, keep the definition of z transform in your mind to understand what exactly is going on.
Now, look at the statement given above.
We have the discrete-time signal in the time domain represented by x[t].
We applied the z transform to it.
Now, we got the same signal that lies in the z domain and is multiplied with a complex number z having the exponential of the n with a negative sign.
Do not worry about the value of n all the time. The summation sign indicates that the value of n starts from negative infinity (or zero in unilateral z transform) to positive infinity, and in this way, we found the values of the series. (This will be much clearer when we discuss the procedure).
Here z is a complex number that is described with the help of this equation:
x(n)⟷X(Z)
The whole discrete time signal is converted into another format with the z transform as a base,
The region of convergence, or simply ROC, is an important term that is used to describe the range of z in the z transform. As we have said, z is a complex number and its range, therefore, has different types of properties.
No. of poles: In z transform, where x[z] is always finite, there are no poles. (We’ll define them in a later section). The ROC of the z transform does not contain any poles.
When talking about a right-sided signal, the region of convergence is always outside the z-plane circle.
When talking about a left-sided signal, the region of convergence is always inside the z-plane circle.
If we have the signal on both sides, then the region of ROC is in the form of a ring inside the circle.
To have a stable form, the region of convergence has a unit value.
There are different cases in the z transform that if we start to describe, will be more confusing and time taking than other transforms. So, we’ll discuss a general format of z transform, and after practice, you will learn the procedure effectively.
Thoroughly examine the question.
Use the formula of the z transform given above.
Put z into the denominator as it has negative power. Doing so will convert the negative power into a positive.
Make sure you take the common values out of the sequence.
Put the value of n as 0, 1, 2, 3, 4, and so on to get the series.
Solve the equation.
It is the most basic and simple description, but the z transform is not that simple. Instead of solving the long calculations, why not use MATLAB for practical implementation? If you have your own course instructor at university, you must have the idea of solving the procedure by hand.
In MATLAB, the z transform is as simple as the previous transform was. Therefore, we are emphasizing the usage of MATLAB at every step. Note that if you want to have a detailed procedure to perform the functions theoretically, you can find your instructors. But from the performance point of view, you should go to MATLAB to confirm your answers all the time. Here is a simple example of an equation that also shows some little details.
Code:
syms n;
f=(2*n+5)/3
disp('x[n]=')
disp(f)
ans=ztrans(f)
disp('z[n]')
disp(F)
Output:
Here, you can see we have used the pre-defined function of z transform given as:
ztrans(x)
With the help of the z transform, you can solve any equation or expression that you want.
Notice that we have used a display function in the code. You must know that z transform can also be done in MATLAB without using the function.
The display function is used to label the numerical output. It does the same work as the xlabel and ylabel in the graphical window of MATLAB. Moreover, this function is also used to call the value that we have specified before using it and to display the results directly. The syntax of the display function is
disp(x)
disp(‘x’)
Where,
To display the string value, we use inverted commas around the value.
To call the value of x, we simply use it as it is.
Never use this function with a capital D or any other change in the spelling, otherwise, you will get the error.
Have a look at another example of the z transform in which we added two trigonometric functions and found their z transform.
Code:
syms n;
f=sin(2*n)
ans=ztrans(f)
g=cos(3*3.14*n)
ans=ztrans(g)
Output:
When you study this particular topic of z transform, you will hear some terms named as zeros and poles. These are the simple topics while learning z transform and usually, are used in the numerical problem. Consider the following equation:
Zeros: while solving the equation with the fraction, the numerator contains the M roots corresponding to the zeros. In the equation given above, q represents the zeros.
Poles: When you are solving the fractional equation by z transform, the N roots in the denominator are called the poles. Here, these are represented with the letter p.
While solving the z transform, we make a circular representation to solve the equation, just like we did while we were learning ROC. Poles are represented at the y-axis, and zeros are represented at the x-axis.
As you can guess from the name, the inverse z transform is used to convert the results of the z transform into the form before the z transform. There are different methods through which the calculations of the z transform are inverted from an equation.
Long division
The partial fraction method of inverse z transforms
Residue method
Power series of inverse z transform
This method is applicable when:
There is a ratio of two polynomials
The polynomials can not be factorized
To apply inverse z transform with this method, the division process of numerator with denominator is carried out. The resultant equation is then passed through the procedure of inverse z transform and we get the results. It is a complex method.
This is the method that involves the rules and procedure of partial fraction (we have received it in the previous lecture) and after that, the inverse z transform is applied.
There are different names for this method including the inversion integration method and contour integral method. For this method, we have to follow the equation given below:
The inverse z transform is obtained by summing up all the residues of this equation from the poles point of view.
In the end, this is the simplest and easiest way to find the z transform. In this method, the equation is expanded and we get the series of ascending powers. After that, the coefficient of z^-n is the required result.
To apply the inverse z transform in MATLAB, we use the following formula:
iztrans(x)
For convenience, we have put the process of z transform and the inverse in the same code.
Code:
syms n;
f=sin(2*n)
F=ztrans(f)
G=iztrans(F)
Output:
We have started the discussion of another transform named the z transform that is somehow similar to the Laplace transform that we have learned in the previous sessions. Z transform is a useful mathematical tool and we studied the ROC, procedure, and the inverse method of z transform. We also saw some examples in MATLAB. In the next lecture, we are going to learn some other basic information on the same topic.
Hey fellows, in the previous lecture, we read the basics of Laplace transform and now, we want to go into a deep study about the same topic. Usually, it is important to learn all the properties of a mathematical tool to use it well, but we’ll focus on the basic and important properties of the Laplace transform to understand its concepts. Here are these:
Linearity
Time delay
Nth derivative
Frequency shifting
Multiplication with time
Complex shift property
Convolution of the Laplace transform
Time shifting
Time reversal
If you have read the previous concepts clearly, then these concepts should be clear in your mind. We’ll define all of them one after the other, and you'll understand each of them clearly.
We all know what linearity is. Yet, the linearity of the Laplace transform is slightly different. When we apply the Laplace transform to two functions that are multiplied with a constant value, say a and b, then the result obtained is equal to the addition of these Laplace entries and multiplying the respective constant with it. In short, we can say:
“Adding two or more values and applying the Laplace transform does not have any change in the result, but we get the linear output.”
This can be illustrated clearly with the following mathematical representation:
You must keep in mind that no matter how many entries you add, the result will always remain linear.
Laplace equation A time delayed function's transform is the function's Laplace Transform multiplied by e-as, where an is the time delay. We frequently investigate systems as a function of frequency.
One must keep in mind that to apply this property, we multiply the delayed version of a function with a delayed step. For instance,
If
Original function= g(t)·γ(t)
Then
Shifted function= g(t-td)·γ(t-td)
If
td=time delay
When taking the derivative of the Laplace to transform, there is a long procedure. It is stated as follows:
There is a long calculation of the whole statement, but after that, the result follows the formula given below:
So, you do not have to take care of each and every value of a long calculation, simply follow this formula and put the values in it, and you can find the derivative of any degree when dealing with the Laplace Transform.
In some other places, the 1st and 2nd derivatives of the Laplace transform are also discussed as properties, but the key point is, that you can put any value of n in the formula given above and get the required results. We have not mentioned them to make things simple.
The frequency shifting property of the Laplace transform is described as
es0t f(t)) ⟷ F(s – s0)
The result on the left-hand side describes the shift of the Laplace transform.
When multiplying the Laplace transform with the time T, the result obtained is:
T f(t) ⟷ (−d F(s)⁄ds) |
When dealing with the complex number and the Laplace transform, one must keep the following statement in your mind:
f(t) e−at ⟷ F(s + a) |
If you are following our previous series, then you must know what the meaning of this property is. Yet, we can revise it. Convolution is the method in which two signals are folded onto one another in such a way that they produce a third signal. The same is the case with the Laplace transform.
When two functions of the Laplace transform in the time domain are convoluted, we get results that have the multiplication of them within the frequency domain.
As we have read about convolution in the previous two lectures, you can get an idea of how you can check this property. To save time, you can also check it in MATLAB. You just have to follow these steps:
Go to MATLAB.
Write the code for the Laplace transform of the first statement by using the function.
Repeat the same procedure with the other statement.
Write the code of convolution of the results as we have done previously.
Output the results.
Time scaling is a basic property of signals, and when we talk about the Laplace transform, we get to know that after scaling, the variable a from the denominator is shifted into the multiplication; that is, we get the time signal in the frequency domain.
Here is another thing about the Laplace transform. The step function is defined when we use the function of the following form:
u(t) = ( 0 for t < 0,
1 for t > 0)
This statement shows that for the values between 0 and 1, this statement is also known as the Heaviside function.
As you can guess from the name, the Laplace transform can be inverted, and this procedure is called the inverse transform. Once you transform the function from the time domain to the frequency domain (that's what the Laplace transform does), you can simply invert the whole process by using the inverse Laplace and get the result in the time domain again. This technique is useful in a number of applications of the Laplace transform. It is represented as:
f(t) = L-1{F(s)}
Now coming towards the solution to this transform. While checking the table, you can easily find the inverse transform. However, if the solution or the term is not present in the table, you can find this inverse with the help of the partial fraction expansion method.
As in the previous case, inverse Laplace is also performed in MATLAB with the help of functions. Here is the simplest example of this function. Suppose we want to perform the inverse transform of the code that we have discussed before.
Code:
syms t s;
ilaplace(exp(3*t)/(s+13)*(s-2))
Output:
All the descriptions are the same as in the previous case, but you can see we used a slightly different function as
ilaplace(x)
Where x is the value of the question that we have fed into this function. Finally, have a look at the code given next in which I just have merged Laplace transform with the inverse Laplace so that you may understand the whole mechanism.
Code:
syms t a s;
f=exp(a*t) %Question
F=laplace(f) %Laplace Transform
G=ilaplace(f) %Inverse Laplace Transform
Output:
Here, a new thing is introduced in our program that may be new to you. We used the comments and these can be added to any program of MATLAB same as the other programming languages.
Comments in the programming languages are ignored by the compiler at compile time. In other words, we can not add any extra words in programming languages because the compiler does not understand them and we risk an error. So, if a person wants to add details about the steps or wants to add any notes, he or she uses the comments. The compiler then ignores these lines, and in this way, we do not get any errors. Usually, comments are shown in a different color than the code lines (green in MATLAB). To add comments in the program, we simply put a percentage sign % before the notes.
As we have all learned in our matriculation, the partial fraction is the method in which the difficult denominator is solved by converting it into different partial fractions. In this way, it becomes easy to find the values of variables, and after that, the result is recollected into the desired form.
There are different cases in the partial fraction of the Laplace transform and some of them are given next:
Direct real roots
Repeated real roots
Complex roots
Order of numerator and denominator are equal.
Exponential in the numerator
Now, you must be thinking about how inverse Laplace can be used as a partial fraction. Let's have a simple example in which you will learn to solve this case.
Consider the following question:
F(s)= s^2 +3/s^2(s+2)
You have to follow the steps given next:
Write the right-hand side part of this equation on the left side of the equal sign and mark it as X.
At the right side of the equal sign, you have to split the denominator. Here, you can see that there will be three fractions when we split the denominator. These are:
s
s^2
s+2
The numerator is ignored at this point, and you have to put A, B, and C on each numerator of the partial fraction.
Now, simply multiply s with the whole equation and solve them one after the other.
Cancel the values as much as possible.
Solve the equation.
Repeat the previous four steps by placing the 2nd and 3rd denominator values.
You will find the values of A, B, and C.
Put the values in equation X and this is the required answer.
This explanation is just for revision, otherwise, we all know the implementation of a partial fraction.
As you were expecting, MATLAB has the implementation of fractions in just a second. You do not have to do long conversions. Simply put the code in MATLAB and you will get accurate and easy answers in just a second.
Suppose we have the question:
F(s)=(4s+24s^22+48^3)/(s+4)(s+1)(s+2)
Then you will use the following code.
Code:
num=[4,24,48]
roots1=[-4 1 2]
den=poly(roots1);
[r,k]=residue(num,den)
Output:
Here, you can see that we have used a different type of code that till now we have not discussed. So have a look at the description given next:
The term "num" describes the values in the numerator.
The den represents the entries of the denominator.
We used the poly(x) function in which x represents the value that has to be converted into polynomial form.
Here in the place of x, we inserted the values that, before calling it, we stored in the user-defined variable roots1. It was named by us, but you can call it by any other name.
[r,k] = residue (num, den) is the pre-defined function of MATLAB in which we find the values of the variables that we have shown by storing them in num and den.
Always keep in mind that the values that we have stored in the den are the values when we put the s-x=0, the sign of each value is reversed. Moreover, never change the sequence of the numerator or denominator in the pre-defined function otherwise, you will get different results.
Have a quick review of the Laplace transform here:
In data mining, there is a great role for databases and records of previous values. The laplace transform plays an important role there and helps to keep the record in a great way.
All the conversation about the Laplace transform was based upon the application of this transform in signal processing. It is used in the filtering of signals, processing of signals, and changing the domain of the signals.
This transform is used to convert the governing complex equations into simple differential equations.
Not only in probability, but it is also used in the moment and variance as well. It is a necessary topic in most mathematical courses.
In computer ICs, the Laplace transform is used to measure and predict the current and other parameters in a great way. Therefore, it is used in the designing of ICs and delicate circuits in a great way.
Today we have seen some interesting facts about the Laplace transform and read thoroughly about the properties and types of Laplace transforms. We used MATLAB for examples, and we also found the working of this transform in detail. In the end, we have a glance at some basic and simple applications of Laplace transforms.
Till now, we have read about the basic concepts and functions in the signal and system, but let’s have something that is more practical and practice each and every topic thoroughly because if you have the understanding at each point, transforming will become an interesting game for you.
Keep in mind, that transforms are an important topic in signal processing, but they were traditionally taught in the same way they were discovered: through calculus. This approach, however, does not reveal the true purpose of the transforms or why they are desirable. Well, let’s check the topics that we are going to learn about today:
What are transforms?
Which common transforms are used in signals and systems?
What is the Laplace transform?
How can you implement the Laplace transform in MATLAB?
What are bilateral and unilateral Laplace transform?
What is the difference between these two types?
We are reading very simple and handy information about the signal and system in this tutorial, but practically, signals are used everywhere in a very effective way by using a great number of values and merging them in an effective way. This becomes very complex to understand, even if you are using complex software such as MATLAB. To simplify, general work transforms are made so that not every time, users have to make complex calculations. The good thing is, that transforms are used to deal with the signals in the different types of domains. You can take transforms as a formula that does not require calculating and proving every time. You just have to follow the procedure and put the values in the formula, and you are good to go.
The main reason we need transforms is that we want to have a different view of our time domain signals, highlighting characteristics that are difficult to see with the naked eye. It's similar to switching from rectangular coordinates to polar coordinates when the problem demands length and direction.
Transforms are not necessary to deal with the signal and system, but
They make signal formation easy and convenient.
These are the best ways to deal with the system.
Computation and analysis have become interesting and convenient.
The results are easy to understand and, in this way, there are fewer chances of errors.
There is more than one transform because different scientists worked in this field and invented these transforms. The good thing about these is, that you do not have to have a grip on the knowledge of different planes and domains, you just have to know the basics of the domains and apply these transforms, and by following simple steps, you are good to go. We will learn about the following transformations in this series:
Laplace Transform
z-transform
You will also learn the types of these transforms and all the important information about them in a very simple and easy way. These also have some subtypes, and we’ll make sure to discuss them, but with all the necessary information that is related to this course and will avoid the extra points.
The Laplace transform is named after Pierre Simon De Laplace, a great French mathematician (1749-1827). The Laplace transformation is very important in control system engineering. Laplace transforms various functions. In analyzing the dynamic control system, the properties of the Laplace transform and the inverse Laplace transformation are both used. We define the Laplace transform as
“Laplace transform is the study of continuous-time signals in the frequency domain. It is done by converting the function of a real number (usually t) into the function of a complex number (say s) in the frequency domain.”Mathematically,
You can observe a small s in the formula. It is a complex number and it is defined as
s=σ+jω
Here, you can see that s contains “ω” which is a frequency component. And hence proved thatThe interesting thing about the Laplace transform is that it is sometimes simply called a one-sided transform or a one-sided Laplace transform because the limit does not start from minus infinity to infinity. Instead, only zero to positive infinity is used in this transform.
The Laplace transform converts the signals into another plane called the s-plane in which the signal is obtained in the frequency domain. This s-plane is important because it allows us to convert the differential equation of the time domain signal into an s-domain algebraic equation. For both humans and machines, algebra is simpler than calculus. As a result, using the Laplace transform to transform the signal makes it easier to perform certain operations on it.
The above formula provides us with some important pieces of information that we are discussing below:The formula states that we have a function of time denoted by f(t) that, after the Laplace transform, gives us the function of Laplace transform F(s) that is a complex function.
Observe that we use a lower case function when we talk about the function in a time domain and after the Laplace transform, all the notations are in capital letters, indicating that the transform has been applied to it.
This transform lies between the positive infinity and the zero value, and therefore, you must keep in mind that the results, after the Laplace transform, do not have the time variable in the result. (You will see it when we discuss the table in the next sessions).
Since the lower limit starts from zero, we’ll be interested in knowing the behavior of the function only for t≥0.
Given that the integral's upper limit is, we must wonder if the Laplace Transform, F(s), even exists. The transform appears to exist as long as f(t) does not grow faster than an exponential function.
As we have said earlier, the Laplace transform has great value in signals and systems and other mathematical and, therefore, MATLAB has a pre-defined function of Laplace so that you are not restricted to writing the whole code all the time. In this way, using the function is clean, easy, and less error-prone.
Till now, we have studied the signals and provided you with the numerical appearance with the help of MATLAB, but today, the calculation that we are making will be in numerical form. We can also plot these as signals, but usually, the Laplace transform is in the form of calculation, as you already have a great number of numerical examples in your syllabus related to the Laplace Transform.
The function used in MATLAB has the following syntax:
laplace(x)
Where x is the value for which the laplace transform is required. Here, the thing to remember is, that the first letter L is small here. Let's check the example to clear up all the discussion about the Laplace transform.
Here is a simple example through which we will prove all the points that we have made till now.
Question:
Find the Laplace transform of the following equation:
f(t)=e^at
Code:
syms s t a
f=exp(a*t)
F=laplace(f)
Output:
Here, you can see that the long calculations and formulas are condensed into a simple program of just three lines, and we get the correct output easily. Let’s understand this code.
First of all, we declared the variables that we are going to use in our Laplace transform. For this, we use syms. Any string after this is declared as a variable. If we do not do this, MATLAB will show an error and say that it does not have any information about that particular variable.
In the second step, we specified the equation of the question. In MATLAB, the exponential function is defined by using the exp(x) in which the x is the value that comes in the exponential area of the equation as you can see in the question. We stored this value in the variable f. You can use any value.
In the last step, we used the formula for laplace as it is a pre-defined function of MATLAB. In the equation, we just put in the value of the question that we had stored in the f. As a result, MATLAB will easily provide you with the answer and you do not have to go into deep calculations.
Enjoyed this example? Let’s move to a complex one.
Code:
syms t u a
f=u*sin(a*(t-2))*(t-2)
F=laplace(f)
Output:
You can see the same procedure is followed by us in this example. We put a little complex equation in f and got the results as expected. The great thing is, that MATLAB provides us with the value of each term on its own without demanding us to clarify its answer. Always keep in mind that:
There is a difference between capital and small letters. That is, MATLAB is case-sensitive.
The variable in which you store any information does not need declaration at the start but if you are using the variables in the equation, you have to specify them first so that MATLAB can distinguish them from the other variables and use them in the equation.
It is important to understand the sequence in which we are going to study the Laplace Transform because the things are linked with each other, and at a point, you will feel that is why you are learning so much about that point, and after that when you learn the application of that particular thing, you will have the idea of that point.
The Laplace transform can be solved with the help of a table that we will learn with great detail, and to understand that table, you have to have clear initial concepts. This table contains the properties of the Laplace transform that we’ll discuss in detail in the next session.
Here is a different way to solve the Laplace transform. Recall that the Laplace transform that we have read about till now is unidirectional; that is, the limits of the integration start from zero to positive infinity. Yet, now we are dealing with another type of Laplace transform that has a total limit. Yes, you are right, the limits of the integration are from negative infinity to positive infinity, and, therefore, it behaves differently from the one that we have discussed before. Here, we are denoting the Laplace transform with different variables so that it will be easy for you to memorize the difference in the behavior.
This type of transform is also known as the two-sided Laplace transform. Having a greater range of integration, this transform works a little differently.
Unilateral Laplace Transform |
Bilateral Laplace Transform |
The limits of interaction are taken from zero to infinity. |
The limits of integration lie between positive infinity and negative infinity. |
Restricted to the casual time function. |
Restricted to casual time function or non-casual time function. |
Takes the initial condition of the system in a systematic or automatic approach. |
Initial conditions are included with the additional inputs. |
Less complex |
More complex |
Fewer applications |
More applications |
People dealing with the practical applications of signals and systems have deep experience with both of them, and they use both of them in their work according to the nature of their work. Both of these have their own pros and cons, but once you have a clear concept of the unilateral Laplace transform, you can easily understand the other type.
So today we started an important topic in signals and systems named “Transforms” and studied the introduction to the Laplace transform. We saw some codes in MATLAB, as an example, and also read about the difference between the bilateral and unilateral Laplace transforms. The next lecture is going to be full of action and will see some applications of transforms as well.