We are going to use two examples of the use of convolution in Clinical Neurophysiology. We have seen that we can use the convolution as a filter. In this example we are interested in stressing the high frequencies of an ECG signal. It could be interesting to eliminate the slow components that could interfere in the process of detecting QRS complex. To do that, we want to subtract of each value the previous one. We are going to use the ECG signal contained in `signals' (the variable that we saved in the chapter about EDF format). First of all we read the variable and extract the ECG (which is included in trace 12)
-->stacksize(20000000); -->load signals; -->ecg = signals(12);
Now we are going to convolute the signal with a vector containing both coefficients (1 and -1).
-->ecgconv = convol ([1,-1], ecg);
Finally, we represent the original signal and the `filtered' signal with the following code
-->xsetech([0,0,1,1/2]); -->plot(ecg(1:1000)); -->xsetech([0,1/2,1,1/2]) -->plot(ecgconv(1:1000));
And the result is
![]() |
As we can see, the original signal (upper trace) contains a lot of slow frequencies (in P and T waves) that have been eliminated in the filtered signal (lower trace).