Few suggestions:
If you're looking to antialias basic waveform shapes (sawtooth, square/pulse, etc) then PolyBLEP will pretty much take care of that. PolyBLEP's correction function can be viewed as applying a localised FIR filter around each discontinuity to counter aliasing. Implementations typically use a polynomial function which acts as an impulse response that modifies the signal locally around discontinuities.
If it's arbitrary waveforms then it's a little trickier as you'll want to playback versions of the wave that are band-limited beforehand. Typically you can do this by pre-calculating waveforms using FFT to get into the frequency domain, zeroing bins that exceed Nyquist then converting back to time domain using IFFT. When you playback the band-limited wave you'll general use at least linear interpolation or better still cubic interpolation.
Oh, with regards to arbitrary waveforms (wavetables) you can also store your waveform in frequency domain (via FFT) and use a DFT algorithm directly to pull time domain samples out of it. The advantage here is that you don't need interpolation on playback, the samples are exact. The disadvantages are that you need to optimise using recurrence and SIMD, and even then it can get costly for larger waveform table sizes. There's some posts around here somewhere tracking my effort to implement it which took a few goes - it's quite fiddly. After all that, I decided that by the time you add a unison feature etc it becomes too expensive when playing lower frequency notes.
If you're looking to antialias basic waveform shapes (sawtooth, square/pulse, etc) then PolyBLEP will pretty much take care of that. PolyBLEP's correction function can be viewed as applying a localised FIR filter around each discontinuity to counter aliasing. Implementations typically use a polynomial function which acts as an impulse response that modifies the signal locally around discontinuities.
If it's arbitrary waveforms then it's a little trickier as you'll want to playback versions of the wave that are band-limited beforehand. Typically you can do this by pre-calculating waveforms using FFT to get into the frequency domain, zeroing bins that exceed Nyquist then converting back to time domain using IFFT. When you playback the band-limited wave you'll general use at least linear interpolation or better still cubic interpolation.
Oh, with regards to arbitrary waveforms (wavetables) you can also store your waveform in frequency domain (via FFT) and use a DFT algorithm directly to pull time domain samples out of it. The advantage here is that you don't need interpolation on playback, the samples are exact. The disadvantages are that you need to optimise using recurrence and SIMD, and even then it can get costly for larger waveform table sizes. There's some posts around here somewhere tracking my effort to implement it which took a few goes - it's quite fiddly. After all that, I decided that by the time you add a unison feature etc it becomes too expensive when playing lower frequency notes.
Statistics: Posted by JustinJ — Tue Nov 19, 2024 7:24 pm