# Is there a library for a generic convolution function?

**URL:** <https://discourse.julialang.org/t/is-there-a-library-for-a-generic-convolution-function/110329>\
**Category:** General Usage\
**Tags:** bigfloat, fft, convolution\
**Created:** [February 17, 2024, 1:34am UTC](https://discourse.julialang.org/t/is-there-a-library-for-a-generic-convolution-function/110329 "2024-02-17T01:34:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AwesomeQuest](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/awesomequest/32/38910_2.png) [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Post date:** [February 17, 2024, 1:34am UTC](https://discourse.julialang.org/t/is-there-a-library-for-a-generic-convolution-function/110329/1 "2024-02-17T01:34:17Z")

</div>

I need to do a convolution of `BigInt`s and `DSP` says that `BigFloat` isn’t supported when I try.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 17, 2024, 2:13am UTC](https://discourse.julialang.org/t/is-there-a-library-for-a-generic-convolution-function/110329/2 "2024-02-17T02:13:23Z")

</div>

> [@AwesomeQuest](#):
>
> `DSP` says that `BigFloat` isn’t supported when I try.

You just need to load a package implementing a `BigFloat` FFT, and then `DSP.conv` will work. For example, using GenericFFT.jl:

```julia
julia> using DSP, GenericFFT

julia> setprecision(6); # lower the precision to reduce the amount of output below

julia> u, v = [rand(BigFloat, 10) for _=1:2]
2-element Vector{Vector{BigFloat}}:
 [0.0156, 0.422, 0.812, 0.438, 0.125, 0.984, 0.109, 0.875, 0.812, 0.625]
 [0.109, 0.5, 0.719, 0.797, 0.422, 0.0312, 0.938, 0.156, 0.469, 0.688]

julia> DSP.conv(u,v)
19-element Vector{BigFloat}:
 -0.119
  0.0298
  0.484
  0.766
  1.75
  1.19
  1.53
  1.59
  2.31
  2.38
  2.5
  2.88
  1.25
  1.69
  1.59
  1.03
  1.28
  0.688
  0.594

```
