Simulink over MATLAB Tutorial- Low Pass Filter (Part one)
In this presentation I will show how to use a low pass filter or demonstrate the concept of a low pass filter using the software called MATLAB along with it built in program called Simulink. So this is a basic tutorial or example of how to use it.
The objectives of this presentation is that I’ll first explain what an ideal low pass filter is and a simple RC low pass filter, from there I’ll do the demo first using Simulink, then MATLAB to demonstrate transfer function command tf, as well as the bode command to plot the system magnitude and phase plots as a function of either the frequency or the Radium frequency.
So let’s do a quick review of low pass filter. Let’s discuss the ideal one case, ideal low pass filter then I’ll plot the magnitude either as a functional frequency or radiant frequency. This is the magnitude, or amplification of a filter in here, an ideal low pass filter looks like that where we have this is a cutoff frequency. So anything below the cutoff frequency gets passed and I’ll illustrate that using a Simulink demo and anything above the cutoff frequency gets rejected.
Now it’s very difficult to design this type of ideal pass filter and because it’s not physically realizable, so here’s a more practical low pass filter with a longer role off and we define the cutoff frequency here and again this is the magnitude. Again the magnitude either defines the amplification or insinuation of an input signal as it passes through the low pass filter.
Now practical implementation of a low pass filter is govern by this simple RC circuit. Here’s our capacitor and our resistor. Here’s our input voltage, the I and our output voltage VO and our relationship can be found after transforming this into the Laplace description or frequency domain description where the impedance of C which stores energy in this case is governed by one over J omega C where J is an imaginary number, defined as a square root of-one.
Sometime you’ve see it as I as well. C is the capacitor value and farads and our impedance for our resistor which dissipates energy is equal to R. By using the voltage divider principle we can find the relationship of the VO over VI and that’s what this is as the magnitude of VO over VI. We plot this. This is also called the bode plot which I’ll demonstrate also in MATLAB.
So this would be one over J omega C over R plus one over J omega C using our voltage divider principle and if you see this, this is, bode plots is only for pure sinusoidal signals and you use the Laplace description for damped sinusoids. But they still have the same effect. So if I replace S, S in essence is the real part plus imaginary part where this real part is like the attenuation of a sinusoid describing that part of a damped sinusoid and omega is the input frequency associated with this complex number or signal.
Now what we can do is, saying that this a pure sinusoid when we say that, that means the real part is equal to zero and hence we can say this is one over SC so that implies S as approximately equal to J Omega and that’s our plus one over SC and then that’s equal to one over RC S plus one over RC. So I put this in this notation because that’s how we’ll find in MATLAB when we start doing Simulink example illustrating the low pass filter.
When you look at this, this is just a ratio of two complex numbers so when you find the magnitude that’s just VO over VI. The magnitude or the distance which is the real part plus imaginary parts squared and so basically, this would be one over RC is the numerator and then in the denominator, since this is like a complex number right here J Omega plus this, it’s one over RC squared plus OMEGA squared or S squared But when what you should see here when OMEGA is equal zero the gain of this when OMEGA is equal to zero, That implies that the gain VO over VI is approximately equal to one and that when OMEGA is equal to infinity then OMEGA over VI is approximately equal to zero. So as OMEGA gets larger and larger this quantity here goes to zero.
Now when omega is equal to one over RC then we could see here that VO over VI is basically approximately equal to the .707. That’s why we first here OMEGA C for this RC circuit is approximately equal to one over RC the cutoff frequency. So here is our .707 which is less than one or 3db difference. This here has a roll off, off minus 20 db per decade. So now I’m going to illustrate showing you this concept of how this simple RC filter acts like a low pass filter.
Next, we’re going to do a Simulink Demo of how a low pass filter affects an input signal with different frequencies. Connects will establish a model using a Simulink. So here it is, we’re going to use the continuous functions and we’re going to grab this transfer function and we’re going to configure it as low pass filter.
So here we’ll change the numerator to be 10 and then change this coefficient. So the cutoff frequency will be 10 radiance per second. We are going to go to our source, pick the sinusoid, sign wave input and right there we’ll go to sink and get an Oscilloscope and our sink do a O scope and then connect it from here to there. So here’s our scope we’re going to just assign a sinusoidal frequency here in this case is one radiance we’ll put an amplitude of five so it displays it in our graph and we’ll see how the amplitude changes with frequency.
So I’ll run it and we see that the output in the scope is displayed in the scope it’s still a sinusoid of amplitude five. Now we put it at 10 and should decrease to .7 times five. It should round about .35 so we’ll change this frequency again of our input to let’s say 10 radiance per second and we’ll run it and you could see here the amplitude is no longer at five but it’s likely decreased.
Then finally we’ll go 10 times as much by changing our input frequency, let’s say to 20 radiance per second or run it again and we can see that it decreases even more and we’ll go 10 times as much so we’ll change it to 100 radiance per second as the input frequency and we should see our output decreases even more.
So hopefully this demonstrates that this transfer function as we saw with the RC circuit does exhibit the effects of a low pass filter where it passes frequencies below 10 radians per seconds and rejects frequencies above 10 radians per second. That concludes this demonstration using Simulink. The next video will do a demonstration on MATLAB.
Transcription by:
Scribe4you Transcription Services