Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » Effects
Thread Read
Why do amp sims have to generate aliasing?
Goto page 1, 2  Next
@midnight
KVRAF
- profile
- pm
PostPosted: Sun May 06, 2012 10:45 am reply with quote
Because guitar amps + cab tend to roll off around 5-6k, and my understanding is that aliasing has to do with nyquist and foldback distortion. But surely you can fit the entire range of harmonics of a guitar amp + cab within the 22.05khz spectrum afforded by 44.1khz? Is there something I am missing? Is it because they are modeling the distortion of the preamp before the cab, which would generate very high frequency harmonics?

If so they could just simply raise the low pass filter, I mean surely anything about 10khz would be completely irrelevant for electric guitar, and you would only need a 22khz sampling rate to capture 10khz.
^ Joined: 22 Apr 2011  Member: #255222  Location: The House of Zaid
quintosardo
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Sun May 06, 2012 10:54 am reply with quote
Generating a strong harmonic series and stopping it before an upper frequency limit is rather hard to do, but not impossible Smile
----
Electronics and music: www.sknote.it
Recording in Italy: www.skstudio.it
^ Joined: 15 Jul 2004  Member: #33271  Location: Italy
meloco_go
KVRist
- profile
- pm
PostPosted: Sun May 06, 2012 3:53 pm reply with quote
@midnight wrote:
Is it because they are modeling the distortion of the preamp before the cab, which would generate very high frequency harmonics?

Well, even 5th harmonic is hard to handle -- e.g. 5x5khz is 25khz...
And yeah, preamps may generate much higher than that.

Quote:
If so they could just simply raise the low pass filter, I mean surely anything about 10khz would be completely irrelevant for electric guitar, and you would only need a 22khz sampling rate to capture 10khz.

Not sure what you mean hear, but I bet not many players would be happy if you cut everything above 10k. Not much above 10k is different than nothing above 10k!
^ Joined: 21 Sep 2008  Member: #189780  
lfm
KVRAF
- profile
- pm
PostPosted: Sun May 06, 2012 11:11 pm reply with quote
Could it be that everything from 24bit integers and upwards, which is internal handling in plugins, are ok, but everything is to be 16bit in the final version, and thereby need handling with sinc interpolation or other?
^ Joined: 22 Jan 2005  Member: #55586  Location: Sweden
Burillo
KVRian
- profile
- pm
PostPosted: Sun May 06, 2012 11:37 pm reply with quote
lfm wrote:
Could it be that everything from 24bit integers and upwards, which is internal handling in plugins, are ok, but everything is to be 16bit in the final version, and thereby need handling with sinc interpolation or other?

bitrate has nothing to do with aliasing
----
From Russia with love
^ Joined: 15 Nov 2006  Member: #128553  Location: Hell
tetsuneko
KVRist
- profile
- pm
- www
PostPosted: Mon May 07, 2012 12:11 am reply with quote
If you look at an audio signal with a frequency analyzer, things get pretty rough pretty fast when applying distortion to a signal. I can get signals that require a 96kHz sampling rate to capture quite easily with even modest levels of saturation, for signals that would have easily fit the 44kHz sampling rate freqband if left unsaturated..
^ Joined: 20 Apr 2004  Member: #21935  Location: hki-fi
@midnight
KVRAF
- profile
- pm
PostPosted: Mon May 07, 2012 7:18 am reply with quote
tetsuneko wrote:
I can get signals that require a 96kHz sampling rate to capture quite easily with even modest levels of saturation, for signals that would have easily fit the 44kHz sampling rate freqband if left unsaturated..


What does that mean?

"I can get signals that require a 96khz sampling rate to capture quite easily"

"with even modest levels of distortion"

"For signals that would have easily fit the 44khz sampling rate freqband if left untreated"

I do not understand your sequence of words
^ Joined: 22 Apr 2011  Member: #255222  Location: The House of Zaid
earlevel
KVRist
- profile
- pm
- www
PostPosted: Mon May 07, 2012 9:46 am reply with quote
@midnight wrote:
Because guitar amps + cab tend to roll off around 5-6k, and my understanding is that aliasing has to do with nyquist and foldback distortion. But surely you can fit the entire range of harmonics of a guitar amp + cab within the 22.05khz spectrum afforded by 44.1khz? Is there something I am missing? Is it because they are modeling the distortion of the preamp before the cab, which would generate very high frequency harmonics?

If so they could just simply raise the low pass filter, I mean surely anything about 10khz would be completely irrelevant for electric guitar, and you would only need a 22khz sampling rate to capture 10khz.


It's not about what comes out, it's about what goes in, and what gets created...

First, the sound coming off your single coil is greater than 5-6k bandwidth, and if you have a distortion pedal in front of the amp, you have heck of a lot of high harmonics. But let's simplify and just look at a naked guitar string:

An important part of the amp simulation is overdrive/distortion. For tube simulation, generally, people use a soft clipper, but it's easier to consider the simple case of hard clipping. Clipping generates high harmonics—you could guess that by chopping off the tops of waveforms, you've added harmonics. From this point, I think everyone I've ever heard try to describe the effect has said something about things looking like square waves, and square waves exceed Nyquist and therefore...(and some hand-waving follows—it's inevitable, because there's not much you can say for certain about these supposed sort-of square waves).

I think it's clearer if you look at it in the time domain instead of the frequency domain. Think about how it would look in the analog domain first: When you increase a signal until it hard clips, the point where it makes that hard corner doesn't necessarily line up with sample points. But when you clip in the digital domain, it must—so those many sharp corners of a heavily clipped signal get pushed to the next sample boundary.

It would be easier with a picture, but do this either literally, or mentally: Pull up a plot of a recorded waveform, stretched out so you can see the wave clearly (maybe take a snapshot of a file in Audacity). Put in PhotoShop, and put an imagine of graph paper, or at least regularly-space vertical lines, on a background layer.

Now, on on another layer, draw a horizontal line, and drag it down so that it's cutting through the waveform. Do all of the points the horizontal line crosses land on vertical lines (sample boundaries)? That would be pretty unlikely.

So, if you wanted to see what the digital version on that clipping would look like, you'd erase everything above the line, and you'd need to move the point where it hits the horizontal line to the right so that it coincides with the next sample point (vertical line).

Now consider the effect on the sound: Let's say your guitar note isn't an exact multiple of the sample rate. The first positive-going hit lands 30% of the way between samples. The next cycle lands 70%. Both will get pushed to the next whole-number sample. The next would be at 10%...if you look at where they land, and count the samples between them, you'll find that the fractional distance is being approximated by jittering back and forth between between integer distances. A term for that is frequency modulation (FM). You'll hear it as sum and difference tones. Another word for what's happening is aliasing.

How to fix it? One way is to note that we could get closer and closer to analog perfection by going for a higher and higher sample rate—finer graph paper in our image experiment.

That's how amp sims work. They drive up the sample rate via oversampling before the clipping stage. Then they filter the signal to get rid of those hard edges, and down sample.

Yes, you can never get rid of the aliasing. But recognize that the aliasing will be the worst when it is the most clipped—which is also the most difficult condition to hear the aliasing—it gets drowned out by all that dammed distortion Upside Down

(OK, why can't we just skip it then? The aliasing is too strong at lower sample rates—when you bend a note up, you'll hear the aliasing bend down!)

From there, the sound gets run through the cabinet filters and end up with the 5-6k you referred to.
^ Joined: 04 Apr 2010  Member: #229147  
lfm
KVRAF
- profile
- pm
PostPosted: Mon May 07, 2012 11:13 am reply with quote
Burillo wrote:
lfm wrote:
Could it be that everything from 24bit integers and upwards, which is internal handling in plugins, are ok, but everything is to be 16bit in the final version, and thereby need handling with sinc interpolation or other?

bitrate has nothing to do with aliasing


I assume that all artifacts created from discrepancies between digital wave signal and true analogue would be aliasing.

Is that wrong?

It's the same with graphics where there is a difference between a pixelized image and original.

Anti-aliasing processing is then creating interpolation between pixels on information around it, and creating new coloring that will smooth things out having it apperar more smooth edge to the eye.

But I may be using the wrong terms.
^ Joined: 22 Jan 2005  Member: #55586  Location: Sweden
earlevel
KVRist
- profile
- pm
- www
PostPosted: Mon May 07, 2012 12:02 pm reply with quote
lfm wrote:
Burillo wrote:
lfm wrote:
Could it be that everything from 24bit integers and upwards, which is internal handling in plugins, are ok, but everything is to be 16bit in the final version, and thereby need handling with sinc interpolation or other?

bitrate has nothing to do with aliasing


I assume that all artifacts created from discrepancies between digital wave signal and true analogue would be aliasing.

Is that wrong?


"Finite word length effects" (using a inadequate number of bits) produces noise (of the hiss variety). Think about it: sample amplitude will be off by a random amount (seemingly)—equivalent, functionally, to adding random noise to an otherwise pristine signal.

On the other hand, aliasing happens because of quantization in on the horizontal axis—the time domain.

So, inadequate word length gives you noise because you can't place the sample amplitude exactly where you want it. Inadequate sample rate give you aliasing because you can't place a sample exactly where you want it in time (hence you can't represent the frequency you want).
Last edited by earlevel on Mon May 07, 2012 12:22 pm; edited 1 time in total
^ Joined: 04 Apr 2010  Member: #229147  
earlevel
KVRist
- profile
- pm
- www
PostPosted: Mon May 07, 2012 12:20 pm reply with quote
lfm wrote:
...It's the same with graphics where there is a difference between a pixelized image and original.

Anti-aliasing processing is then creating interpolation between pixels on information around it, and creating new coloring that will smooth things out having it apperar more smooth edge to the eye.

But I may be using the wrong terms.


For images, the number of bits per pixel gives you the color accuracy. With fewer bits, you can represent fewer colors accurately (so you end up dithering to get a mix of colors that average out somewhat).

And for images, the resolution (pixels per inch) dictates how sharp your details can be (and how much aliasing there is). Trying to represent a diagonal line or small features accurately, you could dither (to blur them, essentially).

Maybe the reason you're associating word length with aliasing in audio is that for images, the cure is dither for both pixel depth and pixel sample rate.

Also, at really small word sizes in audio, and at low amplitudes—such as fading out 8-bit samples—you get such severe distortion that it sounds like aliasing. For example, a low level sine wave would behave as if it were being clipped at the 1-bit level, which would give you aliasing. So yes, aliasing could happen to a small degree at really low levels, but only pathetic word sizes that no one uses any more. A much tinier bit of it happens at 16-bit (again, only on low-volume tails—so low you'll hear it as harshness and not aliasing, if you can hear it) when truncating from 24-bit, but we dither for that.
^ Joined: 04 Apr 2010  Member: #229147  
Tubeman
KVRist
- profile
- pm
PostPosted: Mon May 07, 2012 12:51 pm reply with quote
Burillo wrote:
bitrate has nothing to do with aliasing

You mean bit depth (the word length) which is different than bit rate (bps, data rate).

Someone mentioned the high frequency content generated when overdriving/clipping the signal in tube amps. Generally every guitar amp has a RC lowpass filter between the gain stages, otherwise it would sound really fizzy and even the output transformer has some rolloff usually. Hifi amps for music listening are a different matter though.
----
"How many of us do you have to kill - to keep us safe?"
^ Joined: 05 Sep 2003  Member: #8832  
earlevel
KVRist
- profile
- pm
- www
PostPosted: Mon May 07, 2012 1:49 pm reply with quote
Tubeman wrote:
Burillo wrote:
bitrate has nothing to do with aliasing
Someone mentioned the high frequency content generated when overdriving/clipping the signal in tube amps. Generally every guitar amp has a RC lowpass filter between the gain stages, otherwise it would sound really fizzy and even the output transformer has some rolloff usually. Hifi amps for music listening are a different matter though.


Amp sims do this too. For instance, you want to roll off as much as you can ahead of the first gain stage and soft clipper. The amount of rolloff can track the gain, too, so that as you crank to drive into the gain stage, you roll off more highs. That way, you can keep all the highs you need for clean sounds, but when you crank up the overdrive, you can dump some of the highs, since you know that the highs from distortion will overwhelm and mask the original signal's high harmonics anyway. Dumping unnecessary highs helps reduce aliasing.

Also, since you are going to hit huge gain (potentially, for the modern high-gain amp leads), a 16-bit input signal is going to look pretty pathetic (OK, think about maybe 90 dB gain on a 16-bit signal that only has 96 dB s/n to start in the best possible case). You'll need a better ADC than that.
^ Joined: 04 Apr 2010  Member: #229147  
VariKusBrainZ
KVRAF
- profile
- pm
- e-mail
PostPosted: Tue May 08, 2012 8:12 am reply with quote
tetsuneko wrote:
I can get signals that require a 96kHz sampling rate to capture quite easily with even modest levels of saturation, for signals that would have easily fit the 44kHz sampling rate freqband if left unsaturated..


And theres your answer...
simply sample at a higher rate to capture a larger range of frequencies and a happy biproduct for muscians is that the latency will drop too Very Happy
----
Just face it, you have no idea how to use the software youve just bought
^ Joined: 16 Dec 2002  Member: #5022  Location: over there
guitarzan
KVRian
- profile
- pm
- e-mail
PostPosted: Tue May 08, 2012 10:17 am reply with quote
It all kind of makes me wonder if digital is really the ultimate realm for audio...so, sure - one day fairly soon sample rates will probably routinely be so high that most artifacts are inaudible, but that still seems like doing it the hard way using brute strength.

It just seems like there must be some way to record analog to a new solid-state medium but still have digital control over the signal.

Unobtainium maybe? Wink
^ Joined: 03 Sep 2005  Member: #80091  Location: far outer Bongolia
All times are GMT - 8 Hours

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