| Author | Topic: Band-Limited Overlapping Oscillator | ||
|---|---|---|---|
|
|||
Hi,
in the following article an algorithm is presented which acts on an abstract slave oscillator object with a (phase) reset function (or, in a more generic context, any initializable, causal signal), offering deterministic aliasing attenuation of the inharmonic partials present in the oscillator's output based solely on the interpolator design plus a representation of fractionally long periods leading to smooth transitions between successive, integer periods. A fortunate implication, amongst others, is the deterministic and bounded aliasing attenuation of arbitrary-waveform hard-sync (or in another, common to the literature, context, attenuation is independent on the C_n continuity of the slave signal). More details in the article: http://www.sendspace.com/file/opfusm Included is matlab code demonstrating the facts outlined by the article through an example on a sine slave oscillator hard-sync because of it's C_infinity discontinuity. Additionally, a per-sample, object-oriented realization in pseudo-C++ is provided in the article. This is the product of personal, independent research and proofreading was done briefly on IRC (many thanks to Antti Huovilainen and Andrew Simper for that). So, any feedback would be needed and _highly_ appreciated! Thanks in advance! PS: It would be also highly appreciated if some consistent webspace was offered for the article. |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany | ||
|
|||
Hi Gasm,
Looks good on first glance! Will check it in-depth during the holidays. Cheers, P.S.: You'll be happy to know that I used a slightly modified version of your filter in Uhbik/Runciter (see signature) |
|||
| ^ | Joined: 07 Aug 2002 Member: #3542 Location: Berlin | ||
|
|||
Urs wrote: Looks good on first glance! Will check it in-depth during the holidays. Have fun! Will wait for feedback. Urs wrote: P.S.: You'll be happy to know that I used a slightly modified version of your filter in Uhbik/Runciter (see signature) Sounds great! (of course ;). GB |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany | ||
|
|||
Looks interesting, I'll have a proper read over the coming days DSP |
|||
| ^ | Joined: 11 Apr 2003 Member: #6706 Location: now on the flat | ||
|
|||
gasm wrote: A fortunate implication, amongst others,
is the deterministic and bounded aliasing attenuation of arbitrary-waveform hard-sync cool. i was struggling with that kind of problem some time ago - i came up with a minBlep-shaped crossfade...something...it's really a while ago. i'll read the article as soon as time permits. much thanks for posting it. |
|||
| ^ | Joined: 08 Mar 2004 Member: #15959 Location: Berlin, Germany | ||
|
|||
Hey,
article got some equation eye-candying and some spelling corrections. Also, some permanent place found thanks to Andrew Skimper: http://www.vellocet.com/gasm/bloo Cheers, GB |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany | ||
|
|||
Is it hard sync for slave sine? |
|||
| ^ | Joined: 18 Nov 2007 Member: #166014 Location: Estonia | ||
|
|||
kunn wrote: Is it hard sync for slave sine? As it is described in my first post, the matlab example demonstrates the facts in the paper for the sine-slave hard-sync case. The method works for any waveform. |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany | ||
|
|||
Thanks! Got to delve into this one. |
|||
| ^ | Joined: 18 Nov 2007 Member: #166014 Location: Estonia | ||
|
|||
Ok, ultimately took a deeper look into the article. What's not clear to me at all, is why a linear crossfade between two integer periods would produce an antialiased wave? Representing everything as a convolution with sinc is not immediately convincing. Put in an intuitive way, if a convolution of a discrete signal with the sinc was a sufficient condition for no aliasing, then any interpolator of sufficiently high order (e.g. the one in the sound card's DAC) would have removed all aliasing from the signal, which obviously is not the case.
This would have been different, if each of the signals S_floor(P) and S_ceil(P) were convolved with periodic BLITs with periods floor(P) and ceil(P) respectively, because the periodic sampled versions of S_floor(P) and S_ceil(P) are supposed to have all partials above Nyquist suppressed. But it's not so obvious if the convolution is done with a BLIT whose period is P (fractional). [Edit. Correction, that is if S_floor(P) and S_ceil(P) were sampled separately from two different signals with periods S_floor(P) and S_ceil(P) respectively] Do I miss an obvious thing here? Regards, {Z} |
|||
| ^ | Joined: 11 Apr 2002 Member: #2472 | ||
|
|||
Z1202 wrote: What's not clear to me at all, is why a linear crossfade between two integer periods would produce an antialiased wave? If you have a closer look to what exactly the article claims you'll see that it only guarantees that the output produced will be harmonic up to the interpolator's attenuation characteristics; i.e. any inharmonic components present in the output signal which are produced by non-ideal realization of a BLIT are attenuated exactly as predicted by the interpolator used for that realization. This is what "deterministic aliasing attenuation" is supposed to mean. So "antialiased" is quite an imprecise term to start with. Z1202 wrote: Representing everything as a convolution with sinc is not immediately convincing. "Everything" belongs to the field of philosophy which i would suggest we keep out from practical DSP for obvious reasons Z1202 wrote: Put in an intuitive way, if a convolution of a discrete signal with the sinc was a sufficient condition for no aliasing, then any interpolator of sufficiently high order (e.g. the one in the sound card's DAC) would have removed all aliasing from the signal, which obviously is not the case. Your interpretation deviates considerably from what is stated in the article. First, the use of a sinc function stems from the construction of sampling theory and it's infinite in length (except in the discrete-time case if we start sampling at zero). A practical realization is always finite in length having non-ideal FR (Frequency Response) leaking unwanted high-frequency content which folds back and aliases with an attenuation described by the FR. And it's pretty much there in the method, like any real-world method, it's just attenuated exactly by what the the FR suggests and not less. Try to treat a sine discontinuity with a BLEP and you'll see that the integrated impulse response does not attenuate aliasing as it does on a square. So, i don't exactly see from where did you get the idea that i even imply things like "no aliasing" in the practical implementation. The article deals with aliasing attenuation; sinc interpolation is there only for the connection to the theory. Z1202 wrote: This would have been different, if each of the signals S_floor(P) and S_ceil(P) were convolved with periodic BLITs with periods floor(P) and ceil(P) respectively, because the periodic sampled versions of S_floor(P) and S_ceil(P) are supposed to have all partials above Nyquist suppressed. But it's not so obvious if the convolution is done with a BLIT whose period is P (fractional). [Edit. Correction, that is if S_floor(P) and S_ceil(P) were sampled separately from two different signals with periods S_floor(P) and S_ceil(P) respectively] I'm not sure where you're getting at here. For one, it's not clear what you're supposed to do with your two integer-periodic signals from the above. You can of course use a kernel period of any length which will result in again a signal with the same period (in case of causal periodic BLITs periodicity will start after a transition which lasts exactly the length of the kernel minus one). Check my discussion in the article about the generalization in grannular synthesis. The interpolation of the kernel that seems to confuse you is only there to provide a smooth way to change the length of the kernel without discontinuities in the time evolution of the constructed periodic signal, like it happens when the slave oscillator's signal length changes with respect to its reset frequency in hard-sync . Think of it like one of many ways to smoothly interpolate two spectra; luckily in our case the spectra are optimally phase consistent and the cross-fading is just a multiplication. Z1202 wrote: Do I miss an obvious thing here? I think a key part to understand why the final algorithm looks like this is to consider how the exchanging of terms in the summation representation of the convolution formula (11) produces (12) and at the same time creates a quite different interpretation; it's actually the one we use for the efficient implementation of (11). One that consists of properly overlapping and filtered kernels. So, a flipping of terms is what connects the final implementation to our construction of periodic signals using basic sampling theory and it's an essential part in understanding why the whole thing works. |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany | ||
|
|||
gasm wrote: Try to treat a sine discontinuity with a BLEP and you'll see that the integrated impulse response does not attenuate aliasing as it does on a square.
This should be obvious. The classical BLEP is the difference between the ideal and the band-limited (both in continuous-time) step function. You sample the ideal signal, and the difference signal (BLEP) separately, and add them back in discrete time... Since you only need to sample the difference signal when it is non-zero, and squares and saw-waves are basically DC (and hence not modified by an ideal lowpass filter) and periodic discontinuities, the difference signal (BLEP) will only respond to the discontinuities. You can treat discontinuities in the derivatives exactly the same way to get similar results for triangles and the like (though numerical accuracy causes some problems as repeated numeric integration tends to deviate further and further away from the analytic result, introducing errors to the calculated residue). Hard-synced sine can't obviously be treated similarly because the sine has an infinite number of non-zero derivatives. In practice though, you can use a polynomial approximation for the sine (even 3rd order works quite okayish, though purity can be improved by higher order approximations) and construct a full cycle from two half cycles (or more pieces if you want, doesn't matter) the same as for a triangle. Since the polynomial approximation only has a finite number of non-zero derivatives this works just fine. Or you can just do it the lazy way: write a hard-synced triangle oversampled at 2 times, band-limited at half (the oversampled) Nyquist, then use (x-(x^3)/3) to shape it into a wannabe sine, and down-sample with filtering. So while it is true that "you can't apply BLEP to hard-sync sines" you can still apply the BLEP method for hard-syncing approximations of a sine, which need not sound all that different from hard-syncing a true sine-wave.. and can be designed with arbitrarily low harmonic content (use high-order polynomial approximates) and arbitrarily low aliasing (by sufficiently good filter kernel, and sufficiently accurate numeric integrator if you don't feel like solving the residue signals analytically). BLEPs aren't great for syncing "arbitrary" signals, but the "sine-sync" case isn't particularly arbitrary nor hard. |
|||
| ^ | Joined: 11 Feb 2006 Member: #97939 Location: Helsinki, Finland | ||
|
|||
mystran wrote: BLEPs aren't great for syncing "arbitrary" signals, but the "sine-sync" case isn't particularly arbitrary nor hard. The sine-sync is just a particular example/proof of concept that was implemented to demonstrate the effect of the method for exactly the reasons you provided in your post. What i mean in "..it's just attenuated exactly by what the the FR suggests and not less" above is that given an interpolator's impulse response you need infinite successive integrations to converge to the aliasing attenuation that you would achieve if you used the interpolator to resample normally without "resets". What the article investigates is the generalization to any kind of discontinuity and how efficiently that can be implemented. In your post you mention some interesting techniques that apply though to specific classes of waveforms. You can definitely find faster techniques for specific cases but one that works for all in a reasonably efficient manner can be useful in quite some synthesis paradigms like wavetable and even phase distortion and waveshaping. However, there's something i'd like to mention again and has to be clear. The method guarantees that the output is harmonic, any possible components in the slave signal that coincide with harmonics of the BLIT will leak. Harmonicity of the output on the other hand is already a good friend of musicality, compared always to the quite unnatural inharmonic partials that appear after aliasing. |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany | ||
|
|||
gasm wrote: If you have a closer look to what exactly the article claims you'll see that it only guarantees that the output produced will be harmonic up to the interpolator's attenuation characteristics; i.e. any inharmonic components present in the output signal which are produced by non-ideal realization of a BLIT are attenuated exactly as predicted by the interpolator used for that realization. This is what "deterministic aliasing attenuation" is supposed to mean. So "antialiased" is quite an imprecise term to start with. Sorry, my misunderstanding. Still, I think probably the most interesting question here is how much of "harmonic aliasing" is going to appear there. At least, the answer is not immediately obvious to me.
Regards, {Z} |
|||
| ^ | Joined: 11 Apr 2002 Member: #2472 | ||
|
|||
Z1202 wrote: Still, I think probably the most interesting question here is how much of "harmonic aliasing" is going to appear there. This completely depends on the nature of the slave signal and the mechanism that produces it and it refers to the specific case where we want to bring the result as close as possible to the "brute-forced" oversampled case. This will be obvious shortly with an example but after i give a more intuitive explanation of what BLOO really is, which really shows that it's far from fancy. A BLOO is a specific way to perform good old linear filtering on a BLIT, one that suggests specific optimisations because in practice there are a lot of multiplications with zero (it is polyphase filtering). So, in the case of hard-sync which is what we choose to theoretically demonstrate in the article, the IR (Impulse Response) with which we filter our BLIT is the output of the slave oscillator after a reset and before the next. That should answer better your question about the interpolation: the fact that we interpolate the kernels has nothing to do with the any inharmonic aliasing present in the output, since that depends completely on our BLIT quality. The BLOO just combines these two processes and like you put fractionally-delayed impulses in time to produce a BLIT you now do it with fractionally-delayed slave outputs. As for the harmonicity of the output imagine this case: you try for example to hard-sync a sine but the slave oscillator is seriously crappy; say a really small table and linear interpolation. The resulting slave signal as you tune it down (in slave oscillator frequency terms) it will not really look like a sine but as a cruder and cruder piecewise linear approximation of one. Seen in terms of an IR like in the above paragraph, this means that it's a quite different filter than what a good approximation would be. This results in the BLIT been filtered in a different way so harmonics in the output change in amplitude. However, obviously, the output is harmonic and not like it would be if you would let that crappy oscillator ring on its own. Also, as it's also derived from the above, the BLOO comes as overhead in a case where we need a good slave oscillator; but on the other hand, optimisations are quite there and vector-architecture friendly. Overlapping depends on the frequency as the length of each band-limited impulse phase remains unchanged. Mind you, the whole thing evolved when i tried to see grannular synthesis seriously for the first time and realized that what some implementations i'd seen were doing was something not really justifiable - specifically the way they fractionally delay a grain by interpolating according to the grains past and not the actual output's: i.e. zero. You have to assume that around the grains the signal is zero and not what the sample you took it from when you interpolate. This is something that i have seen been done in PSOLA and similar implementations. So, the mathematical formulation of the article came after when trying to justify why the above claims would be true and how. It turns out that this is the way to fully use your interpolator's power assuming we stay always away from FM's waters and also actually treats the hard-sync problem in a rather efficient manner. |
|||
| ^ | Joined: 15 Oct 2003 Member: #9707 Location: Berlin, Germany |
![]() |
All times are GMT - 8 Hours | |
|
Printable version |
||
![]() Previous Topic Next Topic |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum |
Disclaimer: All communications made available as part of this forum and any opinions, advice, statements, views or other information expressed in this forum are solely provided by, and the responsibility of, the person posting such communication and not of kvraudio.com (unless kvraudio.com is specifically identified as the author of the communication).
Powered by phpBB © phpBB Group















