cconv
Circular convolution modulo n.
| Library |
|
Arguments
Examples
Circular convolution and linear convolution
Details
We will generate two signals of different lengths. Let’s compare their circular and linear convolutions. Use the value of the argument n by default.
import EngeeDSP.Functions: cconv, conv, norm
a = [1 2 -1 1]
b = [1 1 2 1 2 2 1 1]
c = cconv(a, b) # Circular convolution
cref = conv(a, b) # Linear convolution
dif = norm(c - cref)
3.770748636149785e-15
The resulting norm is almost zero, which shows that both convolutions give the same result with machine accuracy.