Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add cupyx.signal.{firfilter,firfilter_zi,firfilter2}#8052

Merged
asi1024 merged 6 commits into
cupy:mainfrom
emcastillo:add_firfilter_zi
Jan 12, 2024
Merged

Add cupyx.signal.{firfilter,firfilter_zi,firfilter2}#8052
asi1024 merged 6 commits into
cupy:mainfrom
emcastillo:add_firfilter_zi

Conversation

@emcastillo

Copy link
Copy Markdown
Member

From cuSignal non scipy API

@mergify

mergify Bot commented Dec 26, 2023

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @emcastillo? 🙏

@asi1024

asi1024 commented Dec 28, 2023

Copy link
Copy Markdown
Member

/test mini

@mergify

mergify Bot commented Dec 28, 2023

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @emcastillo? 🙏

@asi1024

asi1024 commented Dec 28, 2023

Copy link
Copy Markdown
Member

/test mini

Comment thread cupyx/signal/_filtering/_array_utils.py Outdated
be 1; the trivial dimension is not removed. (Use numpy.squeeze()
to remove trivial axes.)
"""
a = cupy.asarray(a)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a = cupy.asarray(a)

@pytest.mark.parametrize('dtype', [cupy.float32, cupy.float64])
@pytest.mark.parametrize("num_samps", [2**14, 2**18])
@pytest.mark.parametrize("filter_len", [8, 32, 128])
def test_firfilter(dtype, num_samps, filter_len):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you parametrize with pad_type: ["odd, "even", "constant"]?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pad is supported only on firfilter2 routine. I will add it there!!

Comment thread cupyx/signal/_filtering/_filtering.py Outdated
b = cupy.array(b, dtype=dtype)
x = cupy.array(x, dtype=dtype, copy=False)

out_full = cupy.apply_along_axis(lambda y: cupy.convolve(b, y), axis, x)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: fft(b) is computed in duplicate.

@asi1024

asi1024 commented Jan 1, 2024

Copy link
Copy Markdown
Member

Duplicate of cupyx.scipy.signal.lfilter, cupyx.scipy.signal.lfilter_zi and cupyx.scipy.signal.filtfilt.

@kmaehashi kmaehashi added the to-be-backported Pull-requests to be backported to stable branch label Jan 11, 2024
@asi1024

asi1024 commented Jan 12, 2024

Copy link
Copy Markdown
Member

/test mini

@asi1024 asi1024 enabled auto-merge January 12, 2024 03:51
@asi1024 asi1024 added this to the v14.0.0a1 milestone Jan 12, 2024
@asi1024 asi1024 merged commit 8bf9bf8 into cupy:main Jan 12, 2024
chainer-ci pushed a commit to chainer-ci/cupy that referenced this pull request Jan 12, 2024
Add `cupyx.signal.{firfilter,firfilter_zi,firfilter2}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:feature New features/APIs prio:medium to-be-backported Pull-requests to be backported to stable branch

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants