DSP.jl
DSP.jl copied to clipboard
Add FFT convolution kernels
This is a draft for adding FFT convolution kernels (that are also plans), which are useful for repeated convolutions. A lot has been adapted from the code here, courtesy of @JanJereczek Here's what I have done so far:
- created an abstract type for FFT convolution kernels tentatively named
FFTConvKernel, subtypesR/CFFTConvKernel - working code for real and complex FFT convolution kernels and
Array, FFTW flag defaults to FFTW.MEASURE - in the process, found that we don't check if the output indices are valid (i.e.
out[output_indices]doesn't throw) before doing work except for:direct, so I added that. Don't remember if we have discussed this before, so left it in just in case - IIUC the kernel/plans can be reused for smaller
x, maybe larger depending onnffts - not very tested, will add tests later if the feature is wanted
A typical workflow goes like this:
- Calculate
outsize, the size of the intended outputsize(out) .+ size(ker) .- 1 - Create kernel with
RFFTConvKernelorCFFTConvKernel(kernel, outsize) - Run something like
conv!(out[i], arrs[i], kernel)in a loop
Feedback would be much appreciated
Codecov Report
:x: Patch coverage is 15.21739% with 39 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 96.98%. Comparing base (7fc3842) to head (0aafe1a).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/dspbase.jl | 15.21% | 39 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #638 +/- ##
==========================================
- Coverage 98.13% 96.98% -1.16%
==========================================
Files 19 19
Lines 3277 3320 +43
==========================================
+ Hits 3216 3220 +4
- Misses 61 100 +39
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.