# [PyWavelets](https://pywavelets.readthedocs.io/en/latest/) -- Wavelet Transforms in Python
## The goal
How do we do wavelet transforms under Python?
Questions to [David Rotermund](mailto:davrot@uni-bremen.de)
You might want to read: [A Practical Guide to Wavelet Analysis](https://paos.colorado.edu/research/wavelets/) -> [PDF](https://paos.colorado.edu/research/wavelets/bams_79_01_0061.pdf)
## Building a frequency scale for the complex Morlet wavelet
We don't want to waste computations power. Thus we want to put the frequency band for higher frequencies further away than for smaller frequencies. Thus we will use a$2^{N \cdot Scale}$ scale.
```python
import numpy as np
import matplotlib.pyplot as plt
import pywt
number_of_frequences: int = 20 # Number of frequency bands
## Cone of influence for the complex Morlet wavelet
At the edges of the time series, the wavelet is dangling out of the allowed time axis. Thus these values are nonsense and need to be removed. The size of the wavelet is connected to its scale, hence for different scales the bad zone has different sizes. For the complex Morlet wavelet the number of samples are defined by the equation $\sqrt(2) \cdot scale$ ([A Practical Guide to Wavelet Analysis](https://paos.colorado.edu/research/wavelets/) -> [PDF](https://paos.colorado.edu/research/wavelets/bams_79_01_0061.pdf) ). Which looks like this: