0% found this document useful (0 votes)
7 views9 pages

Lec 55

The lecture discusses the analysis of EEG signals to detect spike and wave complexes using a match filter approach. It outlines the steps for data preparation, template selection, and the implementation of the filter in MATLAB, including normalization and plotting of results across multiple channels. The findings indicate the presence of spike and wave signals, with a note on the lag introduced by the filter affecting the timing of detected peaks.

Uploaded by

Ram Dangi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views9 pages

Lec 55

The lecture discusses the analysis of EEG signals to detect spike and wave complexes using a match filter approach. It outlines the steps for data preparation, template selection, and the implementation of the filter in MATLAB, including normalization and plotting of results across multiple channels. The findings indicate the presence of spike and wave signals, with a note on the lag introduced by the filter affecting the timing of detected peaks.

Uploaded by

Ram Dangi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Biomedical Signal Processing

Prof. Sudipta Mukhopadhyay


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

Lecture - 55
Tutorial – III (Contd.)

(Refer Slide Time: 00:16)

Now, that we get the third problem of tutorial 3. Again, it is a EEG signal we get and we get
10 simultaneous recording of the EEG and here we get spike and wave complexes. We will
see that how the spike and wave complex look like. Again, sampling frequency is same as the
previous 100 hertz and one spike and wave complex is taken as a template and we have to use
cross correlation or we need to use a match filter.

So, in this case, we will take a match filter because already we have seen how to use the
cross-correlation in the previous problem. And we apply the procedure in all the channels and
study the result to detect the spike and wave complexes ok. So, let us see, how we have to
proceed for that.
(Refer Slide Time: 01:35)

The first ritual is to get the data and then the corresponding MATLAB file which will tell us
the format of the data and help us to read the data, then we have to keep the signal and the
MATLAB file that in the same directory, that is a working directory of our MATLAB.

(Refer Slide Time: 02:04)

Now, the first thing that, to view the signal, so for that, we have chosen the eeg to the f3
channel. We have loaded that ‘eeg2_f3’ signal, sampling frequency is noted. The length of
the signal is taken and we have length according to that, we are calculating the value and we
are taking the signal, we are dividing it with the maximum value to normalize it and we are
normalizing it and keeping it in the EEG(1,:), ok. We are keeping all of them, all the 10
channels into this variable at different rows.

The first row is fed with the channel f3 and then we take the plot of that f3. So, ‘axis tight’ to
keep only that area used by the graph ok. Now, let us see how the plot looks like ok. And
‘axis off’ make sure that x- and y-axis are not drawn and here we get this is the spike; this
portion is the wave ok. So, if we take that from here to here, we can get that this is the
interval is a spike and wave, but repeated number of times in this signal.

(Refer Slide Time: 04:16)

So, next thing is that we have to plot all of them. So, for that, we can use the same command
so many times with ‘subplot’ and at the end, we would like to put actually a marker to show
that one second mark ok. So, for that 2 to that, what we do, initially we put it 0, the first value
is put as 1 and then when actually the count is matching with the sampling frequency, that is
100, the remainder is 0 in that case; that means, count is becoming 100 or multiple of that,
then only remainder would be 0 then we make it 1.

So, in the other word, every second passes will have one tick. So, here is the signal that is
shown that we have all the 10 channels and here these ticks are showing that this is 0 second,
this is 1 second, this is 2 second ok. So, that is the way all the channels are shown all
together.

(Refer Slide Time: 06:02)

Now we need to find the template. Again, the choice of template it is done manually, what it
is done that for the first channel of that EEG, that is, we have taken the f3 there. So, there we
are taking the part sample 60 to 82; that means, we have 23 samples in the template.

So, this part we crop it and store it in the variable ‘tmplt’. Now once we have to create the
match filter, the first thing what we have to do, we need to flip this template and exactly that
is done by this command ‘wrev’ which reverses the template. So, if the template is something
like this or let us draw something asymmetric say, if the temperate is like this, after the
flipping it would look like this ok. So, we have done this reversal here and this is the impulse
response of the match filter and we have used that to keep in the variable ‘Nu’.

The name is chosen just to keep in mind that this is a numerator of the filter because will use
the ‘filter’ command and we will define some denominator polynomial, that is nothing but 1
because it is an FIR filter, and with numerator and the denominator polynomials, we create
the filter handler hd1 using the command ‘dfilt.df2’, again direct form 2 we are using. Now,
let us look at the plot of the template and the match filter. Here, at the top, we are showing the
template first, the spike here and this is the part wave.
So, after the flipping, the match filter impulse response, that is, smooth wave will come first
followed by the impulse or the spike. So, this is the transfer function we get and let us
proceed.

(Refer Slide Time: 08:56)

Let us see how to get the match filter output. For that, we are using the ‘filter’ command with
‘hd1’ is our filter and we are taking one channel at a time, first we are starting with the
channel one that is ‘f3’, then we carry the same operation for the other channels. And the
output is given in the variable ‘c1’, and for the plot, we have to issue that ‘figure’ command,
for the brevity of the space we have drop that. So, if you do not give that command, it will
rewrite on the previous plot. We divide the plot into 2 parts, sub plot 1 and plot the EEG
signal first. We write the title and the labels and then that what is the match filter output is
given in the lower half and give the appropriate label for that.

So, here we see the output that this is the signal with ‘spike and wave’ in ‘f3’ and as we have
taken one part from here as a match filter, we get the peaks here. So, all of them they are
indicative of the presence of the ‘spike and wave’ ok. So, so many peaks each one of them is
signifying the ‘spike and wave’ is present in this channel. So, now we do the same operation
in the remaining 9 EEG channels.
(Refer Slide Time: 11:16)

So, let us go ahead with that. Here we are showing it for ‘f4’ and ‘c3’.

(Refer Slide Time: 11:30)

Next, we get it for channel ‘c4’ and ‘v3’.


(Refer Slide Time: 11:37)

Then for ‘p4’ and ‘O1’. So, for all these cases, we are able to get that we have the peaks
present, high peaks which signifies that the ‘spike and wave’ signal is present in all these
channels.

(Refer Slide Time: 12:15)

Now, we go for ‘O2’ and ‘T3’, again we have the same finding.
(Refer Slide Time: 12:24)

Then the last one, that is ‘T4’ again we see the high peaks in the match filter output
signifying that spike and wave is present.

So, now here we summarize it. The peaks in the filter operation signifies that we have the
‘spike and wave’ complexes. However, another thing we should look at if we go for any of
the signal, there is a lag wherever the ‘spike and wave’ is there. If you look at the spikes, we
will see that it is lagging the. Here is the complex and the peak is occurring little later, that is
because of the lag introduced by the filter ok. Our template has a finite length and when we
try to use it as a causal signal, we have to add some delay and that lag is responsible for this
lag ok.
(Refer Slide Time: 13:52)

So, if we have to find out the location of that, then we need to be careful, we need to take care
of this lag; however, that was not the task here. So, we will leave it here and we say that the
third problem of the tutorial 3 is completed.

Thank you.

You might also like