Ch 13: Complex Morlet Wavelets and Extracting Power and Phase
This chapter discusses Complex Morlet Wavelets, how they extend on Morlet Wavelets from last chapter to extract phase and power information, and mechanisms of imaginary numbers to accomplish this. Also covers some practical advise on using them.
13.1 The Wavelet Complex
Complex Morlet Wavelets are needed to to extract power and phase information from EEG data. They are called complex because they involve complex numbers (IE they use imaginary numbers). This means the complex wavelet occupies 3 dimensions (real numbers, imaginary numbers, and time).
Think of this as a corkscrew going through time (with the x and y plane the corkscrew rotates on being the real and imaginary axis).
Before this point, with non-complex Morlet wavelets, we did not see the imaginary axis due simpler equations used, but also since we only showed 2D views for the data. Arguably you can do those projections of this 3D spiral onto 2D planes as well. (below are 2D plots from different sides of the above corkscrew)
13.2 Imagining the Imaginary
Imaginary numbers are denoted with i (or sometimes j ), and represent the square root of negative one. They are often scaled by a scalar (For example: 3i ). When combined with a non-imaginary number (they cannot be added directly), we end up with a 2 number expression, such as 6 + 3i . This expression is known as a complex number.
Be sure to practice and understand the concept of imaginary numbers before going further, otherwise you WILL get lost!
A good overview (that also touches on details on the next section) can be found here
13.3 Rectangular and Polar Notation and the Complex Plane
Usually when we plot graphs, we do it over perpendicular axes of X and Y. This notation is known as the Cartesian Notation. However, another notation would be Polar Notation, which instead of XY uses r (or M), being the radius of an arc/circle, and θ (theta), being the angle in radians of the segment from the starting point (typically directly to the right). Polar notation is often a lot better at describing properties of frequency band specific activity.
Converting back and forth between the 2 notations can be done trivially with basic geometry (Pythagorean theorem and tangent). In the below example, we convert a complex number from the Cartesian Notation to Polar. Can you figure out how the below numbers were calculated?
Answer
M = sqrt( (x2 + y2 ) = sqrt( (4)2 + (-8)2 ) = 8.9443
θ -> tan(θ) = Opposite / Adjacent -> θ = tan-1(-8 / 4) = -1.107
More reading here (just remember we use radians, not degrees when doing data analysis!)
13.4 Euler's Formula
Euler's Formula allows us to tie everything above together, as it allows representing complex numbers as points on a circle.
e is the natural number, which is equal to 2.718.... (continues forever...). In the context of EEG data processing, Euler's Formula allows conveying complex numbers as points on a circle. As per the above equations, 4 - 8i can be rewritten as 8.9443e-1.107i
The other thing the Euler Formula tells us is that the real part output is produced by the cosine, while the imaginary part is produced by the sine component. Further more, as per rules of trigonometry, the difference between a sine wave and a cosine wave is a quarter of a cycle (π / 2) . In 3D space, this manifests as a quarter counterclockwise rotation in complex space (going from real axis to imaginary axis). This is the property responsible for getting phase (and power) information using a complex wavelet.
As per the previous chapter, the real-value Morlet Wavelet equation comes from multiplying a sine wave by a Gaussian. with a complex Morlet wavelet (CMW) we repeat the process but use a complex sine wave instead.
(note the θ -> 2πft substitution)
13.5 Euler's Formula and the Result of Complex Wavelet Convolution
In a non-complex wavelet, the dot product between a wavelet and a one-cycle sine wave could be negative, zero, or positive, which depended on the shift of relative phase between the signal and kernel, which is a problem. Complex wavelets resolve this, as the dot product of a complex Morlet and signal is a complex number that can be represented in complex space, in this case we can do it in Polar notation.
If this was just a non-complex Morlet, all that we would be seeing is the projection of the vector onto the X axis (which as discussed before is the real component). Ergo the 3rd example would return 0, even obviously we should be seeing a result. However, complex Morlet wavelets, thanks to that imaginary sine component, still does return something. As the real cosign and imaginary sine components are always π / 2, there is no section in which aligning the phase in certain ways causes you to lose information.
From the polar chart representation, we can actually deduce multiple things:
- The projection of the ray onto the real (X) axis is the bandpass'd signal
- This is the same as just doing the non-complex wavelet
- You can technically also do this by projecting on the Imaginary (Y) axis, but this isn't common in EEG analysis
- The length of the ray is the Amplitude (similarity between the kernel and signal). Squaring this number results in the instantaneous power at that point in time at the peak frequency of the wavelet.
- In the case of complex numbers as here, this is the same by multiplying the imaginary components by their conjugate. This matters for analysis since this is considerably faster to compute
- The angle of the vector (with respect to positive X) is the estimate of the phase angle at that point of time corresponding to the center of the wavelet at its peak frequency.