Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » DSP and Plug-in Development
Thread Read
Using high pass filter to hide aliasing
Goto page Previous  1, 2, 3
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Tue Apr 24, 2012 8:35 am reply with quote
Z1202 wrote:
mystran wrote:
Well, simply take a definite integral over t from -inf to inf for exp(t)*exp(i*w*t). If the result is zero for any w != 0, then all the energy is at DC and any other spectral components must be a result of windowing. Right? Wink
I'm not sure what that smile icon refers to. I assume you're kidding, right?


Actually now that I think of it... there might be a (convergence) problem really..
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Borogove
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Tue Apr 24, 2012 11:45 am reply with quote
davidguda wrote:
Borogove: You might be right that if wont work as good with simpler forms than super saws where the reflected partials are more easily spotted and of course high pass filtering will only get rid of partials reflected back so far that it is under the fundamental note. The idea of using high pass was never thought as a remedy in itself rather just part solution in combination with oversampling.


Probably not worthwhile; the lowest (sub-fundamental) reflected alias partials are the quietest, so once you have a solution (oversampling or otherwise) that makes aliasing inoffensive in the highs, you don't need to worry about the subs.
----

Don't do it my way.
^ Joined: 03 Oct 2002  Member: #3996  Location: SF CA USA NA Earth
camsr
KVRAF
- profile
- pm
PostPosted: Tue Apr 24, 2012 3:21 pm reply with quote
Yet another dead end on the journey to Efficient Audio!
----
^ Joined: 16 Feb 2005  Member: #58183  
Z1202
KVRist
- profile
- pm
PostPosted: Tue Apr 24, 2012 11:45 pm reply with quote
mystran wrote:
Quote:
I think that is the problem. You might as well simply store a bandlimited exponent in a wavetable.


Wait, exponential is not time-limited, so your wavetable would have to be infinite. So it's still useful if you can separate it into a time-limited BLEP + naive exponential (which can be generated recursively).
What I was referring to is a periodically repeating exponential segment (which e.g. occurs if a sawtooth is self-FM-modulated). Apparently, any periodical waveform can be put into a wavetable, right?

mystran wrote:
Quote:

I was more thinking in the direction of generating multiple-order BLEPs, like for a synced sine, for each derivative separately. If the exponent itself, like the sine, is bandlimited, then this approach could work quite nicely.


I think this runs into the same problem as exponentials: you could do it, but if you change the frequency (or phase) then you'd need a new BLEP.
No, that's not right. I'm talking about true BLEPs which simply refer to bandlimited integrals of the Dirac delta (step, 1st derivative break, 2nd derivative break etc). Their amplitudes are defined by the amplitudes of the respective discontinuities (like with a synced sine) and grow simply as powers of frequency. This is also easily adjustable to various "bending parameter" values of the exponent, without the need to regenerate any BLEPs. However the BLEP amplitudes need to decay to zero in order for this to work. You can check here for details:
http://www.native-instruments.com/fileadmin/ni_media/downloa ds/pdf/SineSync.pdf
^ Joined: 11 Apr 2002  Member: #2472  
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Wed Apr 25, 2012 12:53 am reply with quote
Z1202 wrote:

mystran wrote:
Quote:

I was more thinking in the direction of generating multiple-order BLEPs, like for a synced sine, for each derivative separately. If the exponent itself, like the sine, is bandlimited, then this approach could work quite nicely.


I think this runs into the same problem as exponentials: you could do it, but if you change the frequency (or phase) then you'd need a new BLEP.
No, that's not right. I'm talking about true BLEPs which simply refer to bandlimited integrals of the Dirac delta (step, 1st derivative break, 2nd derivative break etc).


Yeah ok, sure you can do that. I was thinking of methods where we could avoid the BLEP summation (ie combine them in advance). I guess I just misunderstood you.
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Z1202
KVRist
- profile
- pm
PostPosted: Fri Apr 27, 2012 12:55 am reply with quote
I'm now wondering, to which extent the multiple-order BLEP antialiasing can be applied to the periodic exp signal, even if it can be considered bandlimited. Intuitively, everything is fine, however formally the thing looks differently. When bandlimiting piecewise polynomial signals we can always do this formally as follows: take one of the pieces (extended infinitely) as a starting signal, which is obviously bandlimited, and then simply add BLEPs of various orders to that. E.g. a bandlimited sawtooth is built from an infinitely long straight line by adding BLEPs of 0th order. The situation is different for the exp, because a periodic exp can't be obtained from a single infinitely long exp by adding BLEPs to it.

We can of course arbitrarily closely approximate the exp segment by a polynomial and then apply BLEP antialiasing to that polynomial. Since BLEP antialiasing worked for the polynomial approximation, it should also do so for the exp. However, consider a sine which is phase-modulated by another sine (DX7-style FM modulation). Such signal is clearly not bandlimited, but also it doesn't have any discontiuities in any derivatives. We could apply the same polynomial approximation trick to that signal (particularly if the frequencies of the sines are related as a ratio of small integers) and apply BLEP anitialiasing there. However, since there are no discontinuities in the derivatives of the approximated signal, the discontinuities of the derivatives in the approximating signal should be also small. That is the BLEP amplitudes should be small, and intuitively we expect the BLEPs to be negligible. Something doesn't add up here Smile

Regards,
{Z}
^ Joined: 11 Apr 2002  Member: #2472  
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Fri Apr 27, 2012 6:05 pm reply with quote
Z1202 wrote:
I'm now wondering, to which extent the multiple-order BLEP antialiasing can be applied to the periodic exp signal, even if it can be considered bandlimited. Intuitively, everything is fine, however formally the thing looks differently. When bandlimiting piecewise polynomial signals we can always do this formally as follows: take one of the pieces (extended infinitely) as a starting signal, which is obviously bandlimited, and then simply add BLEPs of various orders to that. E.g. a bandlimited sawtooth is built from an infinitely long straight line by adding BLEPs of 0th order. The situation is different for the exp, because a periodic exp can't be obtained from a single infinitely long exp by adding BLEPs to it.


You can still treat it as follows: we splice segments of the exp() decay using Heaviside-steps on both sides, then offset and sum those.

Quote:

We can of course arbitrarily closely approximate the exp segment by a polynomial and then apply BLEP antialiasing to that polynomial. Since BLEP antialiasing worked for the polynomial approximation, it should also do so for the exp.


Or in analytic treatment you could just consider the complete series expansion (taylor or whatever), which is supposed to converge to the real exp(). So you'd get a non-terminating series of scaled bleps.. but if scaling the exp() discontinuity is equivalent to scaling the whole blep-series expansion then it makes sense to reason that we can approximate the series (or the residue of exp() which is what the series converges to) directly. I don't feel like prooving it properly right now but I see no reason why it wouldn't work.

Quote:

However, consider a sine which is phase-modulated by another sine (DX7-style FM modulation). Such signal is clearly not bandlimited, but also it doesn't have any discontiuities in any derivatives. We could apply the same polynomial approximation trick to that signal (particularly if the frequencies of the sines are related as a ratio of small integers) and apply BLEP anitialiasing there. However, since there are no discontinuities in the derivatives of the approximated signal, the discontinuities of the derivatives in the approximating signal should be also small. That is the BLEP amplitudes should be small, and intuitively we expect the BLEPs to be negligible. Something doesn't add up here Smile


Yes. I think that's pretty much the same problem as what I mentioned before (in this thread IIRC), when I talked about high-order polynomials approximating spectra above Nyquist directly or something like that. I think it was your suggestion that this might not be a problem because of the frequency dependent scaling of the higher derivatives.

I'm going to return to that problem first, and present some conclusions from empirical evidence: my prototype implementation (of various BLEP techniques) when swept ("slowly") past the Nyquist (I modified it to boost the tuning by a couple octaves up) behaves exactly as predicted by the filter response (the amplitude of the aliased fundamental matches the expected filter attenuation). It currently only does first and second order polynomials, but at least we can conclude that BLEPs appears to be able to get rid of the whole oscillator. [footnote: I just wrote code yesterday that makes it very easy to do arbitrary orders, so I might try something silly like 8th or 16th order polys later just to see how much the filter requirements change with increasing orders]

Now, looking at the polynomial approximation of the FM sine again: if I'm not mistaken, for non-zero Nth order polynomial we can make at most N-2 derivatives (plus the value) continuous at the ends-points of the period. The Nth derivative is constant, but we still have at least one non-constant derivative that can't be continuous (eg typically the linear one, though one could min-max to distribute the discontinuities in multiple derivatives). So the logical hypothesis would be that this derivative would grow large enough to support the band-limiting of the whole wave.

One should also remember that any errors in the approximation will add harmonics into the resulting spectra, which can combine or cancel existing ones. This leads to the following hypothesis: any (single) looped polynomial segment will have a spectra that can be built as a linear sum of (possibly scaled) regular fall-offs in the multiples of 6dB/oct.

It's actually possible to prove the above too (here goes my journal papers.. anyway I don't believe in that crap so you get it free):

Let's start by defining a set of polynomials that I'm going to call the Blep Basis Polynomials (I don't know if I already named them something else but whatever; surprisingly I couldn't find an existing name for this basis, let me know if there's any), namely polynomials such that when the period of the Nth Blep Basis Polynomial is looped over [0,1], we get single periodic discontinuity of magnitude -1 (by convention I just created) in the Nth derivative. As a base case of BBP[-1] we take the constant term 1 [footnote: amateurs index from 0 or 1, real men start from -1].

To construct BBP[n] simply take the indefinite integral of BBP[n-1], with integration constant c. Then take the definite integral of the result over [0,1] and solve for root of c (to prevent step-discontinuity in the next higher-up function), for example:

BBP[0](x) = integral( BBP[-1](x) dx ) = integral ( 1 dx ) = x + c0
0 = integral[0,1]( x + c0 dx ) = 0.5 + c0 -> c0 = -0.5

Hence:
BBP[0](x) = x - 0.5
BBP[1](x) = (x^2 - x)/2 + 1/12
BBP[2](x) = (2*x^3 - 3*x^2 + 2*x)/12
...

It should (hopefully) be obvious that these form a polynomial basis (you can also do other stuff with them like use them as prototype waves for FFT-BLEP construction, which is kinda what I originally defined them for). Since BBP[0] gives saw-wave and rest are just repeated integrations (plus some constant offsets) and by integration as convolution (hence spectral multiplication) we have the required (N+1)*6dB/oct fall-offs. Then by linearity of the basis the hypothesis must hold.

It holds for piece-wise polynomial loops too, with the obvious additions with regards to phases: if you scale and time-offset (which doesn't violate linearity) the looped BBPs we can insert arbitrary discontinuities in any derivative at any point in the period, and since a polynomial (and hence the polynomial segment) is completely defined by it's derivatives we can adjust the derivatives to result in the right polynomial.

Hopefully this should settle the question of whether the BLEP theory works for finite order polynomials. The only open question for generalization to "anything" (using series expansion) is whether the required filter length (for given attenuation) grows as a function of the order. If the filter growth is significant then infinite series might not yield proper attenuation with practical filters, and the increasing spectral fall-off might not help because the magnitudes of the discontinuities might increase just as fast.
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Z1202
KVRist
- profile
- pm
PostPosted: Sun Apr 29, 2012 11:49 pm reply with quote
mystran wrote:
Z1202 wrote:
I'm now wondering, to which extent the multiple-order BLEP antialiasing can be applied to the periodic exp signal, even if it can be considered bandlimited. Intuitively, everything is fine, however formally the thing looks differently. When bandlimiting piecewise polynomial signals we can always do this formally as follows: take one of the pieces (extended infinitely) as a starting signal, which is obviously bandlimited, and then simply add BLEPs of various orders to that. E.g. a bandlimited sawtooth is built from an infinitely long straight line by adding BLEPs of 0th order. The situation is different for the exp, because a periodic exp can't be obtained from a single infinitely long exp by adding BLEPs to it.


You can still treat it as follows: we splice segments of the exp() decay using Heaviside-steps on both sides, then offset and sum those.
Yes, but then it's exactly the same problem. You are not adding BLEPs to a single infinitely long bandlimited function. You are using it to join two different functions.

Quote:
Quote:

We can of course arbitrarily closely approximate the exp segment by a polynomial and then apply BLEP antialiasing to that polynomial. Since BLEP antialiasing worked for the polynomial approximation, it should also do so for the exp.


Or in analytic treatment you could just consider the complete series expansion (taylor or whatever), which is supposed to converge to the real exp(). So you'd get a non-terminating series of scaled bleps.. but if scaling the exp() discontinuity is equivalent to scaling the whole blep-series expansion then it makes sense to reason that we can approximate the series (or the residue of exp() which is what the series converges to) directly. I don't feel like prooving it properly right now but I see no reason why it wouldn't work.
This is more or less what I meant and is exactly what I'm doubting now.
^ Joined: 11 Apr 2002  Member: #2472  
Z1202
KVRist
- profile
- pm
PostPosted: Sun Apr 29, 2012 11:51 pm reply with quote
Quote:
Quote:
However, consider a sine which is phase-modulated by another sine (DX7-style FM modulation). Such signal is clearly not bandlimited, but also it doesn't have any discontiuities in any derivatives. We could apply the same polynomial approximation trick to that signal (particularly if the frequencies of the sines are related as a ratio of small integers) and apply BLEP anitialiasing there. However, since there are no discontinuities in the derivatives of the approximated signal, the discontinuities of the derivatives in the approximating signal should be also small. That is the BLEP amplitudes should be small, and intuitively we expect the BLEPs to be negligible. Something doesn't add up here Smile


Yes. I think that's pretty much the same problem as what I mentioned before (in this thread IIRC), when I talked about high-order polynomials approximating spectra above Nyquist directly or something like that. I think it was your suggestion that this might not be a problem because of the frequency dependent scaling of the higher derivatives.
I'm pretty certain it works for polynomials, for the reasons explained: you are adding BLEPs to a single infinitely long bandlimited function.

Quote:
Now, looking at the polynomial approximation of the FM sine again: if I'm not mistaken, for non-zero Nth order polynomial we can make at most N-2 derivatives (plus the value) continuous at the ends-points of the period. The Nth derivative is constant, but we still have at least one non-constant derivative that can't be continuous (eg typically the linear one, though one could min-max to distribute the discontinuities in multiple derivatives). So the logical hypothesis would be that this derivative would grow large enough to support the band-limiting of the whole wave.
I'm not sure what you're talking about. Surely you can create a bandlimited step in any derivative by adding a respective order's BLEP. Or do I miss anything?

I'll continue reading through your answer later Smile
^ Joined: 11 Apr 2002  Member: #2472  
Z1202
KVRist
- profile
- pm
PostPosted: Wed May 02, 2012 2:40 am reply with quote
mystran wrote:
Hopefully this should settle the question of whether the BLEP theory works for finite order polynomials.
This is more or less what I had in mind when saying BLEP works for polynomials. Your proof is not too convincing though, because of the Dirac delta functions implicitly involved, and one can never be sure, if it's possible to treat them like any other function. A more practically convincing explanation, IMO, is that the interpolations of the polynomials are identical to the polynomials themselves (provided the interpolation has a sufficiently high order). I didn't try to convolve a sinc filter with a polynomial, but I'd guess it would converge to the original polynomial in some (possibly generalized) Cesaro sense.

mystran wrote:
The only open question for generalization to "anything" (using series expansion) is whether the required filter length (for given attenuation) grows as a function of the order. If the filter growth is significant then infinite series might not yield proper attenuation with practical filters, and the increasing spectral fall-off might not help because the magnitudes of the discontinuities might increase just as fast.
Infinite series always leave convergence questions open. The problems start already in the absence of the uniform convergence (or maybe even earlier in some cases), and are definitely likely to occur if the convergence is happening only in the generalized Cesaro sense. For that reason, I was wondering if it's also possible to apply the BLEP theory to the exponentials, FM-modulated sines etc. without having to resort to the polynomial approximations. It's not provable in a straightforward way for the reasons explained earlier.
^ Joined: 11 Apr 2002  Member: #2472  
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Wed May 02, 2012 7:56 am reply with quote
Z1202 wrote:
Your proof is not too convincing though, because of the Dirac delta functions implicitly involved, and one can never be sure, if it's possible to treat them like any other function.


I would argue that we need not consider deltas, we can consider step-functions instead, but fair enough. In Laplace (or Fourier) domain there's no deltas though, and I didn't really try to claim anything about the time-domain properties (which turn out to be well-behaved in practice, but for my purposes that's just a "happy accident"). Note that the periodic extension from step(x)*p(x) to a periodic polynomial segment is just a matter of comb-filtering (which is a linear process, so I don't see that as a problem).

But fair enough.
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
Z1202
KVRist
- profile
- pm
PostPosted: Thu May 03, 2012 3:16 am reply with quote
mystran wrote:
Z1202 wrote:
Your proof is not too convincing though, because of the Dirac delta functions implicitly involved, and one can never be sure, if it's possible to treat them like any other function.


I would argue that we need not consider deltas, we can consider step-functions instead, but fair enough.
I meant the frequency-domain delta, arising in the Fourier transform of the DC offset (or infinitely high values for the Heaviside etc.)

Edit: sorry, I was talking some nonsense there Smile Anyway, what I was getting at, that a step function doesn't really have a Fourier transform in a strict sense. Or, some convergence issues are involved (you need to apply convergence in the Cauchy principal value sense at 0). A higher order BLEP would have even larger convergence problems IIRC.

mystran wrote:
Note that the periodic extension from step(x)*p(x) to a periodic polynomial segment is just a matter of comb-filtering (which is a linear process, so I don't see that as a problem).
Not immediately obvious to me about the comb filtering. Anyway, I'm not sure whether BLEP works in theory even for a step(x)*exp(x) (where step is a jump from 0 to 0), the same for step(x)*step(1-x)*exp(x).
^ Joined: 11 Apr 2002  Member: #2472  
All times are GMT - 8 Hours

Printable version
Page 3 of 3
Goto page Previous  1, 2, 3
Display posts from previous:   
ReplyNew TopicPrevious TopicNext 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
Username: Password:  
KVR Developer Challenge 2012