|
第十二回 実況中継music-dspメーリングリスト!
(2005.07.25) |
|
music-dspというメーリングリストを中心としたWebサイトがあります。
7/10にCitizen Chunkさんの書き込みによって始まったこのスレッドでは、
真空管のサチュレーションをシミュレートする方法に関する議論が熱く展開されています。
現時点で議論はまだ続いているのですが、とりあえず7/18までのものを載せてみることにしました。
拙訳
原文
Message: 11
Date: Sun, 10 Jul 2005 16:55:34 -0400
From: Citizen Chunk
Subject: [music-dsp] tube saturation algorithm research
To: music-dsp
hi all. first of all, my apologies if this topic has been covered to
death already. i did some searching in the archives, but didn't turn
up much on the subject.
i'm trying to write a simple C++ class for an emulated tube drive
circuit. nothing too complex/detailed; more like an approximation
(read: fake), using generalizations of common characteristics.
as a base, i'm using the Simulanalog paper, "A Complete Model of a
Tube Amplifier". (i know i've brought it up here before, but the
thread never went very far.) in the article, the conclusion seems to
be that the decoupling capacitor on the grid voltage, as it is
charging up, causes more harmonic distortion on transients. i won't
pretend to understand most of the engineering leading up to the
conclusion ;); but i do understand the basic concepts.
i also understand that tube circuits cause more even-order harmonic
distortion, which can be approximated with an asymmetrical waveshaper,
or a symmetrical waveshaper combined with a DC offset.
hopefully, with this basis, i can come up with something
interesting--albeit not realistic, but "fun" nonetheless.
my first goal is to learn more about waveshaping techniques. i would
like to understand how to control harmonic distortion with
polynomials, in order to come up with a good waveshaping algorithm for
emphasizing tube-like characteristics. later on, i'll apply
transient-detection to the input to modulate the ammount of
saturation.
does anyone here know of some good online (or offline, if it exists
anymore ;)) reading on the subject of waveshaping, ideally with an
emphasis on audio applications; even more ideally, something that
discusses tube saturation.
concrete examples/formulas are also welcome, but i would prefer to be
able to understand this stuff myself, not just borrow code.
thanks.
== chunk
------------------------------
Message: 1
Date: Mon, 11 Jul 2005 00:05:21 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
>my first goal is to learn more about waveshaping techniques. i would
>like to understand how to control harmonic distortion with
>polynomials, in order to come up with a good waveshaping algorithm for
>emphasizing tube-like characteristics. later on, i'll apply
>transient-detection to the input to modulate the ammount of
>saturation.
>
>
This is quite simple, actually..
AFAIK distortion is usually defined by the harmonics it creates to a
incoming sinusoid at a certain amplitude. Let's assume input amplitude 1
for this:
output = amplitude[harmonic_number] * cos( acos(input) * harmonic_number)
Add several of these to get multiple harmonics for each sinusoid. You
will also want to include some fundamental (first harmonic).
IIRC when you work Taylor serii on these things you get nice waveshaping
polynomials whose order matches the highest harmonic you're creating. I
might be totally wrong though, I've never done it in practice.
You get more harmonics when you increase input amplitude, less when you
decrease it.
For more complicated input signals, intermodulation products are
created. However, the output signal (IIRC) is bandlimited to input_band
* polynomial_order. So to take care of aliasing completely, you will
want to oversample that much. Oversampling beyond 8 x is probably a
waste though.
Check the facts before proceeding, I'm just firing from lap here.
Hopefully I won't start you into a completely ridicilous direction ;)
Vesa
------------------------------
Message: 2
Date: Sun, 10 Jul 2005 17:29:26 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
thanks Vesa! i will try this out.
FWIW, i also stumbled upon a PDF doc that i had downloaded last year
(i collect a lot of stuff and often forget about it) that describes
using Chebychev polynomials to create waveshapers that emphasize
certain harmonics.
is there any white paper or online reading that states the distortion
indexes of the harmonics that a tube creates?
thanks again.
== chunk
On 7/10/05, Vesa Norilo
>
> >my first goal is to learn more about waveshaping techniques. i would
> >like to understand how to control harmonic distortion with
> >polynomials, in order to come up with a good waveshaping algorithm for
> >emphasizing tube-like characteristics. later on, i'll apply
> >transient-detection to the input to modulate the ammount of
> >saturation.
> >
> >
> This is quite simple, actually..
>
> AFAIK distortion is usually defined by the harmonics it creates to a
> incoming sinusoid at a certain amplitude. Let's assume input amplitude 1
> for this:
>
> output = amplitude[harmonic_number] * cos( acos(input) * harmonic_number)
>
> Add several of these to get multiple harmonics for each sinusoid. You
> will also want to include some fundamental (first harmonic).
>
> IIRC when you work Taylor serii on these things you get nice waveshaping
> polynomials whose order matches the highest harmonic you're creating. I
> might be totally wrong though, I've never done it in practice.
>
> You get more harmonics when you increase input amplitude, less when you
> decrease it.
>
> For more complicated input signals, intermodulation products are
> created. However, the output signal (IIRC) is bandlimited to input_band
> * polynomial_order. So to take care of aliasing completely, you will
> want to oversample that much. Oversampling beyond 8 x is probably a
> waste though.
>
> Check the facts before proceeding, I'm just firing from lap here.
> Hopefully I won't start you into a completely ridicilous direction ;)
>
> Vesa
>
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
------------------------------
Message: 3
Date: Mon, 11 Jul 2005 00:39:08 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
>
>is there any white paper or online reading that states the distortion
>indexes of the harmonics that a tube creates?
>
>
>
If you find one, let me know.
However, there's a nice way to measure them.
Record a sine sweep through the equipment you measure. Do
autocorrelation. Observe distortion components in the result. You see,
it thinks that the extraneous harmonics are 'echoes' of the primary sine
sweep.
Vesa
------------------------------
Message: 4
Date: Sun, 10 Jul 2005 18:02:15 -0400
From: Glen
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
At 05:05 PM 7/10/2005, Vesa Norilo wrote:
>You get more harmonics when you increase input amplitude, less when you
>decrease it.
I assume that you mean harmonics generated are larger in amplitude, and not
that a greater number of harmonics generated?
>For more complicated input signals, intermodulation products are created.
>However, the output signal (IIRC) is bandlimited to input_band *
>polynomial_order. So to take care of aliasing completely, you will want to
>oversample that much. Oversampling beyond 8 x is probably a waste though.
So, let's say I have the composite input signal of a 700 Hz sine wave, and
a 500 Hz sine wave. Then, I apply this distortion to the signal.
I assume I would generate various amounts of all the harmonics of 700 Hz,
along with all the harmonics of 500 Hz -- before allowing for intermodulation?
With intermodulation considered, do I then get all the harmonics of
(700-500) Hz, as well as all the harmonics of (700+500) Hz?
Thanks,
Glen
------------------------------
Message: 5
Date: Mon, 11 Jul 2005 01:10:00 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
>
>> You get more harmonics when you increase input amplitude, less when
>> you decrease it.
>
>
> I assume that you mean harmonics generated are larger in amplitude,
> and not that a greater number of harmonics generated?
Yes, exactly. I mean the amplitude.
>> For more complicated input signals, intermodulation products are
>> created. However, the output signal (IIRC) is bandlimited to
>> input_band * polynomial_order. So to take care of aliasing
>> completely, you will want to oversample that much. Oversampling
>> beyond 8 x is probably a waste though.
>
>
> So, let's say I have the composite input signal of a 700 Hz sine wave,
> and a 500 Hz sine wave. Then, I apply this distortion to the signal.
>
> I assume I would generate various amounts of all the harmonics of 700
> Hz, along with all the harmonics of 500 Hz -- before allowing for
> intermodulation?
>
> With intermodulation considered, do I then get all the harmonics of
> (700-500) Hz, as well as all the harmonics of (700+500) Hz?
Your signal is sin(700 t) + sin(500 t). If your waveshaping function is
y = x^2 then you get (sin ^2 (700t) + 2 sin(700t)sin(500t) +
sin^2(500t)). sin^2 (x) reduces to DC and sinusoid at 2x, the middle
term is intermodulation distortion.
You can work the algebra for higher order waveshapers as well, but it's
easier just to rely on the fact that each time the signal is multiplied
with itself, it's convolution in the frequency domain. Just remember
that sin(f t) represents both +f and -f frequencies in the frequency
domain, because it's 1/2(e^(i f t) + e^(i -f t)) via Euler's theorem.
Then it becomes pretty obvious why ring modulation with real signals
produces sum and difference frequencies. And why a "ring modulator" with
a complex sinusoid becomes a frequency shifter. But let's not go there
tonight ;)
Vesa
------------------------------
Message: 6
Date: Sun, 10 Jul 2005 18:10:38 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
On 7/10/05, Vesa Norilo
> >is there any white paper or online reading that states the distortion
> >indexes of the harmonics that a tube creates?
> If you find one, let me know.
FWIW, i found this page: http://www.sowter.co.uk/harmonics.htm
but it doesn't go into much detail. no concrete numbers. i believe
i've found others in preliminary googling, but can't find them right
now.
i'll definitely post any findings.
== chunk
------------------------------
Message: 7
Date: Mon, 11 Jul 2005 01:16:05 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
>FWIW, i found this page: http://www.sowter.co.uk/harmonics.htm
>
>but it doesn't go into much detail. no concrete numbers. i believe
>i've found others in preliminary googling, but can't find them right
>now.
>
>i'll definitely post any findings.
>
>
Other significant characteristics of what we think of as tube distortion
are at least the Miller effect, the precise mechanism of which I have no
idea about, but it does attenuate the higher harmonics (or frequencies?)
My friend informs me that the nonlinearity in transformers in tube
amplifiers accounts for a large part of the sound of the distortion.
Transformers saturate easily with bass frequencies. Maybe that's due to
the fact that they induce current... you might want to experiment with
integrator -> saturator -> differentiator to get this effect. Or it
might be something completely different.
Vesa
------------------------------
Message: 9
Date: Sun, 10 Jul 2005 18:49:37 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
> My friend informs me that the nonlinearity in transformers in tube
> amplifiers accounts for a large part of the sound of the distortion.
> Transformers saturate easily with bass frequencies. Maybe that's due to
> the fact that they induce current... you might want to experiment with
> integrator -> saturator -> differentiator to get this effect. Or it
> might be something completely different.
yes, i thought about something similar, using a low-pass filtered
"sidechain" path to calculate a waveshaping gain and applying that to
the unfiltered input. (that would alleviate the necessity of the
differentiator, right?)
== chunk
------------------------------
Message: 10
Date: Mon, 11 Jul 2005 02:00:01 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
>yes, i thought about something similar, using a low-pass filtered
>"sidechain" path to calculate a waveshaping gain and applying that to
>the unfiltered input. (that would alleviate the necessity of the
>differentiator, right?)
>
>
(Talking about the transformer I guess?)
I guess that also fulfills the criterion "overloads easily with low
frequencies"..
Let's examine the relative complexity:
Input -> Sidechain LP Filter -> Envelope detector -> Waveshaper Gain
adjustment logic -> Waveshaper -> Output
Input -> Integrator -> Waveshaper -> Differentiator
My guess is that a transformer is a relatively simple device and
probably doesn't have a built-in envelope detector. I would be inclined
to try to use straight waveshaping with pre and post filtering that
cancel out when the waveshaping isn't active (such as integrator /
differentiator). However, those filters may not be the best (altough
they may well be - in a transformer the electric signal is essentially
integrated and differentiated due to moving from voltage to magnetic
field to voltage).
A problem in my approach is that you must (in practice) make the
integrator leaky. But wait! This is not a bug, it's a feature.
Transformers namely have a response drop in the low end. You might even
experiment with the leak to model different size transformers ;)
If there's someone reading who actually knows something about
transformers and electricity, please chime in ;)
Vesa
----------------------------------------------------------------------
Message: 1
Date: Mon, 11 Jul 2005 10:11:26 +0900
From: David Cournapeau
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
Citizen Chunk wrote:
>hi all. first of all, my apologies if this topic has been covered to
>death already. i did some searching in the archives, but didn't turn
>up much on the subject.
>
>
Hi,
You may want to try this page:
http://www.simulanalog.org/ (it may actually be a good idea to link
to them on musicdsp...)
Cheers,
david
Message: 2
Date: Mon, 11 Jul 2005 10:41:25 -0700
From: David Lowenfels
Subject: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Citizen Chunk wrote:
> as a base, i'm using the Simulanalog paper, "A Complete Model of a
> Tube Amplifier". (i know i've brought it up here before, but the
> thread never went very far.) in the article, the conclusion seems to
> be that the decoupling capacitor on the grid voltage, as it is
> charging up, causes more harmonic distortion on transients. i won't
> pretend to understand most of the engineering leading up to the
> conclusion ;); but i do understand the basic concepts.
>
> i also understand that tube circuits cause more even-order harmonic
> distortion, which can be approximated with an asymmetrical waveshaper,
> or a symmetrical waveshaper combined with a DC offset.
Hi Chunk:
I haven't experimented extensively with this, but one way to
emulate the above-mentioned transient effect is to use the output of
an envelope follower (scaled appropriately) as a DC offset to the
input of the waveshaper. This way you get a transient asymmetry.
Here's an idea:
input -> integrator -> sum with sidechain DC offset -> waveshaper/
saturator -> differentiator -> DC blocker
You can implement an arbitrary waveshaper is with an interpolated
lookup-table.
-David
------------------------------
Message: 3
Date: Mon, 11 Jul 2005 14:06:36 -0400 (EDT)
From: antti
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On Mon, 11 Jul 2005, David Lowenfels wrote:
> I haven't experimented extensively with this, but one way to emulate the
> above-mentioned transient effect is to use the output of an envelope follower
> (scaled appropriately) as a DC offset to the input of the waveshaper. This
> way you get a transient asymmetry.
Or you could do it the way the actual circuits work:
http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf
In short:
input + bias -> asymmetric waveshaper -> highpass -> output
-> lowpass and feedback to bias
I'll see if I can find the polynomial used in building the Ftube()
waveshaper.
The model could be improved but already sounds surprisingly good. Next
version would require better measurements and I don't currently have the
time to build the custom measurement equipment.
Beware of the Simulanalog tube model - x^2/3 power law does NOT hold for
tubes. See http://www.lynx.bc.ca/%7Ejc/model.html
Antti
Ps. A tube by itself cannot do anything. It always needs extra circuitry
around it which has a huge effect on the sound.
Pps. Anytime you're adding explicit envelope followers or compressors to
model tube circuitry, you're doing it wrong (unless the unit happens to be
a compressor). The compression effects of tube amplifiers are due to the
dynamic shifting of the bias voltage and the low order distortion
products, not any explicit compressor.
------------------------------
Message: 4
Date: Mon, 11 Jul 2005 14:14:27 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On 7/11/05, David Lowenfels wrote:
> I haven't experimented extensively with this, but one way to
> emulate the above-mentioned transient effect is to use the output of
> an envelope follower (scaled appropriately) as a DC offset to the
> input of the waveshaper. This way you get a transient asymmetry.
>
> Here's an idea:
>
> input -> integrator -> sum with sidechain DC offset -> waveshaper/
> saturator -> differentiator -> DC blocker
hi David. thanks for your input. i had thought of the exact same thing
(envelope modulating DC offset). actually, i now have 2 ideas:
1) use the envelope to modulate the DC offset (as you've said)
2) use the envelope to modulate just specific harmonics (i.e. 2nd, or
whatever sounds "tubey" ... er, "tubular"?). using the Chebyshev
polynomials makes this a piece o' cake.
i'll have to experiment with both. i'll also play around with the
integrator/differentiator combo.
thanks bros.
== chunk
------------------------------
Message: 6
Date: Mon, 11 Jul 2005 14:27:39 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On 7/11/05, antti wrote:
> Pps. Anytime you're adding explicit envelope followers or compressors to
> model tube circuitry, you're doing it wrong (unless the unit happens to be
> a compressor). The compression effects of tube amplifiers are due to the
> dynamic shifting of the bias voltage and the low order distortion
> products, not any explicit compressor.
right, yes, i know that this going to be a fake, at best. but it's not
going to be a compressor, per se; far from it. though the envelope
follower (which is really just like a simple RC LPF) should recreate
the "dynamic shifting of the bias voltage"--i hope.
thanks for your other suggestions too.
i'd be curious to see some concrete numbers on typical harmonic
distortion with tube circuits. i know that this is a sweeping
generalization of the combined effect of the circuit as a whole; but
i'd just like to make something cool, with a little character, to add
to other "character projects".
== chunk
------------------------------
Message: 7
Date: Mon, 11 Jul 2005 14:37:29 -0700 (PDT)
From: Farsheed
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
Hey Vesa,
> is there any white paper or online reading that
> states the distortion
> indexes of the harmonics that a tube creates?
Last semester I took a good course that touched on
theories of distortion. You may want to check out
this page and scroll down to the bottom where it says,
"theory of distortion I and II"
http://online.physics.uiuc.edu/courses/phys498pom/498pom_lectures.html
Actually there is quite a good bit of tube distortion
theory stuff on their anyway. I encourage you to
contact the professor, Steven Errede, who knows a lot
about tube physics. But remember, he is a physicist,
not a DSP guy ;)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
------------------------------
Message: 8
Date: Tue, 12 Jul 2005 19:31:30 +0200
From: Martin Eisenberg
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp
From: "Citizen Chunk"
> is there any white paper or online reading that states the
> distortion indexes of the harmonics that a tube creates?
This article has some figures showing how the first couple
harmonics rise with increasing drive:
http://www.dwfearn.com/tvst1.htm
Martin
------------------------------
Message: 9
Date: Tue, 12 Jul 2005 23:16:58 +0200
From: Doctor-T
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
> Hi Chunk:
> I haven't experimented extensively with this, but one way to
> emulate the above-mentioned transient effect is to use the output of
> an envelope follower (scaled appropriately) as a DC offset to the
> input of the waveshaper. This way you get a transient asymmetry.
>
> Here's an idea:
>
> input -> integrator -> sum with sidechain DC offset -> waveshaper/
> saturator -> differentiator -> DC blocker
Why do you propose to apply the waveshaper in the integrated signal?
Tubes are shaping the signal not integrated.
Thomas
------------------------------
Message: 10
Date: Wed, 13 Jul 2005 01:36:35 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On 7/12/05, Doctor-T wrote:
> > input -> integrator -> sum with sidechain DC offset -> waveshaper/
> > saturator -> differentiator -> DC blocker
>
> Why do you propose to apply the waveshaper in the integrated signal?
> Tubes are shaping the signal not integrated.
>
i'm pretty sure that this is to simulate the characteristic of more
saturation of low frequencies. i believe that the integrator is
basically acting as a LPF. the filtered signal is then shaped, then
differentiated (to compensate for the integration). do i understand
this correctly?
my approach to this would involve a sidechain path, so that the main
path doesn't go through the integrator/differentiator. as such, the
sidechain would be low-pass filtered and DC offset. the waveshaper
algo can be manipulated to return a gain control value, instead of the
output signal. then this gain control signal can be applied to the
main path.
== chunk
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Jul 2005 09:50:02 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
>i'm pretty sure that this is to simulate the characteristic of more
>saturation of low frequencies. i believe that the integrator is
>basically acting as a LPF. the filtered signal is then shaped, then
>differentiated (to compensate for the integration). do i understand
>this correctly?
>
>
Yes, but AFAIK, tubes don't distort low frequencies more than high
frequencies, transformers do.
Vesa
------------------------------
Message: 2
Date: Wed, 13 Jul 2005 12:03:00 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
do transformers share the same "dynamic saturation" that tubes
exhibit? also, do they also emphasize the second harmonic? or are they
more third harmonic?
sorry for all the questions.
== chunk
On 7/13/05, Vesa Norilo wrote:
>
> >i'm pretty sure that this is to simulate the characteristic of more
> >saturation of low frequencies. i believe that the integrator is
> >basically acting as a LPF. the filtered signal is then shaped, then
> >differentiated (to compensate for the integration). do i understand
> >this correctly?
> >
> >
> Yes, but AFAIK, tubes don't distort low frequencies more than high
> frequencies, transformers do.
>
> Vesa
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
------------------------------
Message: 3
Date: Wed, 13 Jul 2005 21:50:47 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
I think transformers just saturate in a quite straightforward fashion. I
think my best guess would be a sigma function saturation, but happening
in between a pair of filters that emphasize bass frequencies for the
saturator and cancel each other out normally. This would be just a
mock-up but should do reasonably well. You need to measure actual
devices if you want to do better.
Vesa
>do transformers share the same "dynamic saturation" that tubes
>exhibit? also, do they also emphasize the second harmonic? or are they
>more third harmonic?
>
>sorry for all the questions.
>
>
>
>
------------------------------
Message: 4
Date: Wed, 13 Jul 2005 15:20:49 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On 7/13/05, Vesa Norilo wrote:
> I think transformers just saturate in a quite straightforward fashion. I
> think my best guess would be a sigma function saturation, but happening
> in between a pair of filters that emphasize bass frequencies for the
> saturator and cancel each other out normally. This would be just a
> mock-up but should do reasonably well. You need to measure actual
> devices if you want to do better.
>
thanks for the input Vesa. i'm still not sure exactly how you can have
2 filters that just cancel each other out. i tried an
integrator/differentiator pair yesterday, but the output just blew up.
i tried manipulating the leak on the integrator, which stopped it from
blowing up, but i still got weird noises and occaisional "eruptions".
my integrator/differentiator is basically as follows:
integState += in - leak * integState; // 0 < leak < 1; leak usually =
0.001, right?
in = integState; // hand-off, for clarity
diffState = in - diffState;
i assumed that using them in series would just cancell each other out
(not taking into account the leak). guess i'm doing something wrong.
== chunk
------------------------------
Message: 5
Date: Wed, 13 Jul 2005 17:35:36 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
ok, i got my integ/diff working. i had a bug in my differentiator:
> diffState = in - diffState;
should have been:
out = in - previousIn;
previousIn = in;
the problem now is that the output blows up when i pass the integrated
signal through the waveshaper. the waveshaper is fine, because i've
tested it on its own. the integ/diff are fine, because i've tested
them on their own. but the combination of integ->waveshaper->diff is
lethal. any thoughts, guys?
== chunk
------------------------------
Message: 6
Date: Thu, 14 Jul 2005 00:41:52 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
>the problem now is that the output blows up when i pass the integrated
>signal through the waveshaper. the waveshaper is fine, because i've
>tested it on its own. the integ/diff are fine, because i've tested
>them on their own. but the combination of integ->waveshaper->diff is
>lethal. any thoughts, guys?
>
>
Make your integrator leak! In signal processing terms, you should add a
high pass component that preserves the integrator response but cuts out
the very lowest frequencies below the audio range. In practice, this is
achieved by making your integrator feedback coefficent not 1 but
something quite near 1.
Otherwise, if there's any DC in your input signal, it's just going to
explode.
V
------------------------------
Message: 7
Date: Thu, 14 Jul 2005 00:46:02 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Oh, I should read before posting. That wasn't your problem obviously.
You need to factor in the integrator filter gain. The amplitude will be
usually quite a bit higher than non-integrated signal. The gain at dc is
going to be 1/(1-fb) where fb is your feedback coefficent. At Nyquist
it's probably going to be around 0.5
Are you sure that the waveshaper is totally decoupled from the filters?
Vesa
>>
> Make your integrator leak! In signal processing terms, you should add
> a high pass component that preserves the integrator response but cuts
> out the very lowest frequencies below the audio range. In practice,
> this is achieved by making your integrator feedback coefficent not 1
> but something quite near 1.
>
> Otherwise, if there's any DC in your input signal, it's just going to
> explode.
>
> V
> --
> dupswapdrop -- the music-dsp mailing list and website: subscription
> info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
------------------------------
Message: 8
Date: Wed, 13 Jul 2005 23:48:36 +0200
From: Joost Schuttelaar
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Vesa Norilo wrote:
> Make your integrator leak! In signal processing terms, you should add a
> high pass component that preserves the integrator response but cuts out
> the very lowest frequencies below the audio range. In practice, this is
> achieved by making your integrator feedback coefficent not 1 but
> something quite near 1.
Can someone post some source code or other resources of audio
integrators/differentiator?
Quite fascinated :)
--
Joost Schuttelaar
------------------------------
Message: 9
Date: Thu, 14 Jul 2005 01:03:18 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
>
> Can someone post some source code or other resources of audio
> integrators/differentiator?
>
> Quite fascinated :)
>
Integrator:
output = input + (coef * output); // where in theory, coef is 1 for a
perfect integrator, <1 for a leaky one
As you see, it is a one-pole filter with no zero and a real pole at
frequency 0, radius "coef"
Differentiator:
output = input - last_input;
last_input = input;
It is a one-zero filter with a zero at frequency Pi, radius 1 and no pole.
Vesa
------------------------------
Message: 10
Date: Thu, 14 Jul 2005 00:08:00 +0200
From: Joost Schuttelaar
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Vesa Norilo wrote:
> Integrator:
> Differentiator:
Extremely cool :) thanks heaps! :)
--
Joost Schuttelaar
------------------------------
Message: 11
Date: Wed, 13 Jul 2005 18:21:00 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
hi Vesa. i figured out the the absense of the leak was causing the
blow up. unfortunately, it also needs a very high leak (~0.999) in
order for the waveshaper not to blow up. (understandably.) since the
integrator is thus not doing much integrating, the differentiator
rolls off all of the low frequency, making it sound horrible. (like a
HPF with a very high Fc.)
is there some way to manipulate the differentiator to compensate for
this? is there some sort of "reverse leak" that can, effectively, push
the differentiator's Fc way down?
sorry to post so many stupid questions guys.
also...
> Are you sure that the waveshaper is totally decoupled from the filters?
what does this mean?
== chunk
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Jul 2005 17:56:24 -0700 (MST)
From: inicoderocker
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On Wed, 13 Jul 2005, Citizen Chunk wrote:
> is there some way to manipulate the differentiator to compensate for
> this? is there some sort of "reverse leak" that can, effectively, push
> the differentiator's Fc way down?
What is you wave shaper doing? If either the shaping function or the
input signal are not symmetrical you'll probably introduce a DC offset
A simple case would be
out = in^2
or
out = exp(in)
obviously the output is always positive, so the integral will blow up
quickly. If you can estimate the DC offset introduced and subtract it off
--say take the output of the wave shaper for a "typical" input and average
it for a long time or just guess, then just subtract this value from the
output of the wave shaper --you'll still need the leaky integrator, but
hopefully less leak.
CR
------------------------------
Message: 2
Date: Wed, 13 Jul 2005 21:18:58 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
> is there some way to manipulate the differentiator to compensate for
> this? is there some sort of "reverse leak" that can, effectively, push
> the differentiator's Fc way down?
duh! of course! you just create a complementary leak in the
differentiator's feedback. (realized this on the subway home. i do
some of my best thinking there.)
so this allows me to create a relatively large leak in the integrator
(so that the waveshaper doesn't blow up), without the differentiator
hi-pass filtering the hell out of the output.
== chunk
------------------------------
Message: 4
Date: Thu, 14 Jul 2005 18:06:43 +0200
From: Martin Eisenberg
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
From: Citizen Chunk
> integState += in - leak * integState;
Scale the input for unity DC response (like Vesa said) and make
time explicit:
integState[n] = leak * in[n] + (1-leak) * integState[n-1]
The highpass is supposed to yield a signal identical to in when
fed with integState, the lowpass output. So relabel in[n] -> out,
integState[n] -> in, integState[n-1] -> diffState in the above.
Isolate out on the left-hand side and add the state update --
voila!
out = 1/leak * (in - (1-leak) * diffState);
diffState = in;
What do you mean when you say the *waveshaper* blows up?
Martin
------------------------------
Message: 6
Date: Thu, 14 Jul 2005 11:47:49 -0700
From: David Lowenfels
Subject: [music-dsp] re: re: re: tube saturation algorithm research
To: music-dsp
Hi Chunk:
I recommend you start playing with some maths to get the actual
cutoff frequencies based on the sample rate. Think in terms of pole
and zero frequencies and transfer functions.. it's worth it to get
the perspective.
To get a perfect cancellation (well, discounting quantization errors)
of two filters, just use the inverse.
H(z) -> 1/H(z)
FYI I think it's also possible that an asymmetrical waveshaper can
generate a DC offset, though it's probably small.
-D
> hi Vesa. i figured out the the absense of the leak was causing the
> blow up. unfortunately, it also needs a very high leak (~0.999) in
> order for the waveshaper not to blow up. (understandably.) since the
> integrator is thus not doing much integrating, the differentiator
> rolls off all of the low frequency, making it sound horrible. (like a
> HPF with a very high Fc.)
>
> is there some way to manipulate the differentiator to compensate for
> this? is there some sort of "reverse leak" that can, effectively, push
> the differentiator's Fc way down?
>
------------------------------
Message: 8
Date: Fri, 15 Jul 2005 13:09:55 +0200
From: Niko Lange
Subject: AW: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Hi Antti,
I tried to understand your tube model, but have some difficulty
undertstanding the "-> lowpass and feedback to bias" part of the diagram.
Propably because I am pretty unexperienced in reading such stuff ;-) I
understand that the output of Ftube() is combined with the voltage source
V+. First problem, I notice a minus sign there does that mean V+ - Ftube()
or is it the other way round? Secondly the constant value of V+ seems
pretty high, does it need to be scaled to be used in floating point Audio?
Finally is my understanding correct that the resulting signal is multiplied
by Rk/Rp?
Sorry for asking so many dumb questions...
Niko
------------------------------
Message: 8
Date: Fri, 15 Jul 2005 15:38:57 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
hi Martin. i already fixed the problem by creating a leak in the
differentiator's feedback. this cancelled out the leak in the
integrator perfectly, also allowing me to keep the leak in the
integrator fairly high (so as to keep it from blowing up).
by "blow up", i mean that it keeps integrating values and does not
even out (as a perfect sinusoid might). this can be controlled with a
leaky integrator, which required a complimentary leak in the
differentiator, so that the differentiator didn't act as an annoying
HPF.
btw, the code that you supplied seems to be for a real 1-pole LPF/HPF,
which is not strictly the same as an integrator/differentiator,
because it scales the input (the zero). i was going on other people's
recommendations of using an "honest-to-goodness"
integrator/differentiator, which, while they are basically just like
1-pole LPF/HPF's, are slightly different.
== chunk
On 7/14/05, Martin Eisenberg wrote:
> From: Citizen Chunk
>
> > integState += in - leak * integState;
>
> Scale the input for unity DC response (like Vesa said) and make
> time explicit:
>
> integState[n] = leak * in[n] + (1-leak) * integState[n-1]
>
> The highpass is supposed to yield a signal identical to in when
> fed with integState, the lowpass output. So relabel in[n] -> out,
> integState[n] -> in, integState[n-1] -> diffState in the above.
> Isolate out on the left-hand side and add the state update --
> voila!
>
> out = 1/leak * (in - (1-leak) * diffState);
> diffState = in;
>
> What do you mean when you say the *waveshaper* blows up?
>
>
> Martin
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp
> links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
------------------------------
Message: 9
Date: Fri, 15 Jul 2005 15:49:03 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
On 7/14/05, David Lowenfels wrote:
> Hi Chunk:
> I recommend you start playing with some maths to get the actual
> cutoff frequencies based on the sample rate. Think in terms of pole
> and zero frequencies and transfer functions.. it's worth it to get
> the perspective.
hi David. i thought about using simple 1-pole LPF/HPF, with actual
frequencies to determine the runtime coefficients. however, i decided
in the end just to try playing around with "leaks". it's very easy
because the leak can be the same on both, thereby perfectly cancelling
each other out.
> FYI I think it's also possible that an asymmetrical waveshaper can
> generate a DC offset, though it's probably small.
sure it can. i can also add one myself. ;)
== chunk
------------------------------
Message: 10
Date: Fri, 15 Jul 2005 23:02:51 +0200
From: Martin Eisenberg
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
From: Citizen Chunk
> hi Martin. i already fixed the problem by creating a leak in
the
> differentiator's feedback.
I gave you the method because I read you as having accomplished
that by playing around. BTW, there is no feedback there. It's an
FIR.
> btw, the code that you supplied seems to be for a real
> 1-pole LPF/HPF, which is not strictly the same as an
> integrator/differentiator [...]
Yes, one-pole/one-zero. But you yourself are calling 'integrator'
what you know is not a perfect one ;)
Martin
------------------------------
Message: 11
Date: Sat, 16 Jul 2005 00:47:10 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
>hi David. i thought about using simple 1-pole LPF/HPF, with actual
>frequencies to determine the runtime coefficients. however, i decided
>in the end just to try playing around with "leaks". it's very easy
>because the leak can be the same on both, thereby perfectly cancelling
>each other out.
>
>
>
... but the way your filters influence the waveshaping is now tied to
the sampling rate. You should, IMHO, calculate the leaky integrator
based on the sampling rate.
BTW, there's no feedback in the differentiator.
Vesa
----------------------------------------------------------------------
Message: 1
Date: Sat, 16 Jul 2005 00:51:18 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
> ... but the way your filters influence the waveshaping is now tied to
> the sampling rate. You should, IMHO, calculate the leaky integrator
> based on the sampling rate.
And my quick and dirty method for doing this is:
Take a standard issue one pole / one zero high pass filter design
method, tuned to 20Hz or whatnot. Remove the zero altogether.
Reasoning: I want a perfect integrator and a DC-blocker in series.
Perfect integrator has a pole at 0Hz, DC blocker has a zero at 0Hz.
Multiplying in freq. domain, these cancel out. What we have left is the
pole in the DC-blocker. Behold, a leaky integrator results.
Vesa
------------------------------
Message: 2
Date: Fri, 15 Jul 2005 18:14:53 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
On 7/15/05, Vesa Norilo wrote:
> ... but the way your filters influence the waveshaping is now tied to
> the sampling rate. You should, IMHO, calculate the leaky integrator
> based on the sampling rate.
your absolutely right. i didn't even think of that. thanks for the heads up.
== chunk
------------------------------
Message: 3
Date: Fri, 15 Jul 2005 18:28:21 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
so, another question: which would be the ideal waveshaping method for
approximating these saturation curves? i've been playing with
Chebyshev polynomials, which is fairly cheap. but is there another,
better way? i found an example of a modified tanh() distortion, using
exp(), which allows asymmetrical waveshaping
(http://www.csounds.com/ezine/winter1999/processing/), but haven't
tried it yet. then there are a bunch of waveshapers in the
musicdsp.org archives. any thoughts?
also... when we talk of the signal's envelope shifting a tube's grid
bias and input DC, can we assume that it only shifts it negatively? in
other words, if one were to feed the envelope back to modulate the
input DC (applied before waveshaping), can we assume that the DC is
always negative, and that the shift only pushes it more negative on
transients? (i'm assuming that even-order waveshaping saturates more
on the negative wave.)
== chunk
On 7/15/05, Citizen Chunk wrote:
> On 7/15/05, Vesa Norilo wrote:
>
> > ... but the way your filters influence the waveshaping is now tied to
> > the sampling rate. You should, IMHO, calculate the leaky integrator
> > based on the sampling rate.
>
> your absolutely right. i didn't even think of that. thanks for the heads
> up.
>
> == chunk
>
------------------------------
Message: 6
Date: Sat, 16 Jul 2005 16:00:11 +0200
From: Urs Heckmann
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
Hi all,
this thread is a really great read!
One idea that comes to my mind, cascaded integrator comb filters (CIC)
can be used for upsampling and downsampling the signal. I havn't
thought this through, but maybe it's possible to use multiple stages in
series to upsample the signal and get the bandlimiting required for the
waveshaper done in one go.
Dunno exactly how to accomplish this, but it sounds pretty easy to me.
Maybe it's possible to somehow interleave this process with a series of
cheap low order waveshapers which in turn add up to the higher order
required for generation of certain harmonics.
There's a nice pdf on the topic here:
http://www.dspguru.com/info/tutor/cic.htm
Cheers,
;) Urs
urs heckmann
www.u-he.com
------------------------------
Message: 8
Date: Mon, 18 Jul 2005 10:07:25 +0800
From: dougall
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Niko ,
This should translate to something like....
out = lowpass_in ( in * gain )
out = FTube ( out - previous )
previous = lowpass_k( ( V - out) * Rk/Rp )
out = highpass ( out )
The scaling of input values to a suitable range is done by the gain
value. More gain will give more drive or distortion. The paper
quotes a typical gain value of 60 but doesn't give any units. The
model uses three of these stages in a row, each with different Rk
values, FTube functions and lowpass cutoffs for the filters. You
would need to scale the final output of the three stages to get it in
a suitable range for playback. This would be equivalent to the Master
volume in a tube amp.
On 7/15/05, Niko Lange wrote:
> Hi Antti,
> I tried to understand your tube model, but have some difficulty
> undertstanding the "-> lowpass and feedback to bias" part of the diagram.
> Propably because I am pretty unexperienced in reading such stuff ;-) I
> understand that the output of Ftube() is combined with the voltage source
> V+. First problem, I notice a minus sign there does that mean V+ - Ftube()
> or is it the other way round? Secondly the constant value of V+ seems
> pretty high, does it need to be scaled to be used in floating point Audio?
> Finally is my understanding correct that the resulting signal is multiplied
> by Rk/Rp?
> Sorry for asking so many dumb questions...
>
> Niko
>
> -----Ursprungliche Nachricht-----
> Von:
> Gesendet am: Montag, 11. Juli 2005 20:07
> An: music-dsp
> Betreff: Re: [music-dsp] re: tube saturation algorithm research
>
> On Mon, 11 Jul 2005, David Lowenfels wrote:
>
> > I haven't experimented extensively with this, but one way to emulate the
>
> > above-mentioned transient effect is to use the output of an envelope
> follower
> > (scaled appropriately) as a DC offset to the input of the waveshaper.
> This
> > way you get a transient asymmetry.
>
> Or you could do it the way the actual circuits work:
> http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf
>
> In short:
> input + bias -> asymmetric waveshaper -> highpass -> output
> -> lowpass and feedback to bias
>
> I'll see if I can find the polynomial used in building the Ftube()
> waveshaper.
>
> The model could be improved but already sounds surprisingly good. Next
> version would require better measurements and I don't currently have the
> time to build the custom measurement equipment.
>
> Beware of the Simulanalog tube model - x^2/3 power law does NOT hold for
> tubes. See http://www.lynx.bc.ca/%7Ejc/model.html
>
> Antti
>
> Ps. A tube by itself cannot do anything. It always needs extra circuitry
> around it which has a huge effect on the sound.
>
> Pps. Anytime you're adding explicit envelope followers or compressors to
> model tube circuitry, you're doing it wrong (unless the unit happens to be
> a compressor). The compression effects of tube amplifiers are due to the
> dynamic shifting of the bias voltage and the low order distortion
> products, not any explicit compressor.
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
----------------------------------------------------------------------
Message: 1
Date: Mon, 18 Jul 2005 07:14:30 -0400 (EDT)
From: antti
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
On Mon, 18 Jul 2005, dougall wrote:
> The scaling of input values to a suitable range is done by the gain
> value. More gain will give more drive or distortion. The paper
> quotes a typical gain value of 60 but doesn't give any units. The
Actually Ftube() has typical gain of 60. "gain" parameter ranges from 0
to 1 (it is just a potentiometer attenuating the voltage). Signal
amplitude is in volts.
> values, FTube functions and lowpass cutoffs for the filters. You
Ftube needs to be recalculated every time input resistance is changed
(technically any time you change the gain parameter of previous stage).
You basically solve
Ig = exp(a*Vg+b) = (Vi-Vg)/Ri
numerically and use the Vg obtained to calculate Vout and store that to
Vi,Vout table.
a = 6.23 and b = -9.8
I'll need to dig out the polynomial to use for Vout(Vg).
> would need to scale the final output of the three stages to get it in
> a suitable range for playback. This would be equivalent to the Master
> volume in a tube amp.
Indeed. You will also need very high SNR. The system has gain of 200000
(65 db!) at full gain.
Antti
------------------------------
Message: 3
Date: Mon, 18 Jul 2005 14:05:04 +0100
From: Max
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Dougall,
from the original paper it looks like
previous = lowpass_k( ( V - out) * Rk/Rp )
should be
previous = lowpass_k( ( -out + bias) * Rk/Rp )
Max
----- Original Message -----
From: dougall
To: music-dsp
Sent: Monday, July 18, 2005 3:07 AM
Subject: Re: [music-dsp] re: tube saturation algorithm research
Niko ,
This should translate to something like....
out = lowpass_in ( in * gain )
out = FTube ( out - previous )
previous = lowpass_k( ( V - out) * Rk/Rp )
out = highpass ( out )
The scaling of input values to a suitable range is done by the gain
value. More gain will give more drive or distortion. The paper
quotes a typical gain value of 60 but doesn't give any units. The
model uses three of these stages in a row, each with different Rk
values, FTube functions and lowpass cutoffs for the filters. You
would need to scale the final output of the three stages to get it in
a suitable range for playback. This would be equivalent to the Master
volume in a tube amp.
On 7/15/05, Niko Lange wrote:
> Hi Antti,
> I tried to understand your tube model, but have some difficulty
> undertstanding the "-> lowpass and feedback to bias" part of the diagram.
> Propably because I am pretty unexperienced in reading such stuff ;-) I
> understand that the output of Ftube() is combined with the voltage source
> V+. First problem, I notice a minus sign there does that mean V+ - Ftube()
> or is it the other way round? Secondly the constant value of V+ seems
> pretty high, does it need to be scaled to be used in floating point Audio?
> Finally is my understanding correct that the resulting signal is
> multiplied
> by Rk/Rp?
> Sorry for asking so many dumb questions...
>
> Niko
>
> -----Ursprungliche Nachricht-----
> Von: antti
> Gesendet am: Montag, 11. Juli 2005 20:07
> An: music-dsp
> Betreff: Re: [music-dsp] re: tube saturation algorithm research
>
> On Mon, 11 Jul 2005, David Lowenfels wrote:
>
> > I haven't experimented extensively with this, but one way to emulate
> > the
>
> > above-mentioned transient effect is to use the output of an envelope
> follower
> > (scaled appropriately) as a DC offset to the input of the waveshaper.
> This
> > way you get a transient asymmetry.
>
> Or you could do it the way the actual circuits work:
> http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf
>
> In short:
> input + bias -> asymmetric waveshaper -> highpass -> output
> -> lowpass and feedback to bias
>
> I'll see if I can find the polynomial used in building the Ftube()
> waveshaper.
>
> The model could be improved but already sounds surprisingly good. Next
> version would require better measurements and I don't currently have the
> time to build the custom measurement equipment.
>
> Beware of the Simulanalog tube model - x^2/3 power law does NOT hold for
> tubes. See http://www.lynx.bc.ca/%7Ejc/model.html
>
> Antti
>
> Ps. A tube by itself cannot do anything. It always needs extra circuitry
> around it which has a huge effect on the sound.
>
> Pps. Anytime you're adding explicit envelope followers or compressors to
> model tube circuitry, you're doing it wrong (unless the unit happens to be
> a compressor). The compression effects of tube amplifiers are due to the
> dynamic shifting of the bias voltage and the low order distortion
> products, not any explicit compressor.
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp
links
http://shoko.calarts.edu/musicdsp
http://ceait.calarts.edu/mailman/listinfo/music-dsp
------------------------------
Message: 4
Date: Mon, 18 Jul 2005 18:33:08 +0100
From: Rob Belcham
Subject: RE: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
Wow, Thanks Urs, great link. I've never heard of CIC filters before, i've
been using IIR allpass half-band filters for my up/down sampling tasks,
courtesy of the music-dsp archive :)
Shame there's no frequency response graphs in the paper, i'll have to have a
bit of a matlab session at work tomorrow to get to grips with these filters.
What does the frequency response actually look like ? How much attenuation
in the stopband, how much of the pass-band is 'useable' ?
I can't get my head around how they work though, with all those integrators
in series, don't the taps go off to infinity & become unstable ? The paper
doesn't mention using 'leaky' integrators. How bizzare!
Rob
> -----Original Message-----
> From: music-dsp-bounces
> On Behalf Of Urs Heckmann
> Sent: 16 July 2005 15:00
> To: music-dsp
> Subject: Re: [music-dsp] Re: tube saturation algorithm research
>
>
> Hi all,
>
> this thread is a really great read!
>
> One idea that comes to my mind, cascaded integrator comb filters (CIC)
> can be used for upsampling and downsampling the signal. I havn't
> thought this through, but maybe it's possible to use multiple stages in
> series to upsample the signal and get the bandlimiting required for the
> waveshaper done in one go.
>
> Dunno exactly how to accomplish this, but it sounds pretty easy to me.
> Maybe it's possible to somehow interleave this process with a series of
> cheap low order waveshapers which in turn add up to the higher order
> required for generation of certain harmonics.
>
> There's a nice pdf on the topic here:
>
> http://www.dspguru.com/info/tutor/cic.htm
>
> Cheers,
>
> ;) Urs
>
>
> urs heckmann
> www.u-he.com
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book
> reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
------------------------------
Message: 5
Date: Mon, 18 Jul 2005 19:48:54 +0200
From: Niko Lange
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp
Thanks for the helpful explanations Dougall and Antti! I alrady played
around with it a little at the weekend but misread some of the info in the
diagram. I'll see if I can get it to work.
cheers,
Niko
----- Original Message -----
From: antti
To: music-dsp
Sent: Monday, July 18, 2005 1:14 PM
Subject: Re: [music-dsp] re: tube saturation algorithm research
> On Mon, 18 Jul 2005, dougall wrote:
>
> > The scaling of input values to a suitable range is done by the gain
> > value. More gain will give more drive or distortion. The paper
> > quotes a typical gain value of 60 but doesn't give any units. The
>
> Actually Ftube() has typical gain of 60. "gain" parameter ranges from 0
> to 1 (it is just a potentiometer attenuating the voltage). Signal
> amplitude is in volts.
>
> > values, FTube functions and lowpass cutoffs for the filters. You
>
> Ftube needs to be recalculated every time input resistance is changed
> (technically any time you change the gain parameter of previous stage).
>
> You basically solve
> Ig = exp(a*Vg+b) = (Vi-Vg)/Ri
> numerically and use the Vg obtained to calculate Vout and store that to
> Vi,Vout table.
>
> a = 6.23 and b = -9.8
> I'll need to dig out the polynomial to use for Vout(Vg).
>
> > would need to scale the final output of the three stages to get it in
> > a suitable range for playback. This would be equivalent to the Master
> > volume in a tube amp.
>
> Indeed. You will also need very high SNR. The system has gain of 200000
> (65 db!) at full gain.
>
> Antti
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
------------------------------
Message: 6
Date: Mon, 18 Jul 2005 19:07:33 +0100
From: Rob Belcham
Subject: [music-dsp] CIC Filters. Was : tube saturation algorithm
research
To: music-dsp
Found a really well written article explaining CIC filters if anyone's
interested..
http://www.phptr.com/articles/article.asp?p=361985&seqNum=1
Rob
----------------------
------------------------------
Message: 8
Date: Mon, 18 Jul 2005 20:10:02 +0200
From: Urs Heckmann
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
Hey Rob,
yeah, they're quite bizarre.
I think that these have mostly found usage in fixed point arithmetic
where avoiding multiplication was crucial, as there is *no*
multiplication in there. Otherwise I think they perform pretty weak in
respect of bandlimiting (somebody told me, can't remember who it was).
I wouldn't be surprised if their outcome is pretty much close to linear
interpolation.
Sorry for the unqualified guess, I have successfully avoided
up/downsampling throughout my young dsp career. Made several attempts
but always found a way to circumvent the need (like, doublesampling
sounded good enough etc.)
However, it'd indeed be cool to know what exactly they do. If they
perform reasonably decent, they might be a cheap way to improve methods
like double sampling.
Cheers,
;) Urs
Am 18.07.2005 um 19:33 schrieb Rob Belcham:
> Wow, Thanks Urs, great link. I've never heard of CIC filters before,
> i've
> been using IIR allpass half-band filters for my up/down sampling tasks,
> courtesy of the music-dsp archive :)
>
> Shame there's no frequency response graphs in the paper, i'll have to
> have a
> bit of a matlab session at work tomorrow to get to grips with these
> filters.
>
> What does the frequency response actually look like ? How much
> attenuation
> in the stopband, how much of the pass-band is 'useable' ?
>
> I can't get my head around how they work though, with all those
> integrators
> in series, don't the taps go off to infinity & become unstable ? The
> paper
> doesn't mention using 'leaky' integrators. How bizzare!
------------------------------
Message: 9
Date: Mon, 18 Jul 2005 19:25:27 +0100
From: Rob Belcham
Subject: RE: [music-dsp] Re: tube saturation algorithm research
To: music-dsp
Answering my own questions..
> Shame there's no frequency response graphs in the paper, i'll
> have to have a
> bit of a matlab session at work tomorrow to get to grips with
> these filters.
Matlab wont be able to run these filters without the fixed point blockset,
becuase the structure has to use fixed point maths, as it relies on
calculations involving overflowing accumulators.
> What does the frequency response actually look like ? How much attenuation
> in the stopband, how much of the pass-band is 'useable' ?
The frequency response looks like a rectified sinc function, the attenuation
depends on the number of stages. There's not much usable passband, although
FIR filters can be used to equalize the response.
> I can't get my head around how they work..
They work becuase of the use of overflowing accumulators (see the link in my
previous mail to see how this works. They seem ideal for FPGA implementation
because there are no multiplies, but i'm not sure how big an accumulator you
would need to be able to run on 24 bit audio on something like a SHARC DSP.
Interesting filter structure though.
Rob
|