electronics.circular_convolution¶
Circular convolution, also known as cyclic convolution, is a special case of periodic convolution, which is the convolution of two periodic functions that have the same period. Periodic convolution arises, for example, in the context of the discrete-time Fourier transform (DTFT). In particular, the DTFT of the product of two discrete sequences is the periodic convolution of the DTFTs of the individual sequences. And each DTFT is a periodic summation of a continuous Fourier transform function.
Source: https://en.wikipedia.org/wiki/Circular_convolution
Classes¶
This class stores the first and second signal and performs the circular convolution |
Module Contents¶
- class electronics.circular_convolution.CircularConvolution¶
This class stores the first and second signal and performs the circular convolution
- circular_convolution() list[float] ¶
This function performs the circular convolution of the first and second signal using matrix method
Usage: >>> convolution = CircularConvolution() >>> convolution.circular_convolution() [10.0, 10.0, 6.0, 14.0]
>>> convolution.first_signal = [0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6] >>> convolution.second_signal = [0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5] >>> convolution.circular_convolution() [5.2, 6.0, 6.48, 6.64, 6.48, 6.0, 5.2, 4.08]
>>> convolution.first_signal = [-1, 1, 2, -2] >>> convolution.second_signal = [0.5, 1, -1, 2, 0.75] >>> convolution.circular_convolution() [6.25, -3.0, 1.5, -2.0, -2.75]
>>> convolution.first_signal = [1, -1, 2, 3, -1] >>> convolution.second_signal = [1, 2, 3] >>> convolution.circular_convolution() [8.0, -2.0, 3.0, 4.0, 11.0]
- first_signal¶
- second_signal = [1, 2, 3, 4]¶