PWM on Wavetables

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

PWM on Wavetables

Postby Cyforce on Sun Nov 06, 2011 2:21 pm

Hi there, i tinkered a little bit over the weekend on the stocked pwm modul, for using this basement for wavetables.
But logical there is a problem - if you using analog-shaped waveforms...
Through the non typical digital curve/form of the wave, it comes on pulsewidth setting over 50% to a reduction of the amplitude/extinction(or more a movement to the negativ ration):

PULSE @ 50% WIDTH
Image

PULSE @ 75% WIDTH
Image

So i tryed through a very small change to let the waveform "stay in position" during changing the width setting:
Image

From the optical view, it looks "more correct" i would say, but the difference in sound isn`t really big... which confuses me a little bit, so i attached the ddl, feedback, suggestions are very welcome ;)
Attachments
WT-PWM 01.zip
(1.59 MiB) Downloaded 229 times
http://www.CFA-Sound.com - Sounddesign, Patches, Samples & more
Cyforce
essemist
 
Posts: 152
Joined: Thu Aug 19, 2010 1:36 pm

Re: PWM on Wavetables

Postby infuzion on Sun Nov 06, 2011 4:13 pm

Seems neat!
But I wish you would have attached the OSM; I suspect there is something wrong with the waveforms. Ideally, they should be +1 -1 ballanced, so that the sum of a full cycle nets 0. I don't think your system does that, but it does seem close.
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: PWM on Wavetables

Postby rl on Sun Nov 06, 2011 7:08 pm

I think there will be a little DC offset when the areas below and above the x-axis are not the same (integral of positive parts vs. negative parts). That could be improved using a DC blocking filter (high-pass with very low cutoff freqency)
User avatar
rl
dsp wiz
 
Posts: 1494
Joined: Mon Feb 07, 2005 10:24 pm
Location: de.earth.universe.known

Re: PWM on Wavetables

Postby Cyforce on Mon Nov 07, 2011 8:53 am

From the optical it looks as already said more "neat" with the modded version, but it`s not excactly balanced on 0.0(+/-) but still better as via the stocked version.
The reason why no osm - it`s just a very messy osm inside, just for testing etc, and the tweak is only to set the dc-offset from the basic valume to a specific value, which belows in the fine-setting on the waveform which you are using. :D
So on the optical view, the changing of the dc value looks neat, but technical i`m not sure....

On the first 2 screens in the first post you see the "going down to -1" effect by using the normal stocked pwm with analog waveforms, and every basic waveform(saw) from old synths is different, someones are more in balance, someons are more on the -1 area, so the new dc value belongs everytime to the waveform.

Later the day i will upload a newer osm of that ;)


/btw, is the dc really so important? Like for example "preserve dc" of the wavetable elements, because in the end, it counts only that the sound sounds good to the users, and the little preserve function eats additional cycles, and by using a little army of wavetable oscs, well this could be a point to save cpu usage. By using 10 wavetable osc, without dc preserve i save enough cycles on my laptop to have the "cou cost" for the filter in :D
http://www.CFA-Sound.com - Sounddesign, Patches, Samples & more
Cyforce
essemist
 
Posts: 152
Joined: Thu Aug 19, 2010 1:36 pm

Re: PWM on Wavetables

Postby trogluddite on Mon Nov 07, 2011 3:53 pm

Cyforce wrote:/btw, is the dc really so important?

I would certainly include one, as the effect of DC will depend on how the end user connect the synth.
A offset may not seem to seriously affect your plugin in isolation, but it may have the following negative effects once it is in 'real use' ...

- Disrupt the behaviour of other plugins (either on the synth track or master effects), especially if they are peak-level dependent (e.g. compression,limiting, saturation)
- It will eat up headroom - leading to distortion happening at lower volume levels than normal.
- It could mess up the readings shown on DAW level meters etc.
- More chance of clicks, pops, thumps when using fast attack/release times, or when changing presets etc.

A single DC remover after the oscillators are summed may do the job just as well as one per oscillator, so the CPU load needn't be too high.
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3028
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: PWM on Wavetables

Postby Cyforce on Mon Nov 07, 2011 10:02 pm

So here now an expanded osm, for better comparision.

- stock pwm module
- modded pwm module

the modded pwm module is based on an older posted file from trogluddite if i remind me rightly. there is a dc switch in there, the basic setting was -0.85, by setting it to -0.22 it looks "optical" right, but this value belongs mostly to the used saw waveform(in this case nordlead 2). Behind the osc is also a dc filter(dev 0.18 kit) which makes a quite interesting effect on the analyser by using the mod pwm with -0.22 value... or specially on the mod pwm by using the normal 50% width, which "looks" through the analyser not so ok, what the dc filter is doing...^^

So mhmm anyone with an idea how to make pwm for wavetable/analog waveforms working without this ugly offset/moving down and high...?
Attachments
test-example_wavetable-pwm.osm
(70.67 KiB) Downloaded 253 times
http://www.CFA-Sound.com - Sounddesign, Patches, Samples & more
Cyforce
essemist
 
Posts: 152
Joined: Thu Aug 19, 2010 1:36 pm

Re: PWM on Wavetables

Postby infuzion on Tue Nov 08, 2011 7:35 am

Cyforce wrote:So mhmm anyone with an idea how to make pwm for wavetable/analog waveforms working without this ugly offset/moving down and high...?
I'm a search ninja (actually took 20min to find the stupid thing):
http://www.synthmaker.co.uk/dokuwiki/do ... h_symmetry
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: PWM on Wavetables

Postby rl on Tue Nov 08, 2011 9:30 am

Cyforce wrote:So mhmm anyone with an idea how to make pwm for wavetable/analog waveforms working without this ugly offset/moving down and high...?


I think there is something wrong with your PWM logic. For a test remove all additional offset additions, so that the pwm only adds the original wave with a phase shifted inverted wave: the result looks much better (at least for pulsewidth values < 0.9)
User avatar
rl
dsp wiz
 
Posts: 1494
Joined: Mon Feb 07, 2005 10:24 pm
Location: de.earth.universe.known

Re: PWM on Wavetables

Postby Acrobat on Tue Dec 27, 2011 6:02 pm

Cyforce wrote:So mhmm anyone with an idea how to make pwm for wavetable/analog waveforms working without this ugly offset/moving down and high...?


I think the offset of course depends on the original wave offset, if you downloaded the OSM from this post
download/file.php?id=6511 you'll see that choosing the loop sample start/end of the captured wave I setted an arbitrary offset (that incidentally made me in trouble when adding one another, ATM). I think we should centre the wave BEFORE modulating it... at least that's what I got.. ;)
User avatar
Acrobat
smaniac
 
Posts: 1660
Joined: Mon Jun 04, 2007 10:50 pm
Location: Roma, Italia

Re: PWM on Wavetables

Postby cyto on Tue Dec 27, 2011 8:14 pm

I believe there is an error in the "DC Filter" module of the "test-example_wavetable-pwm.osm" file posted a few replies back. Correct me if I'm wrong but shouldn't it read...

Code: Select all
//out = in - inOld * f * out;//ORIGINAL
out = in - inOld + f * out;//CORRECTED?
inOld = in;

-cyto
User avatar
cyto
essemilian
 
Posts: 317
Joined: Sun Nov 28, 2010 4:36 am
Location: CIN | OH | USA

Re: PWM on Wavetables

Postby Acrobat on Wed Dec 28, 2011 5:05 pm

cyto wrote:I believe there is an error in the "DC Filter" module of the "test-example_wavetable-pwm.osm" file posted a few replies back. Correct me if I'm wrong but shouldn't it read...

Code: Select all
//out = in - inOld * f * out;//ORIGINAL
out = in - inOld + f * out;//CORRECTED?
inOld = in;

-cyto


yeah , your are right, ADD instead of MUL, now it works. :D
User avatar
Acrobat
smaniac
 
Posts: 1660
Joined: Mon Jun 04, 2007 10:50 pm
Location: Roma, Italia

Re: PWM on Wavetables

Postby Cyforce on Tue Jan 03, 2012 12:20 pm

The DC Blocker was from Dev Kit 0.18
http://www.CFA-Sound.com - Sounddesign, Patches, Samples & more
Cyforce
essemist
 
Posts: 152
Joined: Thu Aug 19, 2010 1:36 pm

Re: PWM on Wavetables

Postby Cyforce on Wed Sep 26, 2012 10:52 am

Acrobat wrote:
cyto wrote:I believe there is an error in the "DC Filter" module of the "test-example_wavetable-pwm.osm" file posted a few replies back. Correct me if I'm wrong but shouldn't it read...

Code: Select all
//out = in - inOld * f * out;//ORIGINAL
out = in - inOld + f * out;//CORRECTED?
inOld = in;

-cyto


yeah , your are right, ADD instead of MUL, now it works. :D


Also if it`s an old post, one question concerning the DC blocker is still in my mind. Where would be the best place to place it? On the end, before the combiner, before the filter? etc
http://www.CFA-Sound.com - Sounddesign, Patches, Samples & more
Cyforce
essemist
 
Posts: 152
Joined: Thu Aug 19, 2010 1:36 pm


Return to Sound

Who is online

Users browsing this forum: Google [Bot] and 2 guests