The problem as posed in the question appears to have no closed-form solution. As mentioned in the question and shown in other answers, the result can be developed into a series, which can be accomplished by any symbolic math tool such as Mathematica. However, the terms become quite complicated and ugly, and it is unclear how good the approximation is when we include terms up to third order. Since we can't get an exact formula, it might be better to compute the solution numerically, which, unlike with the approximation, will give an (almost) exact result.
However, this is not what my answer is about. I suggest a different route which gives an exact solution by changing the problem formulation. After thinking about it for a while it turns out that it is the specification of the center frequency ω0 and the specification of the bandwidth as a ratio (or, equivalently, in octaves) which causes the mathematical intractability. There are two ways out of the dilemma:
- specify the bandwidth of the discrete-time filter as a difference of frequencies Δω=ω2−ω1, where ω1 and ω2 are the lower and upper band edges of the discrete-time filter, respectively.
- prescribe the ratio ω2/ω1, and instead of ω0 prescribe one of the two edge frequencies ω1 or ω2.
In both cases, a simple analytical solution is possible. Since it is desirable to prescribe the bandwidth of the discrete-time filter as a ratio (or, equivalently, in octaves), I'll describe the second approach.
Let's define the edge frequencies Ω1 and Ω2 of the continuous-time filter by
|H(jΩ1)|2=|H(jΩ2)|2=12(1)
with Ω2>Ω1, where H(s) is the transfer function of a second-order band pass filter:
H(s)=ΔΩss2+ΔΩs+Ω20(2)
with ΔΩ=Ω2−Ω1, and Ω20=Ω1Ω2. Note that H(jΩ0)=1, and |H(jΩ)|<1 for Ω≠Ω0.
We use the bilinear transform to map the edge frequencies ω1 and ω2 of the discrete-time filter to the edge frequencies Ω1 and Ω2 of the continuous-time filter. Without loss of generality we can choose Ω1=1. For our purposes the bilinear transform then takes the form
s=1tan(ω12)z−1z+1(3)
corresponding to the following relationship between continuous-time and discrete-time frequencies:
Ω=tan(ω2)tan(ω12)(4)
From (4) we obtain Ω2 by setting ω=ω2. With Ω1=1 and Ω2 computed from (4), we obtain the transfer function of the analog prototype filter from (2). Applying the bilinear transform (3), we get the transfer function of the discrete-time band pass filter:
Hd(z)=g⋅z2−1z2+az+b(5)
with
gabc=ΔΩc1+ΔΩc+Ω20c2=2(Ω20c2−1)1+ΔΩc+Ω20c2=1−ΔΩc+Ω20c21+ΔΩc+Ω20c2=tan(ω12)(6)
Summary:
The bandwidth of the discrete-time filter can be specified in octaves (or, generally, as a ratio), and the parameters of the analog prototype filter can be computed exactly, such that the specified bandwidth is achieved. Instead of the center frequency ω0, we specify the band edges ω1 and ω2. The center frequency defined by |Hd(ejω0)|=1 is an outcome of the design.
The necessary steps are as follows:
- Specify the desired ratio of band edges ω2/ω1, and one of the band edges (which is of course equivalent to simply specifying ω1 and ω2).
- Choose Ω1=1 and determine Ω2 from (4). Compute ΔΩ=Ω2−Ω1 and Ω20=Ω1Ω2 of the analog prototype filter (2).
- Evaluate the constants (6) to obtain the discrete-time transfer function (5).
Note that with the more common approach where ω0 and Δω=ω2−ω1 are specified, the actual band edges ω1 and ω2 are an outcome of the design process. In the proposed solution, the band edges can be specified and ω0 is an outcome of the design process. The advantage of the latter approach is that the bandwidth can be specified in octaves and the solution is exact, i.e., the resulting filter has exactly the specified bandwidth in octaves.
Example:
Let's specify a bandwidth of one octave, and we choose the lower band edge as ω1=0.2π. This gives an upper band edge ω2=2ω1=0.4π. The band edges of the analog prototype filter are Ω1=1 and from (4) (with ω=ω2) Ω2=2.2361. This gives ΔΩ=Ω2−Ω1=1.2361 and Ω20=Ω1Ω2=2.2361. With (6) we get for the discrete-time transfer function (5)
Hd(z)=0.24524⋅z2−1z2−0.93294z+0.50953
which achieves exactly a bandwidth of 1 octave, and the specified band edges, as shown in the figure below:
Numerical solution of the original problem:
From the comments I understand that it is important to be able to exactly specify the center frequency ω0 for which |Hd(ejω0)|=1 is satisfied. As mentioned before it is not possible to get an exact closed-form solution, and a series development produces quite unwieldy expressions.
For the sake of clarity I would like to summarize the possible options with their advantages and disadvantages:
- specify the desired bandwidth as a frequency difference Δω=ω2−ω1, and specify ω0; in this case a simple closed-form solution is possible.
- specify the band edges ω1 and ω2 (or, equivalently, the bandwidth in octaves, and one of the band edges); this also leads to a simple closed-form solution, as explained above, but the center frequency ω0 is an outcome of the design and cannot be specified.
- specify the desired bandwidth in octaves and the center frequency ω0 (as asked in the question); no closed form solution is possible, nor is there (for the time being) any simple approximation. For this reason I think it's desirable to have a simple and efficient method for obtaining a numerical solution. This is what is explained below.
When ω0 is specified we use a form of the bilinear transform with a normalization constant that is different from the one used in (3) and (4):
Ω=tan(ω2)tan(ω02)(7)
We define Ω0=1. Denote the specified ratio of band edges of the discrete-time filter as
r=ω2ω1(8)
With c=tan(ω0/2) we get from (7) and (8)
r=arctan(cΩ2)arctan(cΩ1)(9)
With Ω1Ω2=Ω20=1, (9) can be rewritten in the following form:
f(Ω1)=rarctan(cΩ1)−arctan(cΩ1)=0(10)
For a given value of r this equation can be solved for Ω1 with a few Newton iterations. For this we need the derivative of f(Ω1):
f′(Ω1)=c(r1+c2Ω21+1c2+Ω21)(11)
With Ω0=1, we know that Ω1 must be in the interval (0,1). Even though it's possible to come up with smarter initial solutions, it turns out that the initial guess Ω(0)1=0.1 works well for most specs, and will result in very accurate solutions after only 4 iterations of Newton's method:
Ω(n+1)1=Ω(n)1−f(Ω(n)1)f′(Ω(n)1)(12)
With Ω1 obtained with a few iterations of (12) we can determine Ω2=1/Ω1 and ΔΩ=Ω2−Ω1, and and we use (5) and (6) to compute the coefficients of the discrete-time filter. Note that the constant c is now given by c=tan(ω0/2).
Example 1:
Let's specify ω0=0.6π and a bandwidth of 0.5 octaves. This corresponds to a ratio r=ω2/ω1=20.5=2–√=1.4142. With an initial guess of Ω1=0.1, 4 iterations of Newton's method resulted in a solution Ω1=0.71, from which the coefficients of the discrete-time can be computed as explained above. The figure below shows the result:
The filter was calculated with this Matlab/Octave script:
% specifications
bw = 0.5; % desired bandwidth in octaves
w0 = .6*pi; % resonant frequency
r = 2^(bw); % ratio of band edges
W1 = .1; % initial guess (works for most specs)
Nit = 4; % # Newton iterations
c = tan(w0/2);
% Newton
for i = 1:Nit,
f = r*atan(c*W1) - atan(c/W1);
fp = c * ( r/(1+c^2*W1^2) + 1/(c^2+W1^2) );
W1 = W1 - f/fp
end
W1 = abs(W1);
if (W1 >= 1), error('Failed to converge. Reduce value of initial guess.'); end
W2 = 1/W1;
dW = W2 - W1;
% discrete-time filter
scale = 1 + dW*c + W1*W2*c^2;
b = ( dW*c/scale) * [1,0,-1];
a = [1, 2*(W1*W2*c^2-1)/scale, (1-dW*c+W1*W2*c^2)/scale ];
Example 2:
I add another example to show that this method can also deal with specifications for which most approximations will give non-sensical results. This is often the case when the desired bandwidth and the resonant frequency are both large. Let's design a filter with ω0=0.95π and bw=4 octaves. Four iterations of Newton's method with an initial guess Ω(0)1=0.1 result in a final value of Ω1=0.00775, i.e., in a bandwidth of the analog prototype of log2(Ω2/Ω1)=log2(1/Ω21)≈14 octaves. The corresponding discrete-time filter has the following coefficients and its frequency response is shown in the plot below:
b = 0.90986*[1,0,-1];
a = [1.00000 0.17806 -0.81972];
The resulting half power band edges are ω1=0.062476π and ω2=0.999612π, which are indeed exactly 4 octaves (i.e., a factor of 16) apart.