| Author |
Message |
befacosynth

Joined: Jul 20, 2010 Posts: 21 Location: Barcelona
|
Posted: Fri Jul 15, 2011 10:24 am Post subject:
pwm in, pwm (half frequency) out [solved] Subject description: how to divide frequency an keep the same duty cycle |
 |
|
hi!
i want to add this to my new vco, but i can't find how, i also don't know if useful in any way, but i want to try; the idea is to take the pwm signal and divide the frequency by two but keeping the same duty cycle, any ideas? _________________ Nueva web y foro sobre sintes en español en
http://www.befaco.org Last edited by befacosynth on Thu Jul 21, 2011 4:11 pm; edited 1 time in total |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1092 Location: West Red Spot, Jupiter
Audio files: 138
|
Posted: Fri Jul 15, 2011 12:07 pm Post subject:
|
 |
|
If you halve the PWM carrier frequency, the high and low sections of each cycle must be twice as long. This will preserve the duty cycle. _________________ FPGA Synth Stuff
FatMan Mods
dsPIC Synth Stuff I am formerly known as ScottG here Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? If butts had nipples, why have tits?
|
|
|
Back to top
|
|
 |
befacosynth

Joined: Jul 20, 2010 Posts: 21 Location: Barcelona
|
Posted: Fri Jul 15, 2011 12:39 pm Post subject:
|
 |
|
but...
how to do this electronically?
Thanks _________________ Nueva web y foro sobre sintes en español en
http://www.befaco.org |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1092 Location: West Red Spot, Jupiter
Audio files: 138
|
Posted: Fri Jul 15, 2011 1:11 pm Post subject:
|
 |
|
If this is a digital thing, it's easy to change the code to do it.
I assume you mean an analog "box" where PWM goes in and comes out at 1/2 the carrier frequency. I could do it with a PIC, but that would be digital - essentially, I would input the PWM on a digital pin and time the high and low phases. I would sample a high, low, high and a low and output a single high and a single low both at twice the time. There would be a 2 cycle lag however.
As for pure analog? Maybe someone eles?
I'm not really sure why you would really want to do this. PWM is always better when the carrier frequency is _higher_, not when it's _lower_. _________________ FPGA Synth Stuff
FatMan Mods
dsPIC Synth Stuff I am formerly known as ScottG here Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? If butts had nipples, why have tits?
|
|
|
Back to top
|
|
 |
ian-s

Joined: Apr 01, 2004 Posts: 2519 Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 584
|
Posted: Fri Jul 15, 2011 3:57 pm Post subject:
|
 |
|
I think he means regular analog pwm as in early roland/arp synths. Typically a comparator is connected to a sawtooth and a modulation source, so it produces a rectangle whose width varies with the modulation voltage.
The effect is a thicker tone than a static rectangle.
Because dividers only toggle on one edge, preserving the duty cycle does not seem to be easy though. Might be possible with some extra logic. Perhaps it would be better to generate a half frequency triangle (by conditionally inverting the sawtooth with the sub square) and add another pwm comparator? You could then have two identical pulse widths or allow each rectangle to be modulated independently. |
|
|
Back to top
|
|
 |
befacosynth

Joined: Jul 20, 2010 Posts: 21 Location: Barcelona
|
Posted: Fri Jul 15, 2011 4:28 pm Post subject:
|
 |
|
that is the idea ian! i make the first pwm from the saw and comparator, but how i can make the second saw without messing all around with a square-to-ramp converter (in a wide vco this is difficult to make well done), what you mean with 'by conditionally inverting the sawtooth with the sub square'?
some like a 'analog logic AND ' perhaps? _________________ Nueva web y foro sobre sintes en español en
http://www.befaco.org |
|
|
Back to top
|
|
 |
ian-s

Joined: Apr 01, 2004 Posts: 2519 Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 584
|
Posted: Sat Jul 16, 2011 1:08 am Post subject:
|
 |
|
A triangle core vco sometimes uses a couple of opamps and a switch (cmos or fet) to create a sawtooth from the triangle wave. The square wave is used to switch the inversion on and off every half cycle.
There is an example on this page which uses the technique to produce both a 1F and 2F sawtooth, the only difference being the offset on the triangle.
If you have a sawtooth core, you could use the same switched inverter with a standard square sub octave (4013?) switching the slope on alternate cycles giving a 1/2 F triangle that you can then make a second pwm output from. Might have to de-glitch the triangle though. |
|
|
Back to top
|
|
 |
befacosynth

Joined: Jul 20, 2010 Posts: 21 Location: Barcelona
|
|
|
Back to top
|
|
 |
|