I have been working on audio digital signal processing. I wish to design a digital filter. I have attached the screenshot. Of course, I can design band pass or bandstop filter using FIR/IIR filters, but what is special about this filter is that it controls low, mid and high frequencies. So my question, how can I design such filter in python
manually with this magnitude response as shown. Please help. I dont know how do I limit the filter to those values.
Another alternartive could be to such filter in MATLAB's filterdesigner tool and export the coefficients to python. But again, I dont know how to design such filter there. So please help.
There are a number of design options to match more arbitrary frequency band specifications than the simple lowpass/bandpass/bandstop/hipass classification. The most common ones are :
The first two are readily available from
scipy.signalasscipy.firlsandscipy.remezrespectively, whereas the third can be done by taking the inverse FFT of the sampled frequency response curve.Sample implementation using the least-square method:
Sample implementation using the Parks-McClellan algorithm:
Sample implementation using the frequency sampling method:
For sake of illustration, using the following set of parameters
would yield the corresponding designs:
Note that if your frequency specification curves are do-not-exceed values (rather than nominal ones), you can still use the above methods in an iterative fashion each time tweaking the
bandsanddesiredparameters until you converge to an acceptable response. With the initial set of parameters above, using the least-squares method, you could end up with tweaked parameters such aswith the corresponding response: