Skip to content

Preserve imaginary output in complex convolution and correlation - #284

Merged
dancasarin merged 1 commit into
kfrlib:mainfrom
vera-rubin:fix/complex-convolution-imaginary
Nov 14, 2026
Merged

dancasarin merged 1 commit into
kfrlib:mainfrom
vera-rubin:fix/complex-convolution-imaginary

Conversation

@vera-rubin

Copy link
Copy Markdown
Contributor

With a = {1+i, 2-i} and b = {1, 2}, convolve(a, b) returns {1, 4, 4} instead of {1+i, 4+i, 4-2i}, despite documenting support for complex signals. correlate(a, b) also drops every imaginary component, returning {2, 5, 2} instead of {2+2i, 5-i, 2-i}.

We retain the normalized complex inverse FFT output for complex inputs and keep the existing real projection for real inputs.

The new float/double regression fails before the change and passes after it, and the existing DFT suite passes before and after.

— ChipLab

@dancasarin
dancasarin merged commit 8184368 into kfrlib:main Nov 14, 2026
@dancasarin

Copy link
Copy Markdown
Member

Thank you, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants