一种方法是使用频域最小二乘(FDLS)方法。给定一组离散时间系统频率响应的样本(复杂),以及设计者选择的滤波器阶数,FDLS方法使用线性最小二乘法优化来求解系数集(该系数直接映射到极点集)和零)的系统,其频率响应与所需响应相匹配,且总平方误差最小。
次线性离散时间系统的频率响应可以写成:N
H(ω)=H(z)|z=ejω
其中是z域中系统的传递函数。通常以有理格式编写,直接从系统的差分方程式得出:H(z)z
H(z)=∑Nk=0bkz−k1+∑Nk=1akz−k
因此,频率响应为:
H(ω)=∑Nk=0bke−jkω1+∑Nk=1ake−jkω
重新排列以上内容以获得:
∑k=0Nbke−jkω−H(ω)(1+∑k=1Nake−jkω)=0
2N+1bkakH(ω)ω
ωm∈[0,2π),m=0,1,…,M−1 (where M>2N+1, and often M≫2N+1). For each frequency, substitute the corresponding value of ωk into the above equation to yield:
∑k=0Nbke−jkωk−H(ωk)(1+∑k=1Nake−jkωk)=0
The values H(ωk) are obtained by sampling the desired frequency response at the chosen frequencies ωk. After generating the system of linear equations, the least-squares solution for the system's coefficients bk and ak (and therefore its poles and zeros) is easily obtained. If you substitute those coefficients back into the equation for H(ω) shown above, it should (hopefully) yield a function that is close to the template frequency response that you started with.
This technique has a few advantages:
Any arbitrary complex (magnitude and phase) frequency response can be used as the template. If you only have a magnitude constraint, you could just pick a phase response, such as linear phase.
It can be used to design both FIR and IIR filters; for an FIR realization, just remove the ak coefficients from the above.
The technique is very simple to implement and is easily parameterizable based upon the desired system order.
While there may not be a good way to estimate a priori what the required system order is to meet your design constraints, it is simple to iteratively increase the order N until some selected error metric is met (such as peak error, total squared error, or deviation within a specific band).
You could extend this method a bit to use weighted least-squares optimization if needed; this would allow you to specify regions of the frequency response whose approximation error is weighted more than others. This allows you to more tightly control passband/stopband areas while allowing more slop in "don't-care" areas.