If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Reducing aliasing of waveshaping using convolution
14 posts
• Page 1 of 2 • 1, 2
Reducing aliasing of waveshaping using convolution
This is a proof of concept of REDUCING ALIASING OF NONLINEAR WAVESHAPING USING CONVOLUTION
I recently stumbled over that conference paper and implemented the method in my upcoming plug.
However i found it surprisingly efficient compared to the cost of CPU (well, at least if done in C++ )
So i mocked up the given tanh example in fsm to let you guys take a look at it.
Maybe someone wants to dig deeper into this or implement some other waveshaping functions.
The code is absolutely non optimized and much room for improvement is left
The full paper can be found here:
https://www.researchgate.net/publication/308020367
Some interesting related and other projects and papers can be found there as well!
cheers, stw
I recently stumbled over that conference paper and implemented the method in my upcoming plug.
However i found it surprisingly efficient compared to the cost of CPU (well, at least if done in C++ )
So i mocked up the given tanh example in fsm to let you guys take a look at it.
Maybe someone wants to dig deeper into this or implement some other waveshaping functions.
The code is absolutely non optimized and much room for improvement is left
The full paper can be found here:
https://www.researchgate.net/publication/308020367
Some interesting related and other projects and papers can be found there as well!
cheers, stw
- stw
- Posts: 111
- Joined: Tue Jul 13, 2010 11:09 am
Re: Reducing aliasing of waveshaping using convolution
Thanks for sharing this, stw!
Funny I never perceived aliasing in digital distortion as something bad. If anything, it adds some extra dirt and may enhance expression. Anyway, thanks!
BTW it would be interesting to compare this method with oversampling performance wise. If done right with polyphase filters and such, it is not obvious to me which is more efficient.
Funny I never perceived aliasing in digital distortion as something bad. If anything, it adds some extra dirt and may enhance expression. Anyway, thanks!
BTW it would be interesting to compare this method with oversampling performance wise. If done right with polyphase filters and such, it is not obvious to me which is more efficient.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Reducing aliasing of waveshaping using convolution
Not directly related but, thanks to Adam Szabo, I recently discovered Roland’s technique of using a tracking HPF set to the fundamental pitch of an oscillator. This all but eliminates the aliasing frequencies below the fundamental but still keeps the higher enharmonics created and, to my ears, sounds quite nice.
Of course if you don't know the fundmental then you'd have to find it and that takes time, but you could use a look-ahead system I guess.
Cheers
Spogg
Of course if you don't know the fundmental then you'd have to find it and that takes time, but you could use a look-ahead system I guess.
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Reducing aliasing of waveshaping using convolution
Hi Martin,
well i'd say it's a matter of taste. Maybe if you like to have it less digital and more analogueish style it'll become an issue.
Depending on the input source this "extra dirt" sometimes can be annoying. But you're right, in case of wave shaping it's less important than in other effects.
The cost will always be dependant on the antiderivative you get from the original function. I'd guess most times it'll be less expensive compared to oversampling. At least if you're doing it more than 2x.
Anyway, i think it's an interesting concept.
well i'd say it's a matter of taste. Maybe if you like to have it less digital and more analogueish style it'll become an issue.
Depending on the input source this "extra dirt" sometimes can be annoying. But you're right, in case of wave shaping it's less important than in other effects.
The cost will always be dependant on the antiderivative you get from the original function. I'd guess most times it'll be less expensive compared to oversampling. At least if you're doing it more than 2x.
Anyway, i think it's an interesting concept.
- stw
- Posts: 111
- Joined: Tue Jul 13, 2010 11:09 am
Re: Reducing aliasing of waveshaping using convolution
Spogg wrote:Not directly related but, thanks to Adam Szabo, I recently discovered Roland’s technique of using a tracking HPF set to the fundamental pitch of an oscillator. This all but eliminates the aliasing frequencies below the fundamental but still keeps the higher enharmonics created and, to my ears, sounds quite nice.
Of course if you don't know the fundmental then you'd have to find it and that takes time, but you could use a look-ahead system I guess.
Cheers
Spogg
Yes, that's a good approach if you're dealing with synths or other environments which provide single fundamental frequencies. But in case of e.g. an general effect plugin which runs on any audio mix that wouldn't work.
Beside that you always get aliasing above the fundamental frequency too.
- stw
- Posts: 111
- Joined: Tue Jul 13, 2010 11:09 am
Re: Reducing aliasing of waveshaping using convolution
I've played around with pre-filtering with a low-pass filter before the waveshaping. The idea is that the content in the top octave or so will be masked by the harmonics of the distortion and the ear is not very sensitive in this range anyway. You could think of it resampling to half the sample rate and then using 2x oversampling (which is the original sample rate). You can push it a little bit more with guitar amp applications because guitar amp speakers typically roll off quite low.
Maybe something else to add to the tool box.
Maybe something else to add to the tool box.
- Iainmf
- Posts: 10
- Joined: Fri May 01, 2015 7:17 am
Re: Reducing aliasing of waveshaping using convolution
hi stw.
I also was really interested about this paper.
Did you manage to implement higher order kernel schemes ?
I also was really interested about this paper.
Did you manage to implement higher order kernel schemes ?
- francoisreme
- Posts: 29
- Joined: Wed Feb 15, 2017 4:01 pm
Re: Reducing aliasing of waveshaping using convolution
Spogg wrote:Not directly related but, thanks to Adam Szabo, I recently discovered Roland’s technique of using a tracking HPF set to the fundamental pitch of an oscillator. This all but eliminates the aliasing frequencies below the fundamental but still keeps the higher enharmonics created and, to my ears, sounds quite nice.
Hi Spogg, can you where you found "Roland’s technique of using a tracking HPF..."?
-
gvalletto - Posts: 117
- Joined: Fri Jul 09, 2010 10:15 pm
- Location: Argentina
Re: Reducing aliasing of waveshaping using convolution
So I had a closer look at this and I see it a bit different now. After some thorough a/b testing I have changed my mind about the aliasing dirt, I like the clean alias suppressed sound better.
I have also done some comparisons with oversampling, which showed that this method is clearly superior, not only in terms of CPU but, more importantly, in the amount of suppression at high gain. The reason why the convolution method performs so well lies in a subtlety about the particular kernel shape (one sample wide rectangle). The result is, in the continuous time domain, a lowpass filter function with zeros at even multiples of the Nyquist frequency. Now this is very neat, because in the digital domain, these even multiples are folded back to DC, which means that the chosen lowpass filter will suppress low-frequency aliases (the most annoying ones) particularly well. You won't get this with oversampling.
So I tossed a few waveshaping functions and found that the Sigmoid x/sqrt(1 + x^2) results in ridiculously simple math and implementation. I am also including low-CPU implementations of the popular tanh(x) and a hard clipper although I like the sigmoid better. One recent track of mine, "I still remember", may serve as a showcase.
I have also done some comparisons with oversampling, which showed that this method is clearly superior, not only in terms of CPU but, more importantly, in the amount of suppression at high gain. The reason why the convolution method performs so well lies in a subtlety about the particular kernel shape (one sample wide rectangle). The result is, in the continuous time domain, a lowpass filter function with zeros at even multiples of the Nyquist frequency. Now this is very neat, because in the digital domain, these even multiples are folded back to DC, which means that the chosen lowpass filter will suppress low-frequency aliases (the most annoying ones) particularly well. You won't get this with oversampling.
So I tossed a few waveshaping functions and found that the Sigmoid x/sqrt(1 + x^2) results in ridiculously simple math and implementation. I am also including low-CPU implementations of the popular tanh(x) and a hard clipper although I like the sigmoid better. One recent track of mine, "I still remember", may serve as a showcase.
- Attachments
-
- AADistortion.fsm
- (58.68 KiB) Downloaded 1486 times
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
14 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 32 guests