Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lec 57

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Biomedical Signal Processing

Prof. Sudipta Mukhopadhyay


Department of Electrical and Electronics Communication Engineering
Indian Institute of Technology, Kharagpur

Lecture - 57
Tutorial – IV

(Refer Slide Time: 00:17)

So, now we are starting the tutorial 4 with the assignment 1. Here we have provided with
the signal ‘emg_dog2.dat’. It is taken from a diaphragm of a dog, crural diaphragm
means it is near the leg. So, some fine-wire electrodes are actually sewn in-line with the
muscle fiber 10 millimeter apart. And we get this signal, the two cycles of breathing is
captured and with very high frequency it is sampled 10 kilohertz ok.

And we also two actually get that to read that signal we should look at that
‘emg_dog2.m’. Now job is to write a MATLAB program for full wave rectification and
or half wave rectification. In fact, we will be both and after that we should apply low
pass Butterworth filter of order 8 and cutoff frequency should vary from 10 to 20 hertz.
And we should actually see analyze and evaluate the result of these two techniques of
rectification and at least two different low pass frequencies; that means, the impact of
choice of the rectification algorithm and the choice of the cutoff.

And to compare the result, the envelope is also given, the envelope is given here, that is
also a signal, hand drawn, that is given that is the envelope signal here.
(Refer Slide Time: 02:33)

So, first we take the EMG signal and the corresponding MATLAB files to read them and
we put the input signal and the MATLAB code in the same directory ok, the working
directory of MATLAB and our work starts from here.

(Refer Slide Time: 02:54)

First, we have to read the file. So, we load the signal in the variable ‘emg’, we know the
sampling frequency is 10 kilohertz.

So, we are actually scaling that signal here and we are finding out the length of the signal
‘emg’ and with that we are finding out the time axis that 1 to ‘slen’ gives the ramp and
multiplication with 1 by ‘fs’, that is the inter sample interval is multiplied to get the exact
time point and then we normalize the signal, we eliminate the mean. In fact, order of
these two could be changed, we can remove the mean and then do this.

Then we have loaded the envelope also, what is given, which we need to compare and
again we have taken the corresponding length and using the figure and the subplot
command at the top we are showing the EMG signal and below the envelope; that
means, what we are supposed to get. Here, we are showing the EMG signal and here is
the envelope we are supposed to get the envelope of the EMG signal like that which
should actually look like the envelope, the target envelope, which is provided with us ok.
So, this is the target.

This one is the target this is not derived from the EMG. So, this part this is for the
reference it is given.

(Refer Slide Time: 05:24)

So, first we do the rectification, the half wave and the full wave rectification. What we
are doing we are assigning the variable that ‘emg_h’ for that half wave rectification and
‘emg_f’ for that full wave rectification. We are assigning the length same as that of the
emg signal and we are finding out the locations where it is above the 0. So, that gives us
the half wave rectification. Here what will be the value that we do not need. So, we have
given here ‘~’ so that we do not store the values for those locations. Now what we are
doing, we are assigning the value of the ‘emg’ signal. So, the positive half is restored or
we are actually preserving the positive half, for the negative half where the value is
negative, it is because we have assigned it with 0, it has gone to 0. Now, for the full
wave, we are finding out first the locations where its value is greater than 0, again we
take that location and assign that in ‘emg_f’ ok. Here, we are finding out the location
again where it is negative and please keep in mind that these locations and these
locations would be different. So, first, it is assigning the value of the emg signal for the
positive cycle and for the negative cycle, what it is doing, it is taking the negative of the
value; that means, it is making it positive and storing it at the same location. So, that the
full wave rectification is happening because it is taking the positive half as positive and
the negative half also it is making it positive and preserving it ok.

So, with that we get the full wave rectification and here we see the output. For the emg
signal given here, this is the half wave rectification and the full wave rectification. We
cannot actually see much difference from this plot ok, though there will be some
difference as we can get that operations are different, but it is not apparently visible from
the plot.

(Refer Slide Time: 08:39)

So, we go for the next step, that is the low pass filtering, what is the purpose of this low
pass filtering because that after the rectification, what will get, we would get a jagged
signal or we can say a lot of ripple is there along with that DC signal.
So, we would like to remove the ripple or reduce the amount of ripple or AC frequencies
in that and for that purpose, a low pass filter is suggested with order eight, and first
starting with cutoff frequency at 10. So, using the design criteria that the order and the 3
dB band width, we assign ‘N’ with 8 and ‘Fc’ with 10, and ‘fs’ is 10 kilohertz, with that
we have created the design and then we have created the low power butter worth filter
here using that criteria.

And then first we use the half wave rectified emg signal to pass it through the butter
worth filter and next we also get the filtered output of the full wave rectification using
the same filter, and now we are having three plots one below other. At the top, we have
the half wave rectified output which we get after filtering. So, second, we are getting the
low pass filtered full wave rectified output and at the bottom of these two, we get the
envelop that is given as a reference ok.

So, these three we expect here and these are the three outputs, at the top half wave
rectifier output after filtering. We get that because of the filtering, lot of high frequency
components has reduced. So, ripple has gone down, it does not look so jagged, both of
them they look close to the reference envelop.

(Refer Slide Time: 11:39)

So, here we can see it more clearly for the low pass filtering at 10 hertz cut off
frequency, the output of the half wave rectifier is shown with respect to the reference ok.
Next, we changed the cutoff frequency, cutoff frequency is increased to 12.5. Now as we
are increasing the cutoff frequency, the increase in the envelope, this part, it is following
more like the reference envelope, the movement is faster, but the ripple is increasing ok.
So, that is the thing what we notice.

Next we increase it further, cut off frequency is made to 15 hertz. So, more high
frequencies are allowed. So, we get that the rise is becoming more actually smooth and it
is actually do not have much lag, it is following the same as the increase here, but ripples
are increasing ok.

So, with that let us move ahead, increase the cutoff frequency further. So, we are
preserving up to 17.5 hertz and we see that ripple has again increased a little more and
then we go for the 20 hertz, we get further increase which actually makes it sure that the
more we are increasing the cutoff frequency, the envelope is getting deteriorated ok.

We cannot say that envelope is looking better though it is actually changing faster and
following the faster change with respect to the reference envelop.

(Refer Slide Time: 13:59)

Now, let us put them together to study their effect side by side here. We are starting with
the 10 hertz and in each case the low pass filter order is same. So, only change is in the
cutoff frequency, then going to 12.5 then 15, 17.5 and 20, what we see that as we are
increasing the cutoff frequency, more and more ripples are coming in the output and that
when we compare with the reference signal we find that that is not a desirable one.

So, out of them, though the change maybe a little slower; that means, the way it is
increasing or decreasing that may be better when we have more high frequency terms,
but because of the presence of ripple in the output, we find that at 10 hertz the output was
the best for the half wave rectifier. Now, we have to go for the full wave rectifier output.
So, first we take the case that when 10 hertz is the cutoff frequency. So, we get some
small amount of ripple at 10 hertz, then we move for the other cutoff frequency, next
point is 12.5 hertz we are going for that, we see there is some increasing ripple.

(Refer Slide Time: 15:43)

Next, we would increase it further to see that what is the change.


(Refer Slide Time: 16:00)

So, it is increased to 15 hertz ok. So, as it is increasing that the changes are coming in the
same way. In fact, the sharp reduction is followed here, but what we find that ripples are
also increased.

(Refer Slide Time: 16:26)


(Refer Slide Time: 16:33)

So, again it is increased further 17.5 hertz and we see more and more ripples are coming
at 20 hertz. We see that the ripples are almost as big as the envelope and to compare
them, we put them together. What we see here that starting from 10 hertz, as we increase
the cutoff frequency to 12.5, 15, 17.5, 20, each of these cases that we have increase in the
ripple in the output though at higher frequency, the changes what is occurring in the
reference envelope, those changes are reflected in a better way, but the amount of ripple
that is getting in the output that does not make it a good representation of the envelope.

So, if you look at these cases, we can easily say that 10 hertz is a better choice of cutoff
frequency for that and another thing, we get that when we are going for the full wave
rectifier, the output is more closer to the reference wave form what is provided with us
ok.
(Refer Slide Time: 18:02)

So, these are the things we get. Now, let us conclude with the observations here the
envelope obtained from full wave rectified signal is smoother compared to the half wave
rectified signal ok; that when you go for the full wave rectified signal would be smoother
than the half wave rectified signal.

(Refer Slide Time: 18:36)

The thing could be, we can look at the picture to make it easy. Let us take a sinusoid ok,
a sinusoidal signal. Now, if we have half wave rectification, what we will have, we will
have the output would be like this and after the filtering, we will get this kind of signal,
compared to that what will get in that or let me clean this part that or I think better, it
would be let me change the color ok, if we take full wave rectifier, we are getting one
more actually the negative parts.

Now, if we look at the ripple frequency, ripple frequency has increased. Now because of
that, the rejection would be better. This gives rise to the fact that we are having a better
actually signal as an output ok.

(Refer Slide Time: 19:57)

So, we get a better signal as output. So, smoother signal as a output. Second part is low
pass filtered output with low cutoff frequency has smoother output, unwanted high
frequency components are filtered out. When we are increasing the cut off frequency, it
is allowing more and more high frequency components and actually destroying the
quality of the envelope. And in both the full wave rectifier signal and half wave rectifier,
we found that low pass filter with cut off frequency 10 hertz gives us the best output ok.
So, that is our observation from this assignment.

Thank you.

You might also like