This repo has rtl and scripts for wavelet transform targeting a stream of 8-bit inputs for submission with the MPW6 shuttle as part of the Zero to ASIC Course.
A wavelet transform is like a fourier transform, but has some very advantageous properties ([see this readme section for more details](#Some Interesting Properties)).
For usage details about the transform see the following sections.
- Set up 8-bits on 8 gpios (the
i_value
inputs). - "clock-in" these values by creating a rising edge of the
i_data_clk
signal.
NOTE: all filters complete the computation after one clock cycle.
- Set
o_select_output_channel
gpios to desired filter for readout - Wait a couple cycles (crossing clock domains)
- Read the 8-bits (in parallel) from
o_multiplexed_wavelet_out
Scaling up to cover a larger range of input frequencies involves:
- In
wavelet_transform
.v: add new fir module with the parameters fromWT.py
(see next section) - In
wavelet_transform
.v: incrementingTOTAL_FILTERS
parameter - In
wavelet_transform
.v: update theTOTAL_TAPS
parameter (# bits in largest filter)
To help with the math of scaling up the transform, use the following python script located at the follwing path:
.
└── wavelet_transform
└── py
└── WT.py
Change the parameters for generating the new Wavelet_Array
object.
For example increasing from the default 8 filters to 16:
wa = Wavelet_Array(base_num_elem=3, max_wavelet_order=16)
Next, print the filter element values in either decimal or hex (two's complement) representation:
wa.print_all_filters() # decimal representation
wa.print_all_filters_hex() # hex representation
The 1-D wavelet transform can be seen as an alternative to the FT transform on time-series data.
Essentially it's a convolution of a small wave or 'wavelet'.
Typically, the shape of the wavelet is the same for each of ranges of interest, just scaled, making construction of the transform two steps:
- Base wavelet equation (this repo uses the Ricker Wavelet family of wavelets)
- Scaling of the wavelet to larger size (smaller frequencies)
With wavelet's one sees not just the intensity of frequency, but whether high or low at that point in time.
This is very interesting to monitoring and especially extrapolating patterns in data.
Unlike the fft (which uses same time scale for multiple frequencies), each frequency range has very high temporal localization.
This also means different resolution between different frequencies, higher frequencies will have higher temporal resolution.
Will be better or at par with temporal resolution than the fourier frequency transform.
This project was made as part of the Zero to ASIC Course!
This project is licensed under Apache 2