'Dry/wet (i.e. include partial raw signal) parameter on IIR notch filter before convolution with other filters
I have a group of scipy.signal.iirnotch filters convolving with one another and I would like each to implement independent dry/wet values for each of them. I know I can achieve a pseudo-dry/wet parameter by adding them to one another instead of performing a convolution on them but that is janky and difficult to control.
I am just at the start of my DSP learning but I haven't been able find any documentation/information on something like this so I have no idea where else to start other than poking around at the coefficients (to no avail). Here is the isolated relevant code so far:
from scipy import signal
notch_freqs = (220, 440, 880) # could be any frequencies, these are just placeholders
notch_coeffs = [signal.iirnotch(freq, BANDWIDTH, samplerate) for freq in notch_freqs]
# here would be the step in applying the dry/wet to each coefficient in notch_coeffs
# and then the convolution would happen...
def convolve_notches(): # I know this can probably be optimized but it works for now
filter_conv_a = signal.fftconvolve(*[filt[0] for filt in notch_coeffs[:2]])
filter_conv_b = signal.fftconvolve(*[filt[1] for filt in notch_coeffs[:2]])
if len(notch_coeffs) > 2:
for filt in notch_coeffs[:2]:
filter_conv_a = signal.fftconvolve(filter_conv_a, filt[0])
filter_conv_b = signal.fftconvolve(filter_conv_b, filt[1])
return filter_conv_a, filter_conv_b
# ... then apply using signal.filtfilt
This is not a real-time audio application so I'm not too concerned about timing. Rereading this, I want to clarify dry/wet; here's an ASCII representation:
Wet: 25% 50% 100%
---\ /----\ /----\ /----
\__/ \ / \ /
\_/ \ /
| |
| |
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
