Created
January 9, 2024 16:40
-
-
Save adamnemecek/0317b9ede0a4b6726ca144c4d63c6bd0 to your computer and use it in GitHub Desktop.
convolution == superposition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DSP: conv | |
@assert conv([1, 0, 0], 1:4) .+ # [1, 2, 3, 4, 0, 0] | |
conv([0, 2, 0], 1:4) .+ # [0, 2, 4, 6, 8, 0] | |
conv([0, 0, 3], 1:4) == # [0, 0, 3, 6, 9, 12] | |
conv([1, 2, 3], 1:4) # [1, 4, 10, 16, 17, 12] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment