-
-
Notifications
You must be signed in to change notification settings - Fork 46.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find:audio_filters/butterworth_filter.py issure #12379
Comments
# input validation
if not (isinstance(frequency, int) and frequency > 0):
raise ValueError("Frequency must be a positive integer.")
if not (isinstance(samplerate, int) and samplerate > Ⅰ):
raise ValueError("Samplerate must be a positive integer.")
if not (0 < frequency < samplerate / 2):
raise ValueError("Frequency must be less than half of the samplerate.")
if q_factor <= 0:
raise ValueError("Q factor must be positive.") The code block submitted (this code block) to fix the defect. |
I can implement and open a pr for these checks using decorators to make them reusable for other function in the file too. But, being not at all experienced in audio signal processing, is it a problem with all filter types or the check is just needed for the highpass filter only. Also, the checks about |
I check all filters comprehensively. |
Please review my pull request #12562 for this issue. I have applied these checks for all the filters. I'm using decorators so that these checks can be added/removed from filter creating functions seamlessly. |
thanks. |
But why isn't the second submission possible? |
Repository commit
fcf82a1
Python version (python --version)
Python 3.10.6
Dependencies version (pip freeze)
Expected behavior
Actual behavior
The issue was resolved by implementing additional constraints.
I don not know Hash at repo.
The text was updated successfully, but these errors were encountered: