sinusoidal wavefolder

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: luketeaford, lisa, Kent, Joe.

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

sinusoidal wavefolder

Post by guest » Fri Feb 24, 2017 10:37 pm

i put together that barrie gilbert sine-shaper circuit i had discovered while researching for the OTA sine wave shaper paper:

Image

it works as expected, but still needs some tweaking. its pretty fun, but has some glitches at deeper modulation (faster opamps might fix this). it goes about +/-550 degrees before the sine distortion gets bad, and +/-650 before it totally distorts and loses sine shape altogether. in the middle range, it can keep all harmonics below -60dB.

there are two ways to modulate with it. if you modulate the amplitude of the signal going in, it acts like a normal wavefolder, except the output is sinusoid, rather than a ramp wave. if you add an offset to the input, you are phase modulating. i will see about getting some videos up.
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Sat Feb 25, 2017 12:57 am

and here is the transfer function:

Image

it looks more like +/-720 degrees before distortion from this shot.
openmusiclabs.com

Dogma
Super Deluxe Wiggler
Posts: 4140
Joined: Wed Aug 28, 2013 10:46 pm

Post by Dogma » Sat Feb 25, 2017 12:59 am

Really cool :)

Audio?

SoundPool
Veteran Wiggler
Posts: 584
Joined: Sun Nov 16, 2008 11:15 am
Location: Vienna

Post by SoundPool » Sat Feb 25, 2017 4:56 am

looking forward to some audio/video. always on the lookout for interesting wavefolders. the distortion may actually give it some unique charm, no?

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Sun Feb 26, 2017 4:00 am

it took some time to deal with youtube, but here are some quick tests. all of the modulation depths are set with some knob tweaking, so nothing fancy.

[video][/video]

this is a basic run through of transfer function, with a triangle wave being amplitude modulated, as you might use a normal wavefolder.

[video][/video]

this is a triangle wave being offset modulated (phase modulation at the output).

[video][/video]

this is a saw wave being offset modulated with a slow sine wave. you can see tha the output remains a steady sinewave, with only the phase being changed with the modulation.

[video][/video]

this is a saw wave being offset modulated with a fast sine wave, which is more akin to how PM would work.
openmusiclabs.com

User avatar
nd595
Common Wiggler
Posts: 148
Joined: Thu Sep 13, 2012 11:03 am
Location: Spain

Post by nd595 » Sun Feb 26, 2017 6:27 am

Absolutely fantastic! Any chance to see the schematics and to buy a PCB?

mike.synthesizer
Common Wiggler
Posts: 102
Joined: Sun Jul 20, 2014 9:16 pm

Post by mike.synthesizer » Sun Feb 26, 2017 7:36 am

Great job.
We repair amps, pro-audio, and synths!
Chicago, IL USA
http://www.borishelectronics.com

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Sun Feb 26, 2017 1:11 pm

nd595 wrote:Absolutely fantastic! Any chance to see the schematics and to buy a PCB?
once i get things finalized i will post a schematic. the circuit needs to be temperature compensated (well, should be, doesnt necessarily need to be). not sure if i will be making a product out of this or not.
openmusiclabs.com

User avatar
cygmu
Super Deluxe Wiggler
Posts: 1544
Joined: Mon Feb 15, 2016 3:33 pm
Location: UK

Post by cygmu » Sun Feb 26, 2017 2:07 pm

I try to avoid empty congratulations posts but that is absolutely great! So please accept my empty congratulations!

User avatar
cygmu
Super Deluxe Wiggler
Posts: 1544
Joined: Mon Feb 15, 2016 3:33 pm
Location: UK

Post by cygmu » Sun Feb 26, 2017 2:18 pm

Actually, I have a question: is this the article where you found the circuit in question?
B. Gilbert, "A monolithic microsystem for analog synthesis of trigonometric functions and their inverses," in IEEE Journal of Solid-State Circuits, vol. 17, no. 6, pp. 1179-1191, Dec. 1982.
doi: 10.1109/JSSC.1982.1051878

I might try to read it, along with your recent article.

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Sun Feb 26, 2017 2:36 pm

yes, thats the best paper for the topic. he also wrote one 5 years earlier which was an introduction to it called "CIRCUITS FOR THE PRECISE SYNTHESIS OF THE SINE FUNCTION". there are some tradeoffs in the design, mostly with the "bias factor" (how much overlap the differential pairs exhibit). right now im using a bias factor of around 3, which gives theoretical error of 0.2% (my circuit shows -60dB harmonics, which is similar). going to lower bias factors gives lower error, but higher temperature dependency, lower output signal, and a higher ratio between the normal signal (sine in the middle) and the overdrive signal (the saturation at the ends).
openmusiclabs.com

User avatar
pirx
Common Wiggler
Posts: 125
Joined: Tue Dec 04, 2012 7:24 pm
Location: Boston, MA

Post by pirx » Sun Feb 26, 2017 2:39 pm

Fantastic wavefolder! Thank you for sharing this and looking forward to the schematic.

User avatar
maltemark
Ultra Wiggler
Posts: 772
Joined: Tue Dec 16, 2014 11:39 am
Location: Gothenburg

Post by maltemark » Sun Feb 26, 2017 3:20 pm

Very nice PM-like action there. Like!

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Sun Feb 26, 2017 7:36 pm

so here is the current schematic:

Image

im using +10V/-12V rails, and LM358 opamps. the transistsors are PMP4201 matched pairs. ideally all NPNs would be matched, and all PNPs would be matched, but thats not really possible like this.
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Sun Feb 26, 2017 8:03 pm

just did a quick temperature test. the distortion stays about the same over a pretty wide range of temperature. i hit it with the heat gun, and it stayed pretty consistent. the amplitude changed +14% with what was probably +50C temperature change, which is pretty drastic. i think it might be ok without temperature compensation, as amplitude isnt that critical.
openmusiclabs.com

User avatar
Dcramer
Super Deluxe Wiggler
Posts: 5426
Joined: Fri Mar 29, 2013 12:11 pm
Location: Canada

Post by Dcramer » Sun Feb 26, 2017 11:56 pm

Gads! I wish I could buy this! :love:

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Mon Feb 27, 2017 12:44 am

im trying to figure out where the slight glitches at higher modulation come from, and i think its transistor mismatch. if thats the case, then there isnt a too much advantage to using matched pairs over hand matching, except for the very middle section when using it strictly as a sine wave shaper.

this then brings up the question: what would you prefer? a THMT PCB with transistor matching required, or an SMT PCB that is already populated?

i think im going to do a kit for this one, as it seems pretty useful. the circuit can be used to: 1. do low distortion sinewave shaping, 2. act as a quadruple wavefolder, 3. do PM or pseudo FM (there would need to be some leakage on the integrator to avoid slight offset voltages from saturating the modulator).
openmusiclabs.com

User avatar
windspirit
Super Deluxe Wiggler
Posts: 3055
Joined: Thu Sep 20, 2012 11:43 pm
Location: krellifornia

Post by windspirit » Mon Feb 27, 2017 2:09 am

Those transistor pairs are a bit daunting for some, I have soldered them before but they are quite picky. That being said wasn't there recently a thread talking about how difficult it is to match NPN with PNPs by hand? Is it more important to have all of the NPNs matched to the other NPNs and PNPs matched to other PNPs or is it important to have each NPN matched to the corresponding PNP?

Does changing the biasing on U2A (the op amp in a loop with the current source at the very bottom) do anything interesting? I though that it could possibly be another interesting modulation point.

SoundPool
Veteran Wiggler
Posts: 584
Joined: Sun Nov 16, 2008 11:15 am
Location: Vienna

Post by SoundPool » Mon Feb 27, 2017 5:15 am

I don't mind SMD but those transistors look a little tough for me (I do have shaky hands but normally manage to work around it). Also I have ZERO interest in matching transistors, normally I'm not bothered by temp comp so much but when I need them I'm lazy and buy matched pairs. If I don't like to do it through hole I certainly won't want to hand match those tiny things.

I think leaving it small and SMD is nice though, regardless of if that means buying pre-soldered PCB. If it had power footprints for both Euro and MOTM/Serge and a couple caps for clean/regulating power (I'm guessing thats not included on here, right?) its nice that it can be multi-format compatible, or even small enough to be squeezed into something like a stand-alone mini synth. People would still have to run a few wires and make a panel of choice, so its not like it would eliminate it being DIY.

User avatar
J3RK
Super Deluxe Wiggler
Posts: 6648
Joined: Tue Dec 22, 2009 12:46 pm
Location: Seattle

Post by J3RK » Mon Feb 27, 2017 12:34 pm

Wow! That sounds excellent! Probably the smoothest non-digital implementation that I've heard.

:yay:
Are you lemon? Does your head come to a nub?

User avatar
Isaiah
Super Deluxe Wiggler
Posts: 1810
Joined: Wed Jun 02, 2010 6:31 am

Post by Isaiah » Mon Feb 27, 2017 1:26 pm

guest
This is fantastic!

So, the amount of folding is determined by the input amplitude, and adding a DC offset changes the symmetry, right?

A small SMT PCB (2"x2" or 2"x3"?) with 3M mounting holes and Euro/MOTM PSU footprints would be excellent.
Bonus points if you can squeeze an input VCA and mixer (for DC offsets) on there. :hihi:

Again, fantastic. Well done!

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Mon Feb 27, 2017 2:11 pm

windspirit wrote:Is it more important to have all of the NPNs matched to the other NPNs and PNPs matched to other PNPs or is it important to have each NPN matched to the corresponding PNP?

Does changing the biasing on U2A (the op amp in a loop with the current source at the very bottom) do anything interesting? I though that it could possibly be another interesting modulation point.
only the NPN need to be matched to the NPN, and the PNP to the PNP. so no cross-matching required.

the bias on U2A sets the output gain, so that could be an AM point for the whole thing. im not sure how much feedthrough it has, though, or how well it goes to full-off, or effects on distortion at different levels, etc.
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 4483
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Mon Feb 27, 2017 2:22 pm

Isaiah wrote:So, the amount of folding is determined by the input amplitude, and adding a DC offset changes the symmetry, right?

A small SMT PCB (2"x2" or 2"x3"?) with 3M mounting holes and Euro/MOTM PSU footprints would be excellent.
Bonus points if you can squeeze an input VCA and mixer (for DC offsets) on there.
the amount of folding is set by amplitude, but offset changes phase, and not symmetry. basically, the input voltage determines the output phase, so Vout = sin(Vin), where Vin can go from +/-720 degrees. so if you have a saw wave of fixed amplitude that spans 360 degrees, it will make a sine wave. as you add offset, it still makes a sinewave, but instead of going from -180 to +180, it could be 0 to +360, or any other 360 degree span. so at slow modulation rates, you dont notice any change as you add offset. but, as the offset modulation rate increases, you travel over the sine function faster and begin to warp the output, giving that symmetry changing look.

i was thinking about putting 2 inputs, each with a VCA, going to a mixer, and maybe having one be switchable for the pseudo-FM.
openmusiclabs.com

User avatar
Isaiah
Super Deluxe Wiggler
Posts: 1810
Joined: Wed Jun 02, 2010 6:31 am

Post by Isaiah » Mon Feb 27, 2017 3:06 pm

guest
Ah, thanks for the explanation!
Yes, two VCAs and a mixer on the input of the folder would be excellent.
Perfect as a standalone module or as VCO add-on!

User avatar
Isaiah
Super Deluxe Wiggler
Posts: 1810
Joined: Wed Jun 02, 2010 6:31 am

Post by Isaiah » Mon Feb 27, 2017 3:48 pm

Also, what's the ideal input voltage range?

Post Reply

Return to “Music Tech DIY”