This is very interesting. Although i must confess that i have no idea how to model your feedback loop in Pd.<br>As for the lp filter, i have never used an upsampled filter. Is it enough if i use the filter built in Miller&#39;s J07 Upsampling example? It&#39;s a 3rd order butterworth lp and the subpatch is upsampled 16 times.<br>
More generally, what is the best way to split a signal into low and high frequencies? I thought of using fft, with, say, a gain equal to 1 for frequencies between 0 and X Hz, and equal to 0 above. Would this work? This would be the sharpest lp filter, wouldn&#39;t it? <br>
<br>Pierre<br><br><div class="gmail_quote">2010/10/14 - <span dir="ltr">&lt;<a href="mailto:fallen_devil@gmx.de">fallen_devil@gmx.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am 12.09.2010 19:24, schrieb Martin Peach:<br>
&gt; On 2010-09-12 12:05, Mathieu Bouchard wrote:<br>
&gt;&gt; On Sun, 12 Sep 2010, Martin Peach wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; It&#39;s not the capacitors, it&#39;s the amplifier losing gain when it<br>
&gt;&gt;&gt; approaches the power supply.<br>
&gt;&gt;<br>
&gt;&gt; Yeah, but it seems to be a pattern similar to the one found in<br>
&gt;&gt; capacitors, because capacitor theory has exp(-x) all over it, and the<br>
&gt;&gt; only way that capacitors behave like [hip~] is when the signal is much<br>
&gt;&gt; below the capacity rating (?F)... otherwise they lose gain... when they<br>
&gt;&gt; don&#39;t, it&#39;s because exp(-x) can be well approximated by x.<br>
&gt;&gt;<br>
&gt;<br>
&gt; I guess it&#39;s similar since capacitors charge at a rate proportional to a<br>
&gt; voltage difference, while transistors can supply charge carriers at a<br>
&gt; rate proportional to a voltage difference, so caps charge fastest when<br>
&gt; they are nearly empty and transistors have the best gain with small<br>
&gt; signal inputs.<br>
&gt;<br>
&gt; The whole universe has exp written all over it in fact...<br>
&gt;<br>
&gt;&gt; And then, exp is very close to tanh in several different ways, one of<br>
&gt;&gt; them being this (use gnuplot) :<br>
&gt;&gt;<br>
&gt;&gt; plot [-2:2] [-1:1] exp(x*sqrt(2))-1, 1-exp(-x*sqrt(2)), tanh(x), x<br>
&gt;&gt;<br>
&gt;&gt; I put the plain &#39;x&#39; at the end to show what I mean above (though you<br>
&gt;&gt; already know that)<br>
&gt;&gt;<br>
&gt;<br>
&gt; Of course, all the hyperbolic trig functions are made from exp, by<br>
&gt; definition.<br>
&gt;<br>
&gt; <a href="http://en.wikipedia.org/wiki/Hyperbolic_function" target="_blank">http://en.wikipedia.org/wiki/Hyperbolic_function</a><br>
&gt;<br>
&gt; Another use of exp is the sigmoid function used in biology, that can be<br>
&gt; used to make a soft transition from one state to another as in &#39;fuzzy<br>
&gt; logic&#39;.<br>
&gt;<br>
&gt; Martin<br>
<br>
<br>
<br>
Sorry I don&#39;t know (jet) how to answer a mail from the archives.<br>
<br>
The soft clipping in a normal analogue guitar distortion (like the tube<br>
screamer) comes from the diodes (tubes are warmer). Which have log<br>
written over them (their resistance depending on V). (Are even used some<br>
time as a simple analogue log function)<br>
<br>
A analogue guitar distortion is build via a feedback loop like this:<br>
<br>
|--var resistor (gain)<br>
|----  -&gt;diode -|<br>
|----  &lt;-diode -|<br>
|----cap as lp -|<br>
|               |<br>
|------ (-)     |<br>
       op-amp---|---out<br>
input-- (+)<br>
<br>
The resistor defines the max gain<br>
The cap is used as a lp (short cuts high frequency&#39;s to a gain of 1)<br>
<br>
An op-amp tries to have always the same voltage at both inlets.<br>
Which means if you have 1v at + it increases its output till you have 1v<br>
at - as well. 1+(-1)==0<br>
<br>
And finally the diodes:<br>
At negative voltages they blockade completely<br>
At low voltages they have a high resistance so the gain of the resistor<br>
counts. At around .7V their resistance drops leading to a lower gain.<br>
<br>
With a tanh(sig) you are simulating the diodes in a simple way.<br>
What usually is forgotten in the digital domain is the lp filtering. You<br>
may want to split your signal into a high and low part. Run the low part<br>
through the tanh and sum it later up with the high part.<br>
<br>
It gets really funny if you want to try to model the whole feedback loop<br>
in something like pd. There is a mess of phase changes and whatnot which<br>
surely is part of the interesting analogue sound.<br>
<br>
<br>
An important thing to mention is that, as someone else noted, you need<br>
to (should) oversample to avoid aliasing with high order functions. Tanh<br>
is one of the worst because it generates very high harmonics.<br>
Where in the analogue field a natural lp filtering happens all the time<br>
(and no aliasing can occur). As an Example: An opamp has a frequency<br>
response up to GHz. But only at a gain of 1. The higher the gain the<br>
lower the frequency response.<br>
<br>
I&#39;m bad at explaining things. But if you want to i can search my<br>
bookmarks for the analogue or digital sources i tried to explain here.<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
<font color="#888888">UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</font></blockquote></div><br>