[sdiy] Low Frequency Square to Sine Waveshaper
ASSI
Stromeko at nexgo.de
Tue May 27 21:46:43 CEST 2008
On Dienstag 27 Mai 2008, Paul Perry wrote:
> Boring or not, that EDN circuit is only 4 bits, so it's going to be
> very lumpy indeed.
I shouldn't make such obtuse jokes, sorry - but I find the stuff they've
left out is almost more interesting than what is written in such
articles... As a thought provoking device they are quite useful
however and once in a while they might even solve the problem at hand
without further ado.
> How difficult would it be to extend the principle to 12 bits say?
> (impossible for a non-mathematician like myself, but there is
> obviously Talent on this list..)
Due to the symmetry properties of the sine wave the arrangement as shown
in EDN is actually quite good and not easy to improve without a lot
more effort (does "diminishing returns" ring a bell?). Hang on, I'll
try to explain. The Walsh coefficients for the first 64 Walsh
functions (the 0th would be for any DC component, which is of course
not present in these signals) for the "standard" waveforms (normalized
to amplitude 1.0) are:
n Sine Cosine |/| Saw /|/ Saw Sin-Tri Cos-Tri
0 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
1 0.63662 0.00000 -0.50000 0.50000 0.50000 0.00000
2 0.00000 0.63662 0.00000 0.00000 0.00000 0.50000
3 0.00000 0.00000 -0.25000 -0.25000 0.00000 0.00000
4 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
5 -0.26370 0.00000 0.00000 0.00000 -0.25000 0.00000
6 0.00000 0.26370 0.00000 0.00000 0.00000 0.25000
7 0.00000 0.00000 -0.12500 -0.12500 0.00000 0.00000
8 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
9 -0.05245 0.00000 0.00000 0.00000 0.00000 0.00000
10 0.00000 -0.05245 0.00000 0.00000 0.00000 0.00000
11 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
12 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
13 -0.12663 0.00000 0.00000 0.00000 -0.12500 0.00000
14 0.00000 0.12663 0.00000 0.00000 0.00000 0.12500
15 0.00000 0.00000 -0.06250 -0.06250 0.00000 0.00000
16 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
17 -0.01247 0.00000 0.00000 0.00000 0.00000 0.00000
18 0.00000 -0.01247 0.00000 0.00000 0.00000 0.00000
19 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
20 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
21 0.00517 0.00000 0.00000 0.00000 0.00000 0.00000
22 0.00000 -0.00517 0.00000 0.00000 0.00000 0.00000
23 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
24 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
25 -0.02597 0.00000 0.00000 0.00000 0.00000 0.00000
26 0.00000 -0.02597 0.00000 0.00000 0.00000 0.00000
27 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
28 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
29 -0.06270 0.00000 0.00000 0.00000 -0.06250 0.00000
30 0.00000 0.06270 0.00000 0.00000 0.00000 0.06250
31 0.00000 0.00000 -0.03125 -0.03125 0.00000 0.00000
32 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
33 -0.00308 0.00000 0.00000 0.00000 0.00000 0.00000
34 0.00000 -0.00308 0.00000 0.00000 0.00000 0.00000
35 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
36 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
37 0.00128 0.00000 0.00000 0.00000 0.00000 0.00000
38 0.00000 -0.00128 0.00000 0.00000 0.00000 0.00000
39 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
40 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
41 0.00025 0.00000 0.00000 0.00000 0.00000 0.00000
42 0.00000 0.00025 0.00000 0.00000 0.00000 0.00000
43 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
44 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
45 0.00061 0.00000 0.00000 0.00000 0.00000 0.00000
46 0.00000 -0.00061 0.00000 0.00000 0.00000 0.00000
47 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
48 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
49 -0.00622 0.00000 0.00000 0.00000 0.00000 0.00000
50 0.00000 -0.00622 0.00000 0.00000 0.00000 0.00000
51 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
52 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
53 0.00258 0.00000 0.00000 0.00000 0.00000 0.00000
54 0.00000 -0.00258 0.00000 0.00000 0.00000 0.00000
55 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
56 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
57 -0.01295 0.00000 0.00000 0.00000 0.00000 0.00000
58 0.00000 -0.01295 0.00000 0.00000 0.00000 0.00000
59 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
60 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
61 -0.03128 0.00000 0.00000 0.00000 -0.03125 0.00000
62 0.00000 0.03128 0.00000 0.00000 0.00000 0.03125
63 0.00000 0.00000 -0.01562 -0.01562 0.00000 0.00000
I hope you see how the symmetry present in the signal maps to which
Walsh coefficients are non-zero. The ramp functions don't need
anything else but binary weighted square waves of successively doubling
frequency for their approximation as anybody who has watched the output
from a binary counter can attest. That's your cue as to where the
square waves coming from the 4040 are present in the table. Now if you
multiply (and that operation maps to an XOR operation in the circuit)
any Walsh function W_n with W_1, then you get W_(n-1). That's the
second cue you need to decipher the EDN circuit.
Equipped with that information one sees that the EDN circuit actually
approximates a cosine, this is done via the XOR arrangement with Q4,
which consequently is associated with W_1. So the inputs to the opamp
are W_2, W_6, W_14 and W30, which are incidentally the only positve
coefficients in the series (anything negative would have to go to the
other input of the opamp). This is the moral equivalent of
approximating the first 180° of a cosine with just square waves (which
are sometimes called Rademacher functions), hence my original quip. If
you plug into the above series you'll come up with different resistor
values; I haven't conclusively figured out why (I think they've tried
to compensate for the output resistance of the XOR switches, which
would compute to about 5k with their choice of values). There are four
negative terms W_10, W_18, W_22 and W26 which would improve the
approximation quality but not the resolution in time, but unfortunately
these require a three level deep XOR tree (four terms), which would
mean adding three 4030 for not much of an improvement.
Doubling the resolution in time is possible at the expense of another
4030 (~300k on that output), but the approximation error is already
larger than the extra precision afforded by adding that term. Still,
going to "12bits", that is using all the available outputs from the
4040 (but no XOR tree for producing higher order Walsh terms) needs two
more 4030 with approximately double the resistor value into each
consecutive stage, so the last one is close to 10MOhm and you'd have to
match the resistors to 100ppm for this to be of any practical use.
Also you'd have to make sure that the noise sources in the system
woudn't swamp that, either. Also keep in mind that the 4040 is a
ripple counter and the switching instants just won't line up nicely
enough, adding quite a bit of glitch noise all by itself.
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk]>+
SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada
More information about the Synth-diy
mailing list