PureBytes Links
Trading Reference Links
|
<SPAN
class=962565704-10022004>I posted this without trying the IIR4 attempt at all
first, and sure enough, its first line should read:
<SPAN
class=962565704-10022004>
for(i = 4; i <
BarCount; i++) {
<SPAN
class=962565704-10022004>
<SPAN
class=962565704-10022004><SPAN
class=962565704-10022004>Dave
<BLOCKQUOTE
>Here's
the formulca for a 2nd order IIR filter, as implemented by Tomasz inthe
library:// f0, f1, f2 are filter coefficients// you can try 0.2,
1.4, -0.6function IIR2(input, f0, f1, f2)
{ local
result; result[0] =
input[0]; result[1] =
input[1]; for(i = 2; i < BarCount; i++)
{ result[i]
= f0 *
input[i] + f1
* result[i - 1] +
f2 * result[i -
2]; }
return result;}Questions:- If it's possible, can
someone explain the meaning of the 3 coeficients, inplain english? To put
it differently, what do you do to to change the cutofffrequency, without
changing gain or filter Q? What do you do to change the Qalone?-
In my brief research on the net, I found some applets for designing
IIRfilters, ie, coming up with coefficient values for a given response
spec.However, I don't understand the relationship between the coefficients
theyuse and those above. For example, the applet here: <A
href="">http://www.dsptutor.freeuk.com/IIRFilterDesign/IIRFilterDesign.htmlGives
results like this: Butterworth IIR
filter Filter type:
LP Passband: 0 - .05
Hz Order:
2
Coefficients: a[0] = 2.467633E-8
b[0] = 1.0 a[1] = 4.935266E-8
b[1] = -1.9999444 a[2] =
2.467633E-8 b[2] = 0.99994445- By ignorant analogy, it
would seem that a 4th order IIR filter might bebuilt as below; can anyone
confirm?function IIR4(input, f0, f1, f2, f3, f4)
{ local
result; result[0] =
input[0]; result[1] =
input[1]; result[2] =
input[2]; result[3] =
input[3]; for(i = 2; i < BarCount; i++)
{ result[i]
= f0 *
input[i] + f1
* result[i - 1] +
f2 * result[i - 2]
+ f3 *
result[i - 3] +
f4 * result[i -
4]; }
return result;}Thanks,Dave Merrill
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|