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 sp_TopicIcon
PWM artifacts in QBLimitedOscillator
No permission to create posts
March 13, 2017
5:25 pm
Avatar
niklasb
Member
Members
Forum Posts: 3
Member Since:
March 13, 2017
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.

March 14, 2017
10:18 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
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

March 15, 2017
3:49 pm
Avatar
niklasb
Member
Members
Forum Posts: 3
Member Since:
March 13, 2017
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?

March 15, 2017
5:52 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
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

March 15, 2017
7:24 pm
Avatar
niklasb
Member
Members
Forum Posts: 3
Member Since:
March 13, 2017
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

March 16, 2017
4:56 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Glad you got it fixed! 

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
5 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 477

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 483

Posts: 1877

Newest Members:

Jaggxn, sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143