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
Antialias for waveshaping - needed?
Goto page 1, 2, 3  Next
rootbear
KVRer
- profile
- pm
PostPosted: Sun Apr 22, 2012 2:30 pm reply with quote
On this forum and elsewhere I have read about aliasing caused by things like waveshapers, and about countering it with oversampling, filters, or both.
I'm not clear on why any alias is happening, though I am still learning this stuff. Waveshaping is what I am working on, more in the area of guitar tone than a static synth wave.
In the interesting of understanding it better can someone provide me with an example I can implement or some way I can hear that kind of aliasing so I can get an idea of what it is like.
Or is aliasing not an issue for general waveshapers and I'm just misunderstanding?
Last edited by rootbear on Sun Apr 22, 2012 5:21 pm; edited 1 time in total
^ Joined: 07 Feb 2011  Member: #249871  
AdmiralQuality
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Sun Apr 22, 2012 2:44 pm reply with quote
All sounds can be broken down into harmonics, right? A pure sine wave has only one harmonic, its fundamental frequency. But as soon as we distort its shape in any way, we end up adding harmonics above the fundamental. Because that new shape now needs many sine waves to describe it, where originally it was one.

So for any sound, however complex, when we distort it with some kind of non-linearity we end up creating new, higher-pitched frequencies that are harmonics OF the harmonics that were originally present in the sound. (This is why the sound gets "thicker" with distortion, there's more harmonic content!)

And, some of those new, higher harmonics are probably going to be above Nyquist (half the sample rate). As soon as you do that, pow! Aliasing.

What does aliasing sound like? It sounds like unrelated crap. A particularly good way to hear it is a slowly modulating, siren-like sound. Going up and down in pitch. You'd expect all the harmonics to stay in the same relation to each other, but half of the aliases will actually be shifting pitch in the opposite direction. So to make a good aliasing test-tone, try a very high pitched sine wave that's modulating slowly and widely in pitch (like up and down at least an octave, over several seconds). You'll hear aliasing clearly then if you apply non-linear distortion (waveshaping) of any kind.

Make sense?
^ Joined: 10 Oct 2005  Member: #83902  Location: Toronto, Canada
camsr
KVRAF
- profile
- pm
PostPosted: Sun Apr 22, 2012 7:11 pm reply with quote
For a guitar input, I would want it to be oversampled. If the input had only low frequencies and not many overtones, the oversampling wouldn't be as useful.
----
^ Joined: 16 Feb 2005  Member: #58183  
rootbear
KVRer
- profile
- pm
PostPosted: Mon Apr 23, 2012 10:28 am reply with quote
yeah it is pretty clear with the high pitched sine wave. Thanks.
^ Joined: 07 Feb 2011  Member: #249871  
AdmiralQuality
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Apr 23, 2012 1:04 pm reply with quote
rootbear wrote:
yeah it is pretty clear with the high pitched sine wave. Thanks.


Thumbs Up!
^ Joined: 10 Oct 2005  Member: #83902  Location: Toronto, Canada
LemonLime
KVRist
- profile
- pm
- e-mail
PostPosted: Mon Apr 23, 2012 7:51 pm reply with quote
I always liked the wagon wheel analogy. If the rotation period of the wheel exceeds half the cirumference (2pi), we can't tell which way the wheel is rotating, so the "data" gets corrupted in a sense making it look like it's rotating backwards. And this has particular relevance to sound waves as a roating wheel essential generates a sinusoidal wave. So to represent frequencies above half of the sampling rate (Nyquist), would require those frequencies' wheels to rotate faster than 2pi in which case the sound data gets misrepresented in the audio file.
^ Joined: 15 Apr 2012  Member: #278696  Location: Toronto, ON
AdmiralQuality
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Apr 23, 2012 10:04 pm reply with quote
LemonLime wrote:
I always liked the wagon wheel analogy. If the rotation period of the wheel exceeds half the cirumference (2pi), we can't tell which way the wheel is rotating, so the "data" gets corrupted in a sense making it look like it's rotating backwards. And this has particular relevance to sound waves as a roating wheel essential generates a sinusoidal wave. So to represent frequencies above half of the sampling rate (Nyquist), would require those frequencies' wheels to rotate faster than 2pi in which case the sound data gets misrepresented in the audio file.


Yep. Or just imagine the wheels going backwards on wagons in the old movies. Same reason.

Of course, the aliases in the RIGHT direction are all in the wrong places too. But it's easiest to hear the ones going "the wrong way", hence the sine-siren as a great test tone for this kind of thing.
^ Joined: 10 Oct 2005  Member: #83902  Location: Toronto, Canada
duncanparsons
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Tue Apr 24, 2012 10:51 am reply with quote
so if you have things pitched too high, it'll sound like a deranged robot Pinky & Perky speaking backwards.
----
^ Joined: 11 Apr 2003  Member: #6706  Location: now on the flat
stratum
KVRist
- profile
- pm
PostPosted: Mon Jun 04, 2012 4:17 am reply with quote
So.. how much oversampling is needed? I'm not sure that I hear the difference between 4x and 8x uprsampling from 44.1khz. As sampling rate increases I start to mistrust recursive filters used for modelling preamp EQ's and windowed sinc filters used before downsampling. Using oversampling to avoid aliasing is fine but it seems like a compromise must be made to keep other things sane.
----
~stratum~
^ Joined: 29 May 2012  Member: #281392  
cheppner
KVRist
- profile
- pm
PostPosted: Mon Jun 04, 2012 6:46 am reply with quote
AdmiralQuality wrote:
Yep. Or just imagine the wheels going backwards on wagons in the old movies. Same reason.


I became cautious with that analogy when I heard "what do you mean in movies? They always seem to move backwards when you look at them!" - twice!

Wink
^ Joined: 20 Aug 2010  Member: #237880  
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Jun 04, 2012 8:23 am reply with quote
cheppner wrote:
AdmiralQuality wrote:
Yep. Or just imagine the wheels going backwards on wagons in the old movies. Same reason.


I became cautious with that analogy when I heard "what do you mean in movies? They always seem to move backwards when you look at them!" - twice!

Wink


hmm - when the wagon starts, they move forward, then stop, move backward, stop again, move forward again, stop, etc. - or not? it's some time ago that i have seen that kind of movie.
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
AdmiralQuality
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Jun 04, 2012 9:14 am reply with quote
Robin from www.rs-met.com wrote:
cheppner wrote:
AdmiralQuality wrote:
Yep. Or just imagine the wheels going backwards on wagons in the old movies. Same reason.


I became cautious with that analogy when I heard "what do you mean in movies? They always seem to move backwards when you look at them!" - twice!

Wink


hmm - when the wagon starts, they move forward, then stop, move backward, stop again, move forward again, stop, etc. - or not? it's some time ago that i have seen that kind of movie.


Are you guys serious?

The same effect can happen under old style florescent lights, as they're really blinking on and off 120 times a second. (100 times a second for you 50 Hz power people.) But this effect does NOT happen under normal sunlight because you need a strobe -- i.e. a discreet sampling interval -- to see it with your own eyes. Film and video however have a discreet frame capture rate, just like audio has a discreet sample rate.

Here...

http://www.youtube.com/watch?v=vANQlXAmq28

The wheel is obviously moving all the same way, and not suddenly changing direction. The appearance of changing direction, and of different directions for the different parts (the 5 bolts vs. 6 spokes) is aliasing.

(This is also why they used to shun florescent lighting in metal shops. Because it can make a fast spinning machine appear to be moving slowly or even stopped.)
^ Joined: 10 Oct 2005  Member: #83902  Location: Toronto, Canada
Tzarls
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Mon Jun 04, 2012 9:32 am reply with quote
And why does the inner part of the wheel seems to be spinning independently of the outer part?
^ Joined: 11 Feb 2009  Member: #200706  Location: Perú
AdmiralQuality
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Jun 04, 2012 9:36 am reply with quote
Tzarls wrote:
And why does the inner part of the wheel seems to be spinning independently of the outer part?


I already said why. Because the inner part with 5 evenly spaced bolts has a frequency of 5 * rotation speed. And the outer part with 6 evenly spaced spokes has a rotation speed of 6 * rotation speed. So they effectively have different frequencies. And JUST like with audio aliasing, different frequencies will be affected (or should I say, reflected?) in different ways. While some are going up, others are going down.
^ Joined: 10 Oct 2005  Member: #83902  Location: Toronto, Canada
Robin from www.rs-met.com
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Jun 04, 2012 9:37 am reply with quote
Tzarls wrote:
And why does the inner part of the wheel seems to be spinning independently of the outer part?


there are 6 spokes but only 5 screws.
----
^ Joined: 08 Mar 2004  Member: #15959  Location: Berlin, Germany
All times are GMT - 8 Hours

Printable version
Page 1 of 3
Goto page 1, 2, 3  Next
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