Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
PWM artifacts in QBLimitedOscillator
Avatar
niklasb
Member
Members
March 13, 2017 - 5:25 pm
Member Since: March 13, 2017
Forum Posts: 3
sp_UserOfflineSmall Offline

Thanks for a great book!

I'm playing around with the QBLimitedOscillator used in the Nanosynth project. I'm doing PWM by setting the pulse width from outside the oscillator class. I'm using a sine LFO (parabolic) for this, and it's varying the pulse width between 12% and 50%.

At lower LFO frequencies it sounds great, but as soon as the LFO goes beyond 5 Hz I start to get occasional clicks and pops, especially at lower oscillator frequencies.

What causes this? Is it the interpolation that fails to catch discontinuities because the edge of the pulse "is moving too fast"? Or is it something else?

How would you go about solving this problem? My goal is to have it work without artifacts up to at least 12Hz.

Avatar
W Pirkle
Admin
March 14, 2017 - 10:18 am
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

Check out the MiniSynth project which allows you to modulate the pulse-width when you are using the Sqr3 mode of the oscillator (3 square waves). In this case, the LFO modulates pulse width rather than frequency. There are no issues with full depth and up to 20Hz LFO frequency.

- Will

Avatar
niklasb
Member
Members
March 15, 2017 - 3:49 pm
Member Since: March 13, 2017
Forum Posts: 3
sp_UserOfflineSmall Offline

Thanks for the quick reply!

I haven't been able to test the MiniSynth yet (because I have to do a lot of adaptions for the projects to work in my environment), but I looked through the code a bit. It looks like it's using the exact same oscillator that Nanosynth does, only with three of them stacked together -- Is that right? And they all seem to handle the pulse width modulation in parallel, unless I'm reading it wrong? (The LFO is routed to the destination DEST_ALL_OSC_PULSEWIDTH, which will in turn add the same modulation amount to the individual destinations)

So I'm curious how this alone fixes the crackling issue? Is it because the 3 oscs overlap and "smooth things out"? Or is there more to it?

Avatar
W Pirkle
Admin
March 15, 2017 - 5:52 pm
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

Don't know - the 3 stacked together won't change anything. However, the oscillator object is actually different for MiniSynth (mainly to accommodate the modulation matrix). All the objects get changed slightly for the modulation matrix, but I do not recall that the BLEP function changed between synths. That is the only place a problem could occur, I think. 

- Will

Avatar
niklasb
Member
Members
March 15, 2017 - 7:24 pm
Member Since: March 13, 2017
Forum Posts: 3
sp_UserOfflineSmall Offline

I think I've cracked it now!

It seems that my problem was that I was running my PWM LFO at "control rate", i e every 64 samples (something I usually do with LFOs, multiplying the frequency by 64). I tried changing it to update on every sample instead, and now the glitches seem to be gone -- At least I can't hear them anymore!

Thanks again for your time!

/Niklas

Avatar
W Pirkle
Admin
March 16, 2017 - 4:56 pm
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

Glad you got it fixed! 

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 51

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

jim: 34

JimmyM: 33

Gwen: 32

Member Stats:

Guest Posters: 1

Members: 696

Moderators: 1

Admins: 5

Forum Stats:

Groups: 13

Forums: 41

Topics: 757

Posts: 2894

Newest Members:

Jas, Rowan, sojourn, fabhenr, rg1, Niklas, Wutru, Tim Campbell, Danny Jonel, Valentin

Moderators: W Pirkle: 573

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 573, VariableCook: 3