Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

[FEA] Investigate Matlab-IIR Filter Design - Butterworth and more! #559

Open
GBZH opened this issue Mar 29, 2023 · 2 comments
Open

[FEA] Investigate Matlab-IIR Filter Design - Butterworth and more! #559

GBZH opened this issue Mar 29, 2023 · 2 comments
Assignees
Labels
feature request New feature or request

Comments

@GBZH
Copy link

GBZH commented Mar 29, 2023

Describe the bug
Running code snippets from the RAPIDS documentation page https://docs.rapids.ai/api/cusignal/nightly/api.html#cusignal.windows.windows.hann returns the following error message :
AttributeError: module 'cusignal' has no attribute 'butter'

Steps/Code to reproduce bug
import cusignal import cupy as cp import matplotlib.pyplot as plt

`fs = 10e3
N = 1e5
amp = 20
freq = 1234.0
noise_power = 0.001 * fs / 2
time = cp.arange(N) / fs
b, a = cusignal.butter(2, 0.25, 'low')
x = cp.random.normal(scale=cp.sqrt(noise_power), size=time.shape)

lfilter not implemented in cuSignal

y = cusignal.lfilter(b, a, x)
x += ampcp.sin(2cp.pifreqtime)
y += cp.random.normal(scale=0.1*cp.sqrt(noise_power), size=time.shape)`

Expected behavior
The Butterwirth filter seems to have been removed from a previous version in the nightly distribution of RAPIDS (23-04) that I have just installed.

Environment details (please complete the following information):

  • Environment location: Ubuntu 22.04 LTS
  • Method of cuSignal install: conda 23.3.0
  • Code snippet ran from code (VSCode) in a Jupyter notebook

Additional context
Add any other context about the problem here.

@GBZH GBZH added ? - Needs Triage Need team to review and classify bug Something isn't working labels Mar 29, 2023
@awthomp awthomp self-assigned this Mar 31, 2023
@awthomp
Copy link
Member

awthomp commented Mar 31, 2023

Hi @GBZH

Thanks for using cusignal and for submitting this bug report. We haven't implemented many of the IIR filter design tools, including the butterworth filter. This is a little confusing because we have, in our coherence function, cusignal.butter referenced in the documentation. We'll fix this.

We'll also look into the pros/cons of implementing some of these IIR filters in cuSignal, but in the meantime, you can always generate the filter weights with scipy.signal and move them to GPU with cp.asarray().

Are you okay if I re-name this BUG report to a FEA request and start a thread on what's needed to implement more IIR filtering in cusignal?

@awthomp awthomp added feature request New feature or request and removed bug Something isn't working ? - Needs Triage Need team to review and classify labels Mar 31, 2023
@GBZH
Copy link
Author

GBZH commented Mar 31, 2023 via email

@awthomp awthomp changed the title [BUG] AttributeError: module 'cusignal' has no attribute 'butter' [FEA] Investigate Matlab-IIR Filter Design - Butterworth and more! Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants