hopefully. but yes, i agree - i would expect something like that, too.Z1202 wrote:I would further assume, that should you simply connect an integrator to the bandpass output, the resulting lowpass signal might "drift" around DC, whereas inside the filter the feedback will probably take care of the precision losses.
Book: The Art of VA Filter Design 2.1.2
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4292 posts since 8 Mar, 2004 from Berlin, Germany
- KVRAF
- 12555 posts since 7 Dec, 2004
you're just integrating the differentiated value.
how is it so hard to believe this:
s - s[i-1] + s[i-1] = s ?
differentiation:
d = s - a;
a = s;
integration:
b += d;
b == s;
the problem of drift due to error is solved by the feedback, which can never be absolutely zero.
how is it so hard to believe this:
s - s[i-1] + s[i-1] = s ?
differentiation:
d = s - a;
a = s;
integration:
b += d;
b == s;
the problem of drift due to error is solved by the feedback, which can never be absolutely zero.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRAF
- Topic Starter
- 1607 posts since 12 Apr, 2002
Well, suppose you have a DC input x=const, and BP=0 and LP!=x, then you immediately get the signal x-LP at the input of the first integrator. There you goRobin from www.rs-met.com wrote:hopefully. but yes, i agree - i would expect something like that, too.Z1202 wrote:I would further assume, that should you simply connect an integrator to the bandpass output, the resulting lowpass signal might "drift" around DC, whereas inside the filter the feedback will probably take care of the precision losses.
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4292 posts since 8 Mar, 2004 from Berlin, Germany
aciddose wrote:you're just integrating the differentiated value.
how is it so hard to believe this:
s - s[i-1] + s[i-1] = s ?
differentiation:
d = s - a;
a = s;
integration:
b += d;
b == s;
hmm...well, yes. sometimes, it helps to switch the perspective. from a (discrete) time-domain perspective, it's certainly much easier to believe (although we are actually not really using the naive integrator here)
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4292 posts since 8 Mar, 2004 from Berlin, Germany
Z1202 wrote:Well, suppose you have a DC input x=const, and BP=0 and LP!=x, then you immediately get the signal x-LP at the input of the first integrator. There you go
yeah - so, as we see, the feedback is indeed crucial for this DC reconstruction. i guess, i'm already way too spoiled with this strictly sequential thinking in DSP.
- KVRAF
- 7890 posts since 12 Feb, 2006 from Helsinki, Finland
Something to note: since the finite DC gain relies on the differentials having zeroes at DC (which the integrators then cancel), if the differentials go through a non-linearity (eg practical OTA) you will typically get some DC drift at output. This is dependent on the cutoff (increases as cutoff gets lower).
If you observe that happening, don't panic. It's something that happens with with an analog implementation as well (or even SPICE). In a properly gain-staged filter it shouldn't become a problem at audio rates (ie back off the saturation), but you might want to stick a DC blocker at the output.
If you observe that happening, don't panic. It's something that happens with with an analog implementation as well (or even SPICE). In a properly gain-staged filter it shouldn't become a problem at audio rates (ie back off the saturation), but you might want to stick a DC blocker at the output.
-
- KVRAF
- Topic Starter
- 1607 posts since 12 Apr, 2002
I'm wondering why google still doesn't find the original link, while it finds the discodsp mirror. Does this have to do with the way I posted the URL? Attempt no.2:
http://ay-kedi.narod2.ru/VAFilterDesign.pdf
http://ay-kedi.narod2.ru/VAFilterDesign.pdf
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4292 posts since 8 Mar, 2004 from Berlin, Germany
i was trying to obtain a bell-shaped filter (aka peaking filter, parameteric eq) from the SVF via the formulas in 5.3, page 81 (add a weighted bandpass output to the original signal). the formula at the bottom of the page to prescribe a desired bandwidth in octaves to calculate the damping coeff "R" did not give me the results, i expected. so i tried to re-derive it and obtained a different formula. i wrote a little MatLab/Octave script that compares both formulas:
[/size]
the script plots the magnitude responses for an analog bell with unit center frequency, a linear gain factor of 4 and 2 octaves bandwidth. the green curve is what i expect (it passes through 2 at 0.5 and 2.0) and that's what my formula gives. the blue curve is from an R value calculated with the formula from the book and is too narrow:
hmm... so either the formula in the book is wrong, or i somehow misunderstood how to apply it. Vadim, if the former turns out to be the case, you may read my formula from the script.
also, i wonder whether the "peaking filter" somewhere below (as opposed to this "band-shelf") results in the same response (up to sign inversion) once you parametrize it in terms of the bandwidth?
edit: of course, this formula applies to the analog filter, for the digital one, one has to take frequency warping into account ....more work to do.
Code: Select all
clear all;
% parameters (we assume the center frequency at unity):
G = 4.0; % desired linear gain (== K-1)
B = 2.0; % desired bandwidth in octaves
K = G-1; % multiplier for bandpass signal
w = 0:0.01:3; % radian frequency axis
RV = (abs(2^(B/2)-2^(-B/2)))/(4*G); % Vadim's formula (page 81), G == 1+K
RR = sqrt((((2^B)^2+1)/2^B-2)/(4*G)); % Robin's formula
% obtain magntitude responses for both values of R:
cN = 4*RV^2*K^2 + 8*RV^2*K + 4*RV^2 - 2;
cD = 4*RV^2 - 2;
MV = sqrt((1 + cN*w.^2 + w.^4) ./ (1 + cD*w.^2 + w.^4));
cN = 4*RR^2*K^2 + 8*RR^2*K + 4*RR^2 - 2; % numerator coeff for w^2
cD = 4*RR^2 - 2; % denominator coeff for w^2
MR = sqrt((1 + cN*w.^2 + w.^4) ./ (1 + cD*w.^2 + w.^4));
% plot:
% blue curve: Vadim's formula (too narrow)
% green curve: Robin's formula - passes through 2=sqrt(4) at 0.5 and 2.0
% which is at it should be for a 2-octave wide bell centered at 1:
plot(w, MV, w, MR);
grid on;
the script plots the magnitude responses for an analog bell with unit center frequency, a linear gain factor of 4 and 2 octaves bandwidth. the green curve is what i expect (it passes through 2 at 0.5 and 2.0) and that's what my formula gives. the blue curve is from an R value calculated with the formula from the book and is too narrow:
hmm... so either the formula in the book is wrong, or i somehow misunderstood how to apply it. Vadim, if the former turns out to be the case, you may read my formula from the script.
also, i wonder whether the "peaking filter" somewhere below (as opposed to this "band-shelf") results in the same response (up to sign inversion) once you parametrize it in terms of the bandwidth?
edit: of course, this formula applies to the analog filter, for the digital one, one has to take frequency warping into account ....more work to do.
-
- KVRAF
- Topic Starter
- 1607 posts since 12 Apr, 2002
Oops, I guess I'll need to debug it I just derived it by hand, rechecked my derivation, but didn't do a numerical check. Apparently I made some mistake there.Robin from www.rs-met.com wrote:the formula at the bottom of the page to prescribe a desired bandwidth in octaves to calculate the damping coeff "R" did not give me the results, i expected.
The other one doesn't have independent control of bandwidth and peak height (actually someone on KVR made me recently aware of this peaking filter, probably I need to dig up this thread and credit the person in the next book update).Robin from www.rs-met.com wrote:also, i wonder whether the "peaking filter" somewhere below (as opposed to this "band-shelf") results in the same response (up to sign inversion) once you parameterize it in terms of the bandwidth?
-
- KVRAF
- Topic Starter
- 1607 posts since 12 Apr, 2002
Personally, I'd assume at least 88kHz SR and ignore the "minor" warping in the audible rangeRobin from www.rs-met.com wrote:edit: of course, this formula applies to the analog filter, for the digital one, one has to take frequency warping into account ....more work to do.
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4292 posts since 8 Mar, 2004 from Berlin, Germany
hmm...najaaa...neee. i'll see if i can work it out.Z1202 wrote:Personally, I'd assume at least 88kHz SR and ignore the "minor" warping in the audible rangeRobin from www.rs-met.com wrote:edit: of course, this formula applies to the analog filter, for the digital one, one has to take frequency warping into account ....more work to do.
-
- KVRAF
- Topic Starter
- 1607 posts since 12 Apr, 2002
Well, you won't get a symmetric shape anywayRobin from www.rs-met.com wrote:hmm...najaaa...neee. i'll see if i can work it out.Z1202 wrote:Personally, I'd assume at least 88kHz SR and ignore the "minor" warping in the audible rangeRobin from www.rs-met.com wrote:edit: of course, this formula applies to the analog filter, for the digital one, one has to take frequency warping into account ....more work to do.
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4292 posts since 8 Mar, 2004 from Berlin, Germany
well, yeah - that's probably what i mean with "once you parameterize it in terms of the bandwidth" ...but that doesn't even seem to be possible since it has no free parameter K. hmm...well - i think the other one is more useful then.Z1202 wrote:The other one doesn't have independent control of bandwidth and peak heightRobin from www.rs-met.com wrote:also, i wonder whether the "peaking filter" somewhere below (as opposed to this "band-shelf") results in the same response (up to sign inversion) once you parameterize it in terms of the bandwidth?