[sdiy] [synth-diy] integer sample period oscillator
cheater00 .
cheater00 at gmail.com
Tue Feb 18 09:21:11 CET 2014
On 18 Feb 2014 05:06, "Scott Nordlund" <gsn10 at hotmail.com> wrote:
>
> > The demos 8-10 and associated descriptions explained the approach
> > wonderfully. However I notice that you seem to limit yourself by
> > keeping the pitch constant during a whole period. Instead, you could
> > dither on sample level. This is not possible with wave tables but is
> > possible with synthesized waveforms.
>
> I think it's preferable in general to keep the frequency constant during an entire period, and only change it where the waveform is discontinuous, or where the waveform's slope is zero, so that it doesn't introduce discontinuities to the slope.
Why? Have you tried? What did it bring?
Bear in mind what I'm suggesting is effectively modulating the signal
going into the phase accumulator. That gets integrated by the phase
accumulator, which roughly means low-pass filtered. I do not have a
good name for that signal - do you? So I'm thinking if that signal
contains aliases, they'll be low-pass filtered. But anyways trying is
more important than contemplating / constipating.
> The noise modulation kind does dither frequency on a per-sample level.
How? I thought what you did was to fix the frequency of each period.
This per-sample thing is lost on me. Can you explain it? Is there a
demo on that forum thread?
> I think another variation that's sometimes used is to add noise to the phase accumulator output, before shaping it into whatever waveform. I think this might help make modulation (i.e. PWM) sound more continuous. I haven't tried it. There are a number of other variations that I should explore...
> > You can also shape the noise, giving it a different distribution. The
> > distribution could cover frequencies other than just the two nearest
> > to the desired frequency. So you don't have to rapidly switch between
> > the two nearest frequencies, you could switch to the two next-nearest
> > as well. And then even less frequently to the next two, etc. The
> > probability of switching to a specific frequency for a sample could be
> > a function of distance of that frequency to the frequency that is
> > desired. This would give you a persistent noise figure whether the
> > desired frequency falls on an allowed frequency or not.
>
> Delta-sigma modulation is used for noise shaping in fractional-n phase locked loops.
I don't know how delta-sigma works in that context. Could you explain
it to me please?
> Depending on the order, it dithers between more than just two frequencies. It's possible to do that here (minus the PLL) but I think it isn't very useful in this application. It's significantly more complicated, with little apparent benefit. It makes more sense, I think, to just add a fixed amount of noise modulation that's equal to the worst case over a desired frequency range, but this ends up being too much at modest sample rates. The noise modulation thing that I'm doing now only adds lots of noise to high frequencies that are between integer periods. I think this doesn't mask the aliasing products as well as delta-sigma modulation, and it isn't terribly rigorous, but it's pretty simple.
If that's the one that has noise bursts during the long pitch slide,
demo #9, then that's definitely not good enough IMO for a good slide.
> I did also make the noise spectrum adjustable without changing the distribution. It's variable between uniform white noise and a slow bounded random walk. Messing with this can make it sound a little better.
>
> I need to take a fresh look at everything again once I finish some other things. I have a few ideas that I haven't tried. The thing that's kind of been confusing me is that it only really makes sense in the static case, with no modulation applied anywhere. Anything with modulation isn't going to be perfectly harmonic, so the higher frequency aliases aren't going to fall back onto the harmonic series. For inharmonic FM, for example, you can constrain the frequencies of the modulator and carrier, but I think all this means is that the frequencies produced will all fall onto the harmonics of the least common divisor of the carrier and modulator frequencies. That's not really helpful. It's not difficult to make PWM that's well-behaved (just subtract two sawtooth waveforms that each have constrained frequencies), but I want to make it work in other cases too, if possible. It's sort of difficult to understand, because variation over time and aliases that fall back onto the harmonic series seem to be contradictory requirements. I don't know if there's a "good enough" compromise here, because I don't really know what that would entail.
Figuring out the way might be helped by a question to someone who
knows PCM and aliasing well enough on a theoretical basis to be able
to say whether mathematically it's possible to get rid of aliasing in
those situations and replace it with something else. I would pick up
some good books and write to their authors.
Cheers,
D.
More information about the Synth-diy
mailing list