From: kotlyara on
Greetings to everything, I ask to forgive me for my bad English. I from
Ukraine
Question at me such.
In chapter 19 EQUATION 19-7 Band-pass filter shows calculation of
factors.

a0 = 1-k
a1 = 2 (k-r) cos (2*pi*f)
a2=R^2-k
b1=2*R*cos (2*pi*f)
b2 =-R^2

k = (1-2*R*cos (2*pi*f) +R^2) / (2-2*cos (2*pi*f))
R=1-3*BW

The entrance data at me such:
BW = 0.005
f = 25/200 = 0,125

At such data factors half-scientists in Excel

a0 = 0,065397524
a1 = 0,013579951288
a2 =-0,078977476
b1 = 1,308147545
b2 =-0,855625

Has received the same factors on dspic33 on the assembler

a0 = 0,065383911 An error in percentage =-0,020820448 %
a1 = 0,013565063 An error in percentage =-0,10975114 %
a2 =-0,078964233 An error in percentage =-0,016769929 %
b1 = 1,308197021 An error in percentage = 0,003782021 %
b2 =-0,855651855 An error in percentage = 0,003138598 %

At modelling I receive that the output of the filter at individual step
influence on an input is raised and comes in full chaos already after 100
iterations. Prompt please in what the reason, I think accuracy of
calculations suffices, I think the question in a correctness of formulas
can





From: Greg Berchin on
On May 7, 7:16 am, "kotlyara" <kotly...(a)mail.ru> wrote:

> Greetings to everything, I ask to forgive me for my bad English. I
> from Ukraine

Welcome. I hope that we can help you.

> a0 = 0,065397524
> a1 = 0,013579951288
> a2 =-0,078977476
> b1 = 1,308147545
> b2 =-0,855625

If your filter transfer function is:

a0 + a1z^-1 + a2z^-2
--------------------
1 + b1z^-1 + b2z^-2

then you have an unstable filter:

roots([ 1 1.3081475745 -0.855625 ]) =
-1.78696280174681 <-- outside the unit circle
0.478815227246812

Should your denominator coefficients be [ 1 -1.3081475745 0.855625 ]?

roots([ 1 -1.3081475745 0.855625 ]) =
0.65407378725 + 0.654073757945113i
0.65407378725 - 0.654073757945113i

Also check for the same problem in the numerator coefficients.

-- Greg