7. Efecto de la aplicación de silicio sobre la verticilosis del olivo
8.2.1. Localización del ensayo, material vegetal, condiciones de cultivo y
The automated real-time SWD detection algorithm is based on the CWT. A wavelet transform is a special form of time-frequency representation of an analogue signal which is obtained by convolving a signal (e.g. ECoG signal) x(t) with a given wavelet basis function
φsτ(t) (Daubechies, 1992; Koronovskii and Hramov, 2003)
, = ∗,
(1)
where * denotes a complex conjugation. The wavelet basis function can be produced from the mother wavelet function:
, = 1
√
− (2)
Here s is a timescale (as specified as a given compression or dilation of a mother function), τ
is the time shift of the wavelet transform and φ0 is a prototype ‘mother’ wavelet function. One
possible mother function is the complex Morlet wavelet.
2009). Therefore it was chosen as the ‘mother’ wavelet in the present SWD detection algorithm. The Morlet wavelet function is presented below:
ƞ = 1
√ !"
ƞ$# (3)
Here, parameter ω0 determines the shape and width of the wavelet function.
Therefore one may state that ω0 determines the functional relation between time scales s of the wavelet transform and frequencies f in the original signal (Koronovskii and Hramov, 2003): if ω0 =2π, then s corresponds to s=1/f. This comparison is useful in the initial phase of the investigation of the signal as it allows making assumptions of which timescale range are most adequate. According to previous research (Sitnikova et al., 2009), ω0 =2 π is the best choice for the recognition of SWD, as it provides the optimal timefrequency resolution of an ECoG signal; it facilitates the precise localization of oscillatory events in the time and frequency domains for complex signals containing multiple frequencies that vary over time, as is the case for ECoG signals.
High frequencies (30–80 Hz) appear in the ECoG during SWDs (Sitnikova et al., 2009). The wavelet power for this frequency range at eachmomentin time will show a drastic increase in power in that specific band at the very beginning of a SWD and a rapid decrease of the power at the end of a SWD.
The OSDS program for SWD detection calculates the corresponding wavelet power for a given frequency range each time that a new sample is acquired, so every 2ms. More precisely, the OSDS performs the wavelet transform on a total of 15 scales proportional to 15 frequencies. The sum of the calculated wavelet power values for each frequency is the absolute wavelet power over the frequency domain (“power over domain”—POD). The 15 scales are equally distributed between 30 and 80 Hz. Processing of additional (more than 15 scales) time scales does not significantly affect the sensitivity and precision of the algorithm, but will result in an increase of calculation time.
A flowchart of the algorithm is presented in Fig. 2. Each calculated POD value is subsequently compared to the threshold value, which should be determined for each animal individually. A value that is 2.5–3.5 times greater than the mean power of normal (=nonepileptic, background) activity can be chosen as an initial threshold.
Fig. 2. Flow chart of online seizure detection algorithm.
As soon as the POD exceeds this threshold, it is assumed that a SWD takes place; this is marked in an additional channel of the WINDAQ acquisition system. This channel consists of a digital–analog converter (DAC) output with two possible levels: high (output voltage is equal to +2.5 V) and low (output voltage is equal to −2.5 V). The output is set to “low” when the detection program starts. In case the POD exceeds the threshold value and the output is low, the latter is set to high. In case the D-A auxiliary channel is high and POD is below the threshold, the output is switched to low. This guarantees that the output of this auxiliary channel is always high during SWD and low otherwise.
short-term bursts that are not SWDs. The magnitude of these burst might be big enough to reach the preset threshold value and a false detection takes place. Moreover, these short- term POD bursts seem to be relatively common. In order to prevent these false detections, the wavelet transform is appended with a smoothing procedure.
The OSDS program smoothes POD over a window of a certain width. The smoothing window width or size directly affects speed and precision of SWD detection. The shorter the window, the less time it takes for the POD average to reach the threshold, but the probability of false detection increases. On the other hand, wider smoothing windows yields a better precision, but it takes longer to detect a SWD. The size of the smoothing window was systematically varied and it was found that, given a 500 S/s sampling rate, a window size of 400–600 points works best (acceptable speed and highest sensitivity and precision), providing a reasonable compromise between speed of SWD detection and number of errors.
Fig. 3 shows the dependence of false detections, true detections and missed SWDs on window size and threshold value as established during a 5 h ECoG recording of a representative subject. It can be inferred from the maps in Fig. 3 that there are some areas (combinations of threshold values and smoothing window sizes) for which all SWDs have been detected while the number of false detections and missed events was close or equal to zero.
It is also easy to see that these areas correspond to threshold and window size values in the range indicated above. It should be noted that the maps provide all knowledge needed for the appropriate choice of the two parameters. However it is not necessary to compute the whole surface to find the best parameters as the area of feasible window sizes does not vary much from animal to animal. It is more practical to establish the number of false detections and missed events for the chosen threshold value and to use the median value of the range as a suitable window size.
The proposed algorithm for SWD detection was implemented in such away that it was possible to run it real-time; this was feasible due to the properties of the wavelet transform.Asmentioned above, the wavelet transform allows one to observe the amount of energy belonging to a certain frequency band at a certain time. The transform is defined by (1). At first glance this function seems impractical for a fast real time implementation, as it requires the integration over an infinite time domain. However, a wavelet function is limited in time by the period in which most of energy is amassed. In other words, the value of a wavelet function outside this interval is close to zero, while inside it is sufficiently greater than that. Therefore, integration over the duration of the wavelet function can be substituted by integration over an infinite time domain without loss of precision (Koronovskii and Hramov, 2003).
In the case of wavelet analyses of the EEG, one deals with signal samples instead of a continuous function. Integration in (1) should be replaced with summation over a set of samples multiplied by a sampling increment in order to perform a wavelet transform of a time series:
, = % &ℎ( ,)!
*+,-
&.*/0120
(4)
Reasonable limits [ )34), 5"6 ] are −4 s/h and +4 s/h, respectively, where s is the timescale, h is the sampling increment, “−” and “+” signs denote the fact that, in order to perform the transform, one needs to take into account a number of samples taken prior to the one under consideration (corresponding to the moment t0) along with a number of samples thereafter.
The need for “+” samples is a drawback of the proposed technique: the point currently under consideration is always a point collected several time steps ago.
However in case of SWD detection, this delay in processing is sufficiently smaller than the characteristic length of events of interest. Considering the fact that frequencies of interest fall into 10–100 Hz range and a sampling rate of 500 s/s, one can estimate the number of points
needed to be collected after the current one as 200, which takes 400 ms. As the characteristic length of the event to be detected is more than 1 s, this computational delay should not be considered a serious issue.
The algorithm speed is determined by the programming techniques used for data processing and threshold detection. A significant speed gain can be obtained by replacing function calls for computation of wavelet function values by array referencing. This was done by shifting the signal along the fixed wavelet function rather than shifting the wavelet function along the signal. Using an array to store wavelet function values and a FIFO (first in/first out) buffer to store a part of the ECoG signal yields a dramatic increase of processing speed.
The program can be applied to prerecorded data, but the described technique can also be used for real-time fast detection of SWDs.