import numpy as np
import matplotlib.pyplot as plt
from meeglet import define_frequencies, define_wavelets, plot_wavelet_family
Define Wavelets
In this tutorial we present the meeglet for creating wavelets API for creating wavelets.
For a deep-dive into mathematical background and comparison against alternative definitions, please see Morlet wavelet definition
The following examples illustrate default settings and options to change smoothing, number of wavelets, frequency shifts an other options.
Default settings
= define_frequencies(
foi, sigma_time, sigma_freq, bw_oct, qt =1, foi_end=32, bw_oct=0.5, delta_oct=0.5 / 4.0
foi_start
)
= define_wavelets(
wavelets =foi, sigma_time=sigma_time, sfreq=250., density='oct'
foi
)
=250);
plot_wavelet_family(wavelets, foi, fmax12, 8) plt.gcf().set_size_inches(
Fewer wavelets
= define_frequencies(
foi, sigma_time, sigma_freq, bw_oct, qt =1, foi_end=32, bw_oct=0.5, delta_oct=0.5
foi_start
)
= define_wavelets(
wavelets =foi, sigma_time=sigma_time, sfreq=250., density='oct'
foi
)
=250);
plot_wavelet_family(wavelets, foi, fmax12, 8) plt.gcf().set_size_inches(
Fewer wavelets, narrower width
= define_frequencies(
foi, sigma_time, sigma_freq, bw_oct, qt =1, foi_end=32, bw_oct=0.25, delta_oct=0.5
foi_start
)
= define_wavelets(
wavelets =foi, sigma_time=sigma_time, sfreq=250., density='oct'
foi
)
=250);
plot_wavelet_family(wavelets, foi, fmax12, 8) plt.gcf().set_size_inches(
Fewer wavelets, clip kernel
= define_frequencies(
foi, sigma_time, sigma_freq, bw_oct, qt =1, foi_end=32, bw_oct=0.25, delta_oct=0.5
foi_start
)
= define_wavelets(
wavelets =foi, sigma_time=sigma_time, sfreq=250., density='oct',
foi=2
kernel_width
)
=250);
plot_wavelet_family(wavelets, foi, fmax12, 8) plt.gcf().set_size_inches(
Fewer wavelets, shift 150%
= define_frequencies(
foi, sigma_time, sigma_freq, bw_oct, qt =1, foi_end=32, bw_oct=0.25, delta_oct=0.5,
foi_start=1.5
freq_shift_factor
)
= define_wavelets(
wavelets =foi, sigma_time=sigma_time, sfreq=250.,
foi
)
=250);
plot_wavelet_family(wavelets, foi, fmax12, 8) plt.gcf().set_size_inches(