Using S8 with sample rates higher than the hardware supports? Oversampling the project in Sonar 8?

Page: < 123 > Showing page 2 of 3
Author
Tom F
Max Output Level: -48 dBFS
  • Total Posts : 2749
  • Joined: 2007/07/08 05:56:12
  • Location: Vienna (the one in Europe)
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/17 07:53:05 (permalink)

ORIGINAL: Geokauf

it's about the quality of sound produced by digital effects and synthesizers which is affected by aliasing.

Hello,

I say this statement is patently untrue. And I suspect you have never actually heard "aliasing" to know what it would sound like. Even at 44.1KHz/16 bit you have about twice the fidelity and S/N as the great Studer/Neve, Studer/SSL combination in top world class studios that was used to make thousands and thousands of great albums. As back then, today, everyone is working with the same gear and at the same (dis)advantage. In other words, the bar is the same height for everyone. So how come this is a concern only to you (as I've never heard this issue broached before).

I'd be interested in hearing examples of what you describe (as aliasing) rather than BS'g and beating about the bush. We're talking about the sound of audio and only the sound of audio can be used as an example.

GK



wow - what a demonstartion of great knowledge - guess you are confusing everything as some other wise guys here - the fact alone that you start talking about fidelity and signal to noise ratio of tape machines in this context demonstartes that YOU havent a clue of what you are talking about...id suggest you read some stuff about analog synthesizers and the problems that digital synthesizers have in emulating them (hardware virtual analog or vsti) there are enough vintage digital synths that have a characteristic sound resulting of aliasing - and not only old ones... since you are obviously cunfusing some completetly different things like technical quality requirements for a good reproduction of a signel (yes i mean RECORDING) and the specs that are needed to GENERATE a complex signal in an appropriate way...
insted of talking about the op ****ting anyone you could have also just taken notice of the statement of willy from cakewalk...
as i posted above ... i can understand that you dont get the difference - ok - but if you also claim that you cant hear the difference of a sofsynth playing at 88 and one playing at 44 then you are not only resitant against truth but also deaf...
and only because you have never heard of it before that aliasing is an important phenomenon in signal generation it doesnt mean that its not well known - what are you claiming next "africa doesnt exist cos i have never been there" ???
its starting to really bust my balls that some folks here that probably have been using cakewalk products for ages only like a big tape recorder claim they have knowledge of all sort of audio stuff...

...trying to be polite... quick temper...trying to be...
#31
ChristopherM
Max Output Level: -56 dBFS
  • Total Posts : 1921
  • Joined: 2006/08/18 14:31:42
  • Location: UK
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/17 08:00:07 (permalink)
Even at 44.1KHz/16 bit you have about twice the fidelity and S/N
Aliasing is not solely a function of sample rate or bit depth is it? Whether it is an issue or not depends upon how well low-pass filtering is implemented to ensure that there is little signal above the Nyquist frequency. So you could have a high sample rate but poor anti-aliasing filtering and get poor results. Equally, you could have a lower sample rate and excellent filtering and get excellent results. IIRC, bit depth plays no part whatsoever in determining whether aliasing problems occur.
#32
DaveClark
Max Output Level: -71 dBFS
  • Total Posts : 956
  • Joined: 2006/10/21 17:02:58
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/17 13:26:19 (permalink)
Hi cheater,

In answer to your *original* post:

I have not seen the particular type of program you were asking about, but I also hope you are aware of the possibility that going to higher sample rates in a project can *introduce* aliasing problems (or make them significantly worse) as well as potentially improving them. I saw some fairly good spectral evidence that DPro v. 1.2 makes this kind of error in going to 96,000 samples/sec in loading WAV's via SFZ. You could regard this as actually a bug or some such thing, but you could also regard those "bad VSTi's" you referred to as buggy in that the developer didn't apparently take into account enough factors to avoid such problems. In both cases, you can end up with bad spectra that sound just awful because aliasing popped up for one reason or another. It's really easy to do. I myself have written some bad command-line generators which sound awful at high freqs thanks to aliasing, and I haven't rewritten them because they're still useful for testing purposes at lower freqs. One of these days....

Regards,
Dave Clark

#33
PC1211
Max Output Level: -87 dBFS
  • Total Posts : 167
  • Joined: 2006/08/29 03:56:20
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/17 16:46:23 (permalink)
I think it's a matter of tone. There's a difference between ridicule and debate, and I think that's the point Willy was trying to make. All Willy was saying is that the OP's assertions were worthy of debate.
#34
John
Forum Host
  • Total Posts : 30467
  • Joined: 2003/11/06 11:53:17
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/17 20:48:03 (permalink)
I think it's a matter of tone. There's a difference between ridicule and debate, and I think that's the point Willy was trying to make. All Willy was saying is that the OP's assertions were worthy of debate.
I think you are right about that. Very good point too.

Best
John
#35
DaveClark
Max Output Level: -71 dBFS
  • Total Posts : 956
  • Joined: 2006/10/21 17:02:58
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 02:40:57 (permalink)
Hi everyone,

Ya mention the Devil, and he shows up!

I quite honestly was just working on providing some information on this, so good timing I guess.... Except that I should have been in bed already!!

Hopefully this will help. Please do say something if the zip file is screwed up or something else is seriously foobar'd.

-------------------------

Greetings all,

I put a zip file at:

Alias Stuff

This zip file contains several files:

cm_101_tri.fxp
cm_101_tri_wav.jpg
cm_101_tri_fft.jpg
dominator_tri.fxp
cm_dominator_tri_wav.jpg
cm_dominator_tri_fft.jpg
cm_101_tri_fft_4424.jpg
cm_dominator_tri_fft_4424.jpg
--------
640386 8 files

Computer Music magazine has numerous VST's, VSTi's and samples available every month. CM-101 and CM-Dominator are two regularly featured "free" VSTi's, the only monetary cost being that of the magazine. Both VSTi's can produce pure Triangular waveforms or at least lead the user to believe that they can. The files with "wav" in them show the triangular waveforms; the ones with "fft" in them depict the spectra; the ones ending in "fxp" are the presets for the respective VSTi so that you can verify the settings for Triangular waves yourself. The ones with 4424 in them are from 96,000 samples/sec projects where the waveforms were downsampled to 44,100 samples/sec upon export. I'll discuss these downsampled ones in a moment.

As you should be able to see from the 44,100 samples/sec spectra ("fft" no "4424"), CM-101 displays no visible aliasing artifacts whereas the Dominator one clearly displays prominent aliasing artifacts. (The CM-101 does have a DC component.) The note being played here is G7 in Cakewalk-speak or ~1568 Hz (sorry, it was supposed to be A7). The CM-101 also shows the effects of a strong LPF, whereas the Dominator one cuts in later. The WAV for Dominator clearly shows a very sharply defined triangular waveform. This is bad and suggests that the generator for the triangular waveform is not band-limited --- and it clearly is not. The CM-101 is rounded. This is good; it suggests that the waveform generation is band-limited.

That this is aliasing is demonstrated by the fact that the amplitudes are diminishing according to the Fourier expansion or faster (filtered) and are the odd harmonics, but "bounce" off the wall at the Nyquist limit, so to speak, and continue to diminish travelling now back from right to left. Because the highest amplitudes that are close to each other are at the higher frequencies, the sound is a little to a lot shrill, depending on what note is played. To compute the aliased frequency, simply add the distance from the right-hand side to the Nyquist value 22050 Hz. You should be able to verify that the interval continues to be 1568*2 Hz (recall: odd harmonics).

From the 96,000 samples/sec spectra ("fft" and "4424" --- now log plots to show CM-101 artifacts better) where downsampling was done, you can clearly see that the CM-101 waveform is slightly worse with the very (very, very) low level signals introduced, whereas the CM Dominator one has improved markedly. This latter result is exactly what the OP was getting at in the original post. The former (degraded CM-101) was what I recently posted about, namely that going to higher rates can degrade some VSTi's, though admittedly this particular example is probably inaudible without further processing.

CM-Dominator is actually a really nice sounding VSTi as far as I'm concerned, working at 96,000. Even at 44,100, it doesn't alias nearly as badly as my test signal generators do. My tri generator spectra are just plain filthy.

Regards,
Dave Clark
#36
altima_boy_2001
Max Output Level: -55 dBFS
  • Total Posts : 2033
  • Joined: 2005/11/04 17:48:01
  • Location: Central Iowa
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 02:53:59 (permalink)
I don't think anyone has brought up the fact that today's 44.l K converters sound as good as they do due to massive oversampling rates (at least up to 128x). If it helps there then why would it not be beneficial (in some cases) to do this within the audio engine.

I can understand that if you record a band at 44.1K then simply mix everything without plugins you should not have any problems with aliasing since no frequencies above what is already in the material should be present. But if you start adding plugins that create harmonics/overtones, do pitch shifting, or use any sound simulation/generation plugins then you start adding material that could create aliasing. How can you know for sure that every DSP programmer handles aliasing correctly? If those programs don't handle aliasing correctly at lower sample rates then having the audio engine run them at higher samples rates and letting the audio engine downsample the results could theoretically provide you with a better sounding result. It would act more like a safety net for poor DSP programmers IMO.

Buying hardware that can run at 96/192 kHz is the cheapest and best solution though because it will work in all audio software and not just Sonar. Hardware is generic, but the software solution locks you in. A generic driver implementation on top of the manufacturer's driver (like ASIO4ALL mentioned earlier) seems quite novel since Sonar would "see" your hardware is running much faster than it really is and do processing accordingly. However, it would be interesting to be able to record everything at 44.1K, let Sonar upsample to 4x or 8x on the fly, do the processing, and downsample without having to convert your source files and deal with the disk space issues or the extra time/steps involved by using any of the other solutions.

I'd be more interested in this option out of curiosity than anything else because I work exclusively at 44.1K for everything I do, which is why think it shouldn't be a priority any time soon. Actually, I'd be satisfied if Cakewalk implemented the option as non-audible bounce/export option if that simplified the development effort.

You can use me as your eSoundz referral (altima_boy_2001).
#37
Tom F
Max Output Level: -48 dBFS
  • Total Posts : 2749
  • Joined: 2007/07/08 05:56:12
  • Location: Vienna (the one in Europe)
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 05:20:06 (permalink)

ORIGINAL: DaveClark

Hi everyone,

Ya mention the Devil, and he shows up!

I quite honestly was just working on providing some information on this, so good timing I guess.... Except that I should have been in bed already!!

Hopefully this will help. Please do say something if the zip file is screwed up or something else is seriously foobar'd.

-------------------------

Greetings all,

I put a zip file at:

Alias Stuff

This zip file contains several files:

cm_101_tri.fxp
cm_101_tri_wav.jpg
cm_101_tri_fft.jpg
dominator_tri.fxp
cm_dominator_tri_wav.jpg
cm_dominator_tri_fft.jpg
cm_101_tri_fft_4424.jpg
cm_dominator_tri_fft_4424.jpg
--------
640386 8 files

Computer Music magazine has numerous VST's, VSTi's and samples available every month. CM-101 and CM-Dominator are two regularly featured "free" VSTi's, the only monetary cost being that of the magazine. Both VSTi's can produce pure Triangular waveforms or at least lead the user to believe that they can. The files with "wav" in them show the triangular waveforms; the ones with "fft" in them depict the spectra; the ones ending in "fxp" are the presets for the respective VSTi so that you can verify the settings for Triangular waves yourself. The ones with 4424 in them are from 96,000 samples/sec projects where the waveforms were downsampled to 44,100 samples/sec upon export. I'll discuss these downsampled ones in a moment.

As you should be able to see from the 44,100 samples/sec spectra ("fft" no "4424"), CM-101 displays no visible aliasing artifacts whereas the Dominator one clearly displays prominent aliasing artifacts. (The CM-101 does have a DC component.) The note being played here is G7 in Cakewalk-speak or ~1568 Hz (sorry, it was supposed to be A7). The CM-101 also shows the effects of a strong LPF, whereas the Dominator one cuts in later. The WAV for Dominator clearly shows a very sharply defined triangular waveform. This is bad and suggests that the generator for the triangular waveform is not band-limited --- and it clearly is not. The CM-101 is rounded. This is good; it suggests that the waveform generation is band-limited.

That this is aliasing is demonstrated by the fact that the amplitudes are diminishing according to the Fourier expansion or faster (filtered) and are the odd harmonics, but "bounce" off the wall at the Nyquist limit, so to speak, and continue to diminish travelling now back from right to left. Because the highest amplitudes that are close to each other are at the higher frequencies, the sound is a little to a lot shrill, depending on what note is played. To compute the aliased frequency, simply add the distance from the right-hand side to the Nyquist value 22050 Hz. You should be able to verify that the interval continues to be 1568*2 Hz (recall: odd harmonics).

From the 96,000 samples/sec spectra ("fft" and "4424" --- now log plots to show CM-101 artifacts better) where downsampling was done, you can clearly see that the CM-101 waveform is slightly worse with the very (very, very) low level signals introduced, whereas the CM Dominator one has improved markedly. This latter result is exactly what the OP was getting at in the original post. The former (degraded CM-101) was what I recently posted about, namely that going to higher rates can degrade some VSTi's, though admittedly this particular example is probably inaudible without further processing.

CM-Dominator is actually a really nice sounding VSTi as far as I'm concerned, working at 96,000. Even at 44,100, it doesn't alias nearly as badly as my test signal generators do. My tri generator spectra are just plain filthy.

Regards,
Dave Clark



THANKS DAVE...
i really was hoping some tech info would be provided...
since i wouldnrt be able to describe it in such a clear way - funny enough i had read more than a few articles about the aliasing issues -
thats why i keep "fighting" in this thread...
i have no problem in admitting when i am wrong - but what some people (actuially only cj in the end) are doing here is almost weird...



#38
cheater
Max Output Level: -90 dBFS
  • Total Posts : 28
  • Joined: 2007/04/09 15:14:46
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 08:31:51 (permalink)
Hi guys,
sorry for my absence, I've been busy having holidays ;)

first let me answer the single actual on-topic post in the last 2 pages of this thread...
ORIGINAL: rhythminmind

Hey Cheater.
You need the "cakewalk member filter" on while asking any questions deeper then "is my les paul cooler then your strat?" in this forum. But rest assured your not the only one that understands the differences in DSP processing & tracking samplerates. I track @ 48 & mix @ 96 for this very same reason. This has been common place for some time now.
To get back to your question the only way i could think of getting sonar to run @ a higher rate then your interface would allow is to use some kind of tool like ASIO4ALL that lets the user set the rate. As it's been said i think your best solution is a different interface & up-sample your audio.



Thanks - I tried Asio 4 All as my first bet, but I couldn't find an option to do this. Sonar reports the asio4all driver as only supporting 44.1 and 48 too. Am I missing something?

I have noticed some posts saying that it's very cheap to buy an audio interface that supports 192 kHz. While it may be true, there are two problems with this:

  • I never know where I'll end up. I work on other people's workstation quite often when I'm on the move, and I can't carry my audio interface around all the time.
  • 192 kHz barely addresses the issue with some types of plugins: a foldback distortion with a gain factor of 100 needs internal processing at 3072 kHz or better to avoid very audible aliasing. Yes, this is the worst case scenario, but I like foldback distortion!





Now let's get on with the chutney the thread has dissolved to. First things first, let's keep this thread civil. CJay, I feel attacked by your posts, but you know that already. John, I feel attacked by your posts as well. I came here to discuss the possibility of using a certain technique, I did not come here to prove its effectiveness. I hope you appreciate that other people may have ways of working that differ from yours. I have my way, you have yours, let's keep it that way. I'm not trying to convert you. Please understand that the original post was assuming that this aliasing thing is actually an issue. You are free not to take on that assumption and walk away.

However, rest assured I understand your concern that someone might read my post and get influenced thinking that this is an issue while it in fact may not be so if what you say is right. I respect your concern, but people who take on such things without actually following the steps needed to logically prove or disprove them are bringing trouble onto themselves and I don't feel sorry for their misinformation.

John, all that said, I don't want to show disrespect towards you and have already tried giving some cues as to the technicalities of the subject of aliasing. I will continue to do so.

All posters please refrain from making posts that are purely mocking, or purely rhethoric. You can use PM if you want to request further clarification from someone, without making this thread a big garbage can of posts that are not relevant to anything at all.




ORIGINAL: ChristopherM

Even at 44.1KHz/16 bit you have about twice the fidelity and S/N
Aliasing is not solely a function of sample rate or bit depth is it? Whether it is an issue or not depends upon how well low-pass filtering is implemented to ensure that there is little signal above the Nyquist frequency. So you could have a high sample rate but poor anti-aliasing filtering and get poor results. Equally, you could have a lower sample rate and excellent filtering and get excellent results. IIRC, bit depth plays no part whatsoever in determining whether aliasing problems occur.


Aliasing is only a function of sample rate. Bit depth has a similar, almost dual, problem called decimation. It's interesting Cakewalk were the first to implement a back-to-back 64-bit mixing bus which addresses decimation, but not its dual brother of aliasing.



I will now demonstrate, completely with a short mathematical proof, the extent of aliasing in a very classical situation of playing back a note.
Let us assume a Virtual Analog synthesizer playing back a triangle wave at a high Eb, which has just about the frequency of 12543.8539514160 Hz.
This means any harmonic will fall above the Nyquist frequency (I count harmonics without the fundamental, which is the 0th harmonic in my nomenclature. I clarify this because there are multiple naming schemes)

Let's just consider the first few harmonics. First let us list their amplitudes, which are equivalent of peak-to-peak voltage levels. From the wikipedia article at http://en.wikipedia.org/wiki/Triangle_wave we have the Fourier series for the triangle wave. From there, we have the fundamental which is listed as sin(2pi*f*t), then the third harmonic which is listed as sin(2pi*3f*t) with an amplitude of 1/9 relative to the fundamental, and so on. So, we have amplitudes of 1/(n^2) for further harmonics. The funny ^ wedge means 'to the power of'.

Wikipedia tells us how to find the referential loudness between the fundamental and one of the harmonics: http://en.wikipedia.org/wiki/Decibel#Amplitude.2C_voltage_and_current

Using their notations, L_dB = 10log_10(P_1/P_0). The underline _ means 'index', so P_1 is 'P with index 1'.

Using http://en.wikipedia.org/wiki/Root_mean_square#Average_electrical_power to find the RMS power of the partials, we find in the table that the RMS power of a sine wave at amplitued a is a/sqrt(2). So the loudness of the fundamental is 1/sqrt(2), this is our P_0. The loudness of the nth partial is 1/(sqrt(2) * n^2). To get the total power of the first 5 overtones we need to sum up the power of the first 5 partials. If we sum them up, then P_1 will be:
P_1 = 1/(sqrt(2) * 2^2) + 1/(sqrt(2) * 3^2) + 1/(sqrt(2) * 4^2) + 1/(sqrt(2) * 5^2) + 1/(sqrt(2) * 6^2)
for the first 5 overtones.
If we divide P_1 by P_0 the square roots cancel out and we get:
P_1/P_0 = 1/(2^2) + 1/(3^2) + 1/(4^2) + 1/(5^2) + 1/(6^2) = 1769/3600

To calculate the loudness we now need to calculate L_dB = 10log_10(1769/3600). This gives us a figure of L_dB ~= -3.086 dB of completely non-harmonic distortion.

Notice I did not mention the frequency of the aliasing partials anywhere in my calculation of their referential loudness. This demonstrates how those aliasing partials stay loud even though their frequency shifts.

In conclusion, in such a very simple and very probable scenario we have just about -3 dB of distortion, and that's not even harmonic distortion. It's evil non-harmonic distortion that plays out-of-tune melodies over our own melodies.




A bit more about the problem of aliasing vs the problems of analog hardware:
I have seen some posts compare 44.1k recording to Studer and analog mixers etc. The issue is that this great analog equipment introduces mostly *harmonic* distortion. This is the pleasant kind: it enhances your music by working together with it. Non-harmonic distortion is like a kid appearing at your gig playing out of tune riffs on a broken guitar.




The same kind of distortion happens e.g. in compressors. When you have a compressor set to 20ms, basically it's a ring modulation of the input signal by the falling part of a single cycle of a sharply falling triangle wave. As you can see, such a saw wave can have -3dB of completely non-harmonic distortion. This distortion is ring-modulated with your signal. We all know how ugly a ring modulator can become if both inputs aren't harmonically related. This is what happens in a compressor - except in a compressor it only happens for 20 milliseconds, that's why it's not really noticable at all unless you know what to listen for. The practical result is lack of intelligibility and harmonicity in the attack; musically this means less of a punch and less flow and a muddied up rhythm.




ORIGINAL: DaveClark

Hi cheater,

In answer to your *original* post:

I have not seen the particular type of program you were asking about, but I also hope you are aware of the possibility that going to higher sample rates in a project can *introduce* aliasing problems (or make them significantly worse) as well as potentially improving them. I saw some fairly good spectral evidence that DPro v. 1.2 makes this kind of error in going to 96,000 samples/sec in loading WAV's via SFZ. You could regard this as actually a bug or some such thing, but you could also regard those "bad VSTi's" you referred to as buggy in that the developer didn't apparently take into account enough factors to avoid such problems. In both cases, you can end up with bad spectra that sound just awful because aliasing popped up for one reason or another. It's really easy to do. I myself have written some bad command-line generators which sound awful at high freqs thanks to aliasing, and I haven't rewritten them because they're still useful for testing purposes at lower freqs. One of these days....

Regards,
Dave Clark




Dave,
very interesting point indeed. However, this problem comes from the (foggy in my memory) fact that SFZ used triangular upsampling. I believe it now allows better resampling; please check the options available and test your findings again.
Might I point out a test of resampling algorithms in samplers at http://www.discodsp.com/highlife/aliasing/
This test is from, I think, 2005, and SFZ+ was already improved considerably over what you mention. In fact it won the comparison in its group!



I hope this post helps a bit in understanding the nature of aliasing.

Thanks
#39
Mr. Ease
Max Output Level: -71 dBFS
  • Total Posts : 960
  • Joined: 2003/11/24 18:44:01
  • Location: West Sussex, UK
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 13:31:29 (permalink)
ORIGINAL: CJaysMusic

Not when its originally recorded at 44.1khz and then you re sample it to 88khz. Your just adding Zero's to the end of the digital sample.


CJ, I have no interest whatsoever in the personal assaults going around on this thread however that statement is simply not correct. If you are increasing the bit depth you do simply add zero's but this is not the case when re sampling to a higher frequency. I think you have confused the two.

How does re-sampling work then? To simplify the case let's assume a simple doubling of sample rate say from 44.1 to 88.2 kHz.

Now say we have two consecutive samples from the 44.1 data and say the actual data is +64 and +82 (decimal equivalents). We need to produce a value for the new intermediate sample we are going to generate. Now it would be crazy to suggest putting in zero's. We could just repeat the first sample but that intuitively is not correct either.

What we would do is interpolate the values for the added data. Now we could use a simple linear interpolation and produce +64, +73 and +82. This would be OK but there are other and better ways by using for example square law or cosine interpolation. Both will provide more "real world" results than linear but using the knowledge that our music is made up of multiple cosines (or sines if you prefer) then the best choice is normally cosine (provided you having the processing power available).

Either of these non linear interpolations would yield a slightly higher value for the new value. I can't be bothered to calculate it but you would probably find the data would read something like +64, +75 and +82. Of course more complex algorithms exist where we use other samples in the vicinity to model the overall trends of the data to produce more "intelligent" interpolation data.

Either way we don't use zero's!
post edited by Mr. Ease - 2009/02/18 13:39:21
#40
DaveClark
Max Output Level: -71 dBFS
  • Total Posts : 956
  • Joined: 2006/10/21 17:02:58
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 13:51:55 (permalink)
Hi cheater,

The problem I was discussing was with DPro in mid-2007, not SFZ. The specific spectrum I recall seeing was that in a plot of 0 to 24 KHz, there was a reflection about the original Nyquist (22.05 kHz) that *extended* beyond the original Nyquist. In other words, the values for the negative frequencies corresponding to 22,050 Hz down to 0 Hz were represented at 22,050 Hz up to 24 kHz as if you were looking at a window of the full spectrum with both postitive and negative frequencies, but only a window of it. I don't recall other details, sorry. It may have then bounced off of 24 kHz. Anyway, there was obviously aliasing caused by going to a higher sampling rate, *introduced* by going to a higher rate. I describe it here so that you can watch for that kind of thing, even if it is a result of bugs, bad design choices, etc.

But I do thank you for your reply.

When you said, "Virtual Analog synthesizer," I'm not sure it's clear to everyone that you mean that the oscillators are not band-limited. These days, many of the oscillators in synthesizers are band-limited, as you probably know --- for the exact reasons you are discussing.

----------------------------------

For those who keep saying that this would have been discussed and addressed by programmers and so on: It HAS been discussed and addressed by programmers. Many times.

For background, see:

1997 Stanford CCRMA Paper (Stilson and Smith)

For a mere $29 USD (Yikes!) you can even purchase a more recent IEEE article about what has been done (published in 2007):

IEEE Antialiasing Oscillator Article

Don't bother clicking on the PDF link if you are not an IEEE member or have other IEEE privileges that allow you to download it --- or have $29 to blow; it just takes you to a login page.

The fact that musicians have used imperfect instruments for centuries is a credit to their outstanding talent and abilities, accommodating the imperfections of creations by us technical folks in an imperfect world.

Regards,
Dave Clark

#41
keith
Max Output Level: -36.5 dBFS
  • Total Posts : 3882
  • Joined: 2003/12/10 09:49:35
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 14:53:44 (permalink)

ORIGINAL: Geokauf

Hello,

TLDNR ("too long, did not read")

sorry for my absence, I've been busy having holidays ;)

The forum is not in "real time" no one knows or cares when you are not here. And you pose the problem of being another anonymous member positing theories and teaching lessons without having a resume or credentials that would qualify you to do so.


George, I'm really struggling to understand your attack vector here. Specific examples with WAV files and pretty JPGs, and even some rigorous mathematical reasoning have been provided. You jumping in like this can only be interpreted as outright attack on the OP, especially with the "too long, did not read"... Why?

Those who are discussing how they hear "aliasing" from plugs used in Sonar projects and those of you who have extensive "engineering" experience and throw around lofty terms like "Nyquist frequency," "oversampling" and the like. It is about making music not about science and theory.


Actually, digital audio is a lot about science and theory. Sorry to disappoint. Not sure if you've noticed, but there is an entire engineering discipline called "Digital Signal Processing" that utilizes decades of mathematical and physical theory, and without which SONAR just wouldn't be as much fun.

Unless you're just recording a trombone, in which case a decent condenser mic and about 28kHz sample rate will do...

So... yeah... lots of science and math and stuff...

And BTW, "Nyquist frequency" and "oversampling" are not "lofty terms", as if they were part of some esoteric, hyperdmensional, theoretical calculus. They're rudimentary concepts in the grand scheme digital processing and all the math and theory that makes it possible (and not just for audio, obviously, but for more important things like saving lives).

If you don't care about the engineering, then just leave the engineering to the engineers. Why bother saying that the engineering doesn't matter, or some such nonsense, when in fact the engineering is so obviously a very important piece to the overall. You know, if Charlie Parker had to use a popsicle stick instead of a reed, he'd sound like crap... so thank goodness there are persons in this world who know alot about making reeds for saxophones.
#42
MurMan
Max Output Level: -70 dBFS
  • Total Posts : 1040
  • Joined: 2008/12/10 19:11:36
  • Location: Sunny San Diego
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 16:35:18 (permalink)
I dip my toe in this thread at great peril, but I'd like to clarify something.

ORIGINAL: cheater

... Aliasing is only a function of sample rate. ....

Aliasing is a function of sample rate and the frequency content of the data being sampled.
#43
Tom F
Max Output Level: -48 dBFS
  • Total Posts : 2749
  • Joined: 2007/07/08 05:56:12
  • Location: Vienna (the one in Europe)
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 18:54:53 (permalink)

ORIGINAL: Geokauf

with all those smart ass

Hello,

What's with the name calling? I'm commenting on the subject matter and whether or not those commenting have the credentials to be taken at their word.

Unfortunately there's pitifully little on you that I could find on your MySpace site. You sound like you have a wide range of experience. So tell me what do you know about aliasing in digital music creation, the original subject. Is it a problem? Can you hear it? Does it spoil recordings in apps like Sonar? I say no. I'd rather discuss that than one's credentials anyway. Regarding your experience, on the basis of what you say, I'm willing to take you at your word.

GK




well its an expression that i have read several times on this forum - so i dont expect it being truly offensive - just emphazizing a "heated discussion climate" ...so please accept my apologies..btw: it wasnt even directed to you (who btw. writes stuff like "****.."
for my stuff: i do not like that sort of portals - i just set up that myspace thing for a few people who asked about it - but i am not good at it and i dont like it...
as for your question: no i dont say thet i can hear aliasing in 99,99% of the cases - there are only very few virtual analog hardware synth where it is audible and some badly written plugins that have problems with it within certain setups (in terms of sound setup)
so maybe we come to a little closer position of our 2 point of views...
actually i dont agree totally with the op about the need of a trillion khz to get a "good" sound...
but this whole thread got crazy when some folks sort of denied the technical existance of aliasing (audible or not)
and when some continued to confuse the quality of 44/24 for recording a "real" instrument and the purely digitally generated waveforms and complex sounds - at the same rate - because its not the same..
as you also can imagine its not that easy to discuss certain technical stuff in a language that i use mostly in colloqiual context...
also i dont know why its such a irritating truth that most vstis work with upsampling in order to get better sound...
why would anyone worry to do so if it was so irrelevant - and btw: i have no problem in making a point and saying this is an emotional debate - but you have to be true: there are enough things you posted here that are also...
its just funny that some sonar fanboys claim to hear the difference between 64 bit and 32 bit summing but still cant hear the difference between a vsti originally playing at 44 or originally at 88...???

...trying to be polite... quick temper...trying to be...
#44
Mr. Ease
Max Output Level: -71 dBFS
  • Total Posts : 960
  • Joined: 2003/11/24 18:44:01
  • Location: West Sussex, UK
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/18 19:36:48 (permalink)
This is a reply to no-one in particular but I find some of the comments and discussion going on in this thread quite ridiculous.

We seem to have around three camps. First the OP and those seriously discussing the matter, those who decry the topic and try to put some reasoning and logic to their points and finally those that seem to say I can't hear it therefore it cannot matter and science is a load of hooey anyway.

Let's try and see this a little more logically and less heatedly. This is not meant to offend but I do question what your motivation is.

To the latter group I suggest this. Without the science and engineering we would not have any means of recording anything. No tapes, vinyl, CD's or anything. Our only course to music would be in the concert hall or playing at home. Of course there would be no house P.A.'s Farfisa's, electric guitars etc. as it would be all straightforward acoustic music. Everyone on this forum is using a DAW and taking full advantage of the engineering and therefore to poo-poo engineering is somewhat disingenuous. If you do not wish to know or understand the science then no problem. Read another thread. Bear in mind though that just because you have not heard the problem or whether it can never be heard is not really the point and does not disprove the engineering behind what the OP has raised. If you really don't care, why stay and post? It's just not logical.

To the middle group I would advise caution before quoting engineering "facts" that you get them right. There have been several comments I have read on this thread that have only served to highlight to me that the poster is demonstrating a lack of engineering knowledge rather than vice versa. Remember that there are real engineers around here too. I might find this funny if it wasn't so disappointing! Whether you agree or not is not really the point or what the OP was asking for, so again I don't know why you feel compelled to comment. By all means hang around and watch if you want to find out more but what do you gain by displaying a clear lack of understanding?

To the OP and his camp, it is a shame that the real facts of this are being obscured by the latter groups. This is a public forum sponsored by Cakewalk and you have every right to discuss this here. Unfortunately others have the right to try and poo poo the discussion. Why they choose to do so is beyond me. Maybe we should use John's tactics for spammers!
#45
MurMan
Max Output Level: -70 dBFS
  • Total Posts : 1040
  • Joined: 2008/12/10 19:11:36
  • Location: Sunny San Diego
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 02:45:01 (permalink)

ORIGINAL: cheater

I will now demonstrate, completely with a short mathematical proof, the extent of aliasing in a very classical situation of playing back a note.
Let us assume a Virtual Analog synthesizer playing back a triangle wave at a high Eb, which has just about the frequency of 12543.8539514160 Hz.
This means any harmonic will fall above the Nyquist frequency (I count harmonics without the fundamental, which is the 0th harmonic in my nomenclature. I clarify this because there are multiple naming schemes)

cheater,

I can't make your example pencil out. The highest Eb on a piano is Eb7. In keeping with your theme of "a very classical situation of playing back a note", this seems like a reasonable choice, right? (I'm assuming that we're not composing for dogs.)

Now Eb7 has a fundamental freq. of about 2,489 Hz with the next three odd harmonics all falling below the Nyquist freq of 22 kHz. There's not a lot of energy left in the remaining odd harmonics. This makes your -3 dB distortion value way high.

You also violated your own numbering convention for harmonics. If you call the fundamental the 0th, then a triangle wave has energy only in the even harmonics, not the odd ones that you talk about later in your post.

I'd like to give you the benefit of the doubt, but I can't get past mistakes in your example and the strong aroma of wikipedia.

Murray
#46
John
Forum Host
  • Total Posts : 30467
  • Joined: 2003/11/06 11:53:17
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 03:41:35 (permalink)

ORIGINAL: DaveClark

Hi everyone,

Ya mention the Devil, and he shows up!

I quite honestly was just working on providing some information on this, so good timing I guess.... Except that I should have been in bed already!!

Hopefully this will help. Please do say something if the zip file is screwed up or something else is seriously foobar'd.

-------------------------

Greetings all,

I put a zip file at:

Alias Stuff

This zip file contains several files:

cm_101_tri.fxp
cm_101_tri_wav.jpg
cm_101_tri_fft.jpg
dominator_tri.fxp
cm_dominator_tri_wav.jpg
cm_dominator_tri_fft.jpg
cm_101_tri_fft_4424.jpg
cm_dominator_tri_fft_4424.jpg
--------
640386 8 files

Computer Music magazine has numerous VST's, VSTi's and samples available every month. CM-101 and CM-Dominator are two regularly featured "free" VSTi's, the only monetary cost being that of the magazine. Both VSTi's can produce pure Triangular waveforms or at least lead the user to believe that they can. The files with "wav" in them show the triangular waveforms; the ones with "fft" in them depict the spectra; the ones ending in "fxp" are the presets for the respective VSTi so that you can verify the settings for Triangular waves yourself. The ones with 4424 in them are from 96,000 samples/sec projects where the waveforms were downsampled to 44,100 samples/sec upon export. I'll discuss these downsampled ones in a moment.

As you should be able to see from the 44,100 samples/sec spectra ("fft" no "4424"), CM-101 displays no visible aliasing artifacts whereas the Dominator one clearly displays prominent aliasing artifacts. (The CM-101 does have a DC component.) The note being played here is G7 in Cakewalk-speak or ~1568 Hz (sorry, it was supposed to be A7). The CM-101 also shows the effects of a strong LPF, whereas the Dominator one cuts in later. The WAV for Dominator clearly shows a very sharply defined triangular waveform. This is bad and suggests that the generator for the triangular waveform is not band-limited --- and it clearly is not. The CM-101 is rounded. This is good; it suggests that the waveform generation is band-limited.

That this is aliasing is demonstrated by the fact that the amplitudes are diminishing according to the Fourier expansion or faster (filtered) and are the odd harmonics, but "bounce" off the wall at the Nyquist limit, so to speak, and continue to diminish travelling now back from right to left. Because the highest amplitudes that are close to each other are at the higher frequencies, the sound is a little to a lot shrill, depending on what note is played. To compute the aliased frequency, simply add the distance from the right-hand side to the Nyquist value 22050 Hz. You should be able to verify that the interval continues to be 1568*2 Hz (recall: odd harmonics).

From the 96,000 samples/sec spectra ("fft" and "4424" --- now log plots to show CM-101 artifacts better) where downsampling was done, you can clearly see that the CM-101 waveform is slightly worse with the very (very, very) low level signals introduced, whereas the CM Dominator one has improved markedly. This latter result is exactly what the OP was getting at in the original post. The former (degraded CM-101) was what I recently posted about, namely that going to higher rates can degrade some VSTi's, though admittedly this particular example is probably inaudible without further processing.

CM-Dominator is actually a really nice sounding VSTi as far as I'm concerned, working at 96,000. Even at 44,100, it doesn't alias nearly as badly as my test signal generators do. My tri generator spectra are just plain filthy.

Regards,
Dave Clark


I looked at your stuff. I can't say I fully understand it or how it relates to this thread. What I think we are not taking into account and something I talked about in a very early post on the first page is the fact that any plugin or synth that over samples a wave form will have to down sample that wave form in order to output it to the project. The OP mentioned 8x over sampling and talked about it being in the MHz range. I don't see how any project can be expected to deal with the raw wave form at those sample rates. Not to mention the title of this thread where hardware is involved.

If there is a problem it is not the host software's fault but the way the over sampling plugin is down sampling. The artifacts are due to how the plugin is doing its down sampling not due to the projects sample rate. No matter what sample rate that the project is at it will always be less then the over sampled wave. Otherwise there can be no such thing as over sampling.

Best
John
#47
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 11:18:55 (permalink)
ORIGINAL: DaveClark
That this is aliasing is demonstrated by the fact that the amplitudes are diminishing according to the Fourier expansion or faster (filtered) and are the odd harmonics, but "bounce" off the wall at the Nyquist limit, so to speak, and continue to diminish travelling now back from right to left. Because the highest amplitudes that are close to each other are at the higher frequencies, the sound is a little to a lot shrill, depending on what note is played. To compute the aliased frequency, simply add the distance from the right-hand side to the Nyquist value 22050 Hz. You should be able to verify that the interval continues to be 1568*2 Hz (recall: odd harmonics).

I agree with John, anyone who downsamples without an anti-alias filter is going to get aliases … duh!

Regards,
David

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#48
DaveClark
Max Output Level: -71 dBFS
  • Total Posts : 956
  • Joined: 2006/10/21 17:02:58
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 14:44:27 (permalink)
Hi John and David,

John:
If there is a problem it is not the host software's fault but the way the over sampling plugin is down sampling. The artifacts are due to how the plugin is doing its down sampling not due to the projects sample rate.


I'm sorry but this is simply not correct. It is not "down sampling" that is always the problem if a problem exists. It is almost certainly very rare because most people DO know to use LPF's when downsampling. It's almost an insult to claim that a programmer oversampled specifically to avoid this problem, then downsampled with no LPF in sight!

Rather: It is well-known in certain circles is that oscillators in some VSTi's are not band-limited, including those which are not oversampled/downsampled at all and run at the project rate. There are many reasons why this happens, too many to even begin discussing here. LPF won't fix these problems if the oscillator is running at the project rate as many do. Newer VSTi's often implement band-limited oscillators, probably because more and more programmers (and users) are becoming sensitive to the problem. Apparently many folks are still unaware of this problem(s), and as George said, use VSTi's without any concerns about it. Lack of concern is not the same thing as nonexistence.

My demo was simply to show that this problem really does exist, just as the OP implied it did in his original post. My stuff is about as relevant as anything could possibly be, aimed at supporting the claims and assumptions implied/stated by the OP in his original post which other people here have challenged as unproven or even blatantly false assertions, etc.

In the original post, the OP simply asked for a program that would allow him to use an effective high project (On edit: audio) sample rate to alleviate aliasing artifacts. One of my demos shows that this would work, albeit I did raise the actual project (On edit: and audio) sample rate which, I hope is obvious, does not matter. Because the new Nyquist is so high, by the time the amplitudes of aliased frequencies get back to below the original Nyquist, they are very, very small. LPF in SONAR downsampling eliminated the others that lie between the original and the higher Nyquist frequencies.

Again, this is quite relevant.

Regards,
Dave Clark

post edited by DaveClark - 2009/02/19 15:07:15
#49
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 16:21:25 (permalink)
It is well-known in certain circles

If you want us to believe this is anything more than your opinion, you will have to cite your sources.

[Added:]By the way, your spectrum graphs don't look like aliasing, but like phase noise. As a real electronic engineer, I have seen graphs like this on noisy RF signal generators and bad high-frequency clock generators. The key indicator is the double-sideband noise around the fundamental frequency — this is not aliasing, but phase noise, or (dare I say it in this forum) jitter. This is probably caused by a poor interpolation algorithm in a poor table-lookup oscillator rather than aliasing.

Regards,
David
post edited by dcastle - 2009/02/19 16:39:07

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#50
Mr. Ease
Max Output Level: -71 dBFS
  • Total Posts : 960
  • Joined: 2003/11/24 18:44:01
  • Location: West Sussex, UK
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 17:54:35 (permalink)
ORIGINAL: dcastle

It is well-known in certain circles

If you want us to believe this is anything more than your opinion, you will have to cite your sources.

[Added:]By the way, your spectrum graphs don't look like aliasing, but like phase noise. As a real electronic engineer, I have seen graphs like this on noisy RF signal generators and bad high-frequency clock generators. The key indicator is the double-sideband noise around the fundamental frequency — this is not aliasing, but phase noise, or (dare I say it in this forum) jitter. This is probably caused by a poor interpolation algorithm in a poor table-lookup oscillator rather than aliasing.

Regards,
David


As a real engineer you should look at the graphs more carefully! While it is clear the fundamental has phase noise it is not relevant to the aliasing we are discussing. The 3rd,5th, 7th and 9th Harmonics are also clear in both graphs. There is also evidence of inconsistent even harmonic spurs. What is NOT consistent between the two graphs are the multiple spurs at non fundamental related frequencies. Look around 4.1 kHz, 6.3 kHz (not the 6.4 kHz 4th Harmonic), 7.5 kHz etc. These spurs have nothing to do with the fundamental and do not appear on the second graph. How do you explain those variations?

Edit: If you read post #42 you will see that some references have already been given by Dave Clark. Your post seems to respond to both him and Rhythminmind. As an engineer too, I prefer to analyse the information presented for myself rather than rely on some "known" source as "known" sources are not always infallible themselves.
post edited by Mr. Ease - 2009/02/19 18:37:11
#51
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 18:30:04 (permalink)
Greetings Richard,

This topic is not new for music synthesis, but has been rigorously analyzed for direct digital synthesis of RF signals used in cellphones and WiFi equipment (among many others). I refer you to http://en.wikipedia.org/wiki/Direct_digital_synthesis which cites several very useful and helpful references, in particular…
These clearly show that what is aliased is this spurious phase noise that I described, not the fundamental signal. There are several solutions, but none of them require oversampling and filtering. One of the simplest and most interesting is the addition of pseudo-random noise to the phase accumulator, which spreads the phase noise across the spectrum in very much the same way that adding pseudo-random noise in dithering spreads the quantization noise across the spectrum.

Regards,
David

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#52
Mr. Ease
Max Output Level: -71 dBFS
  • Total Posts : 960
  • Joined: 2003/11/24 18:44:01
  • Location: West Sussex, UK
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 18:51:37 (permalink)
Hi David,

Oddly I am well familiar with direct digital synthesis and have done many designs for my clients as a consultant. I well remember testing the first DDS part available from Qualcomm (Spurs everywhere!). The phase noise due to aliasing you are refering to there is the result of a different mechanism (phase quantisation) to what we are discussing here.

What we are concerned with here is simple aliasing caused by signals above the Nyquist frequency being folded back into the baseband. This would only produce additional phase noise if the sampling frequency was noisy - which is simply not the case within the digital realm as it is purely an abstract calculation. While I do not expect the two graphs presented to us to show the same frequency spurs (due to the different nyquist frequencies), I would certainly expect corresponding spurs when the nyquist frequencies are accounted for. The graphs simply do not show that.

So I ask again, how do you, as an engineer, account for those differences?
#53
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 19:16:05 (permalink)
This would only produce additional phase noise if the sampling frequency was noisy

Ah, but there is phase noise in the sampling frequency caused by quantization of the phase accumulator in the oscillator — it is this noise that is causing the spurs that are being aliased.

[ADDED:] Let me add that oversampling would not remove these phase noise spurs. Only proper design of the oscillator itself would remove these spurs. There are several tricks to minimize the spurs without fixing the underlying oscillator such as band-limited lookup tables, etc., but only a proper design would actually fix the problem.
post edited by dcastle - 2009/02/19 19:32:53

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#54
Mr. Ease
Max Output Level: -71 dBFS
  • Total Posts : 960
  • Joined: 2003/11/24 18:44:01
  • Location: West Sussex, UK
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 20:10:17 (permalink)
The out of band spurs caused by quantisation of the phase accumulator would have the same bandwidth as the phase noise though and the spurs I pointed out before do not.

This is very much in line with the first Qualcomm DDS offerings!

Edit: It is now very late here (1:20 am) and tomorrow I am going away for a few days so I will be unable to respond for a while!
post edited by Mr. Ease - 2009/02/19 20:27:12
#55
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/19 21:04:30 (permalink)
The out of band spurs caused by quantisation [sic] of the phase accumulator would have the same bandwidth as the phase noise though and the spurs I pointed out before do not.

No, the spurs would be related to the fundamental and the sample frequency — and would not be limited to the Nyquist limit — so they would alias. Band-limited oscillators would also have these spurs, which by the way, would make the sound 'thicker' due to the FM-like modulation of the phase by the quantization of the phase accumulator.

If this aliasing that we are talking about is a basic problem with playing back a digital sample, then we might as well throw out digital audio. But, it is not, it is a problem with cycling through a finite lookup table with a finite phase accumulator that gets truncated to choose the sample. What we need is phase accumulator dither to solve the problem just like amplitude dither solves the quantization noise in finite bit depths.

[ADDED:] I am writing a simple little C program to create a perfect triangle waveform by using floating-point calculations instead of table lookup. I will post the result and let you tear it to shreds with any analysis you care to throw at it.

Regards,
David
post edited by dcastle - 2009/02/19 21:11:30

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#56
DaveClark
Max Output Level: -71 dBFS
  • Total Posts : 956
  • Joined: 2006/10/21 17:02:58
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/20 12:20:10 (permalink)
Hi David,

Hope you have been doing well since we last communicated. You're still using C? That is like those VSTi programmers than haven't heard the "good news" about band-limited oscillators! Sorry, couldn't resist.... Admittedly I program in C++ only because I could devote the time to learning and using it.

Although I enjoyed reading your posts, I think that you are reaching for a complex explanation while a very simple, much more likely alternative is available that perfectly well explains the graph that I still claim does in fact show aliasing.

Many of those folks who programmed VSTi's when they first appeared had no background in signal analysis or what you and I (and perhaps Mr. Ease) knew as "communications." Often their backgrounds were in music or music with some math or things such as that. They implement a triangular oscillator, for example, with no appreciation that there are things you need to do to limit the frequencies generated if you want to avoid aliasing, even if they have been exposed to some of the related concepts. They use linear interpolation in a perfect table with absolutely straight lines (within machine limits). The obvious result is aliasing. They like the results. Good enough.

Your explanation, as I understand it, assumes that the programmer successfully avoided generating any harmonics exceeding the Nyquist limit, but somehow made some other error (e.g. sloppy interpolation) that just so happened to produce the same result as would obtained by ignoring band limiting AND somehow did not realize this during development and deployment, beta testing, etc. I find this quite implausible by comparison, especially because it assumes at least some sensitivity to the problem followed by inexplicable slackness.

Re: Citing of sources. I was glad to see that you understand the condition: "If you want us to believe...." Not everyone appreciates the fact that this condition exists regarding citing of sources. I frankly am not anywhere nearly enough concerned about who believes me and who doesn't to do all the work necessary to prove my assertion. To me this would be like demonstrating that the earth is a sphere --- a waste of my time. However, out of respect for you based on past experience, I do point out that if this aliasing oscillator problem had not really been a problem, then the word "non-aliasing" would not have been necessary in the citation above posted by rhythminmind, nor would other such claims recently made by other companies and programmers regarding non-aliasing or anti-aliasing oscillators. It would be redundant --- Aren't all oscillators in audio programs non-aliasing? (Answer: No.)

I've done enough here so will leave further discussion to others who are interested. I've done my part!!

Regards,
Dave Clark

#57
cheater
Max Output Level: -90 dBFS
  • Total Posts : 28
  • Joined: 2007/04/09 15:14:46
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/20 12:22:56 (permalink)

ORIGINAL: dcastle

Greetings Richard,

This topic is not new for music synthesis, but has been rigorously analyzed for direct digital synthesis of RF signals used in cellphones and WiFi equipment (among many others). I refer you to http://en.wikipedia.org/wiki/Direct_digital_synthesis which cites several very useful and helpful references, in particular…
These clearly show that what is aliased is this spurious phase noise that I described, not the fundamental signal. There are several solutions, but none of them require oversampling and filtering. One of the simplest and most interesting is the addition of pseudo-random noise to the phase accumulator, which spreads the phase noise across the spectrum in very much the same way that adding pseudo-random noise in dithering spreads the quantization noise across the spectrum.

Regards,
David


David,
in one fell swoop you've disregarded the mathematics I've brought up, you've shown a lack of understanding of the reconstructive portion of the Nyquist-Shannon sampling theorem, and commited a non-sequitur by bringing up an effect of a technology that is in no way related: alising in DDS has little to do with alising in PCM. The Nyquist theorem doesn't even apply directly to DDS.

Here is the kind of aliasing we're talking about:
http://www.discodsp.com/highlife/aliasing/

There's a pretty good article on wikipedia, at
http://en.wikipedia.org/wiki/Aliasing

Or in particular stare at http://en.wikipedia.org/wiki/File:AliasingSines.png until you get it. The higher-frequency sinusoid is 'above nyquist frequency'. The lower-frequency one is its alias, or 'ghost', i.e. a lower frequency which fits the same control points. Actually, as trivia, during playback both are going to be audible, but since our sampling frequency is going to be 44.1k or higher, and nyquist is above 20k, nobody's going to hear the higher one. You could definitely hear both if fs was at 10kHz.


ORIGINAL: dcastle

This would only produce additional phase noise if the sampling frequency was noisy

Ah, but there is phase noise in the sampling frequency caused by quantization of the phase accumulator in the oscillator — it is this noise that is causing the spurs that are being aliased.

[ADDED:] Let me add that oversampling would not remove these phase noise spurs. Only proper design of the oscillator itself would remove these spurs. There are several tricks to minimize the spurs without fixing the underlying oscillator such as band-limited lookup tables, etc., but only a proper design would actually fix the problem.

Ah, but there is phase noise in the sampling frequency caused by quantization of the phase accumulator in the oscillator — it is this noise that is causing the spurs that are being aliased.

[ADDED:] Let me add that oversampling would not remove these phase noise spurs. Only proper design of the oscillator itself would remove these spurs. There are several tricks to minimize the spurs without fixing the underlying oscillator such as band-limited lookup tables, etc., but only a proper design would actually fix the problem.


Oversapling certainly would, no, does get rid of this, because at a higher sample rate a single cycle of a specific frequency sinewave is made up of more samples, therefore the accumulator's delta can be expressed down to higher resolution. So if you have a delta of 4.6 at 48k which would get truncated to 5, at 96k you'd have a delta of 9.2 which would get truncated to 9. This is much better accuracy.

But not to sidetrack from the real problem which is aliasing, and which comes from sample playback and ring modulators. Without rewriting the sampling plugins in question to have superb in-line resampling the only way to avoid aliasing is to push it out of the audible band, and to do that you need to resample. We're not going to sit down and rewrite every plugin on the planet, ergo resampling is needed. At least for me, if you don't need it feel free to not show any support for this.
The situation is even worse for ring modulators, since there's simply no way at all of removing aliasing without upsampling the operation. Maybe you have an idea how to do that, please share, you'll be my hero. But again, the plugins that exist *are* set in stone already, and there's no changing their nature anymore.


ORIGINAL: dcastle

[ADDED:] I am writing a simple little C program to create a perfect triangle waveform by using floating-point calculations instead of table lookup. I will post the result and let you tear it to shreds with any analysis you care to throw at it.


I will.
Please post source.

But I'm not sure at all how this is relevant to the fact that there are thousands of plugins out there that you're not going to rewrite.





ORIGINAL: DaveClark

Hi cheater,

The problem I was discussing was with DPro in mid-2007, not SFZ. The specific spectrum I recall seeing was that in a plot of 0 to 24 KHz, there was a reflection about the original Nyquist (22.05 kHz) that *extended* beyond the original Nyquist. In other words, the values for the negative frequencies corresponding to 22,050 Hz down to 0 Hz were represented at 22,050 Hz up to 24 kHz as if you were looking at a window of the full spectrum with both postitive and negative frequencies, but only a window of it. I don't recall other details, sorry. It may have then bounced off of 24 kHz. Anyway, there was obviously aliasing caused by going to a higher sampling rate, *introduced* by going to a higher rate. I describe it here so that you can watch for that kind of thing, even if it is a result of bugs, bad design choices, etc.

But I do thank you for your reply.



Dave,
Not sure what to say to that, as I've never used DPro, but I'm pretty certain you're just describing a bad resampling algorithm. They're probably using triangular resampling.





ORIGINAL: MurMan

I dip my toe in this thread at great peril, but I'd like to clarify something.

ORIGINAL: cheater

... Aliasing is only a function of sample rate. ....

Aliasing is a function of sample rate and the frequency content of the data being sampled.



Well spotted.
Good thing books get peer reviewed. :)





ORIGINAL: MurMan


ORIGINAL: cheater

I will now demonstrate, completely with a short mathematical proof, the extent of aliasing in a very classical situation of playing back a note.
Let us assume a Virtual Analog synthesizer playing back a triangle wave at a high Eb, which has just about the frequency of 12543.8539514160 Hz.
This means any harmonic will fall above the Nyquist frequency (I count harmonics without the fundamental, which is the 0th harmonic in my nomenclature. I clarify this because there are multiple naming schemes)

cheater,

I can't make your example pencil out. The highest Eb on a piano is Eb7. In keeping with your theme of "a very classical situation of playing back a note", this seems like a reasonable choice, right? (I'm assuming that we're not composing for dogs.)

Sorry, it was actually a G I think. And, yes, certainly higher than on the piano, but still audible to humans. Deers as well, think of your deer dcastle.

Now Eb7 has a fundamental freq. of about 2,489 Hz with the next three odd harmonics all falling below the Nyquist freq of 22 kHz. There's not a lot of energy left in the remaining odd harmonics. This makes your -3 dB distortion value way high.

Apply this to the frequency I mentioned and you'll see how it works out.

You also violated your own numbering convention for harmonics. If you call the fundamental the 0th, then a triangle wave has energy only in the even harmonics, not the odd ones that you talk about later in your post.

Well spotted!


Thanks a lot for your replies guys!
#58
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/20 16:29:01 (permalink)
Greetings Dave,

Likewise on the respect! Let me do my C experiment. It might turn out to be C++ because I found a really nice WAV library that will do most of the I/O work for me, but that's not a big deal for a simple WAV file, so who knows.

As far as whether there would be marketing claims of "non-aliasing" or "anti-aliasing" — please! Snake oil has been sold for thousands of years, and any other name would be just as slimy.

Let me finish my experiment. I have been wrong before. And, if I'm wrong this time, I will be glad to apologize again.

Regards,
David

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#59
dcastle
Max Output Level: -49 dBFS
  • Total Posts : 2623
  • Joined: 2004/11/15 12:40:02
  • Location: Inland Empire
  • Status: offline
RE: Using S8 with sample rates higher than the hardware supports? Oversampling the project 2009/02/21 10:01:25 (permalink)
Greetings Everyone,

Okay, I finished my experiment — I wrote this C program to create a perfect triangle waveform — using 64-bit floating point calculations…

[EDIT: DELETED CODE BECAUSE IT DIDN'T DISPLAY PROPERLY]

This generated 10 seconds of waveform like this…


Then I ran the spectrum analysis (Hey! Look no spurs.) on it…


Wow! Am I surprised! There is horrible aliasing. The fundamental is at 3520Hz, so the 3rd harmonic is at 10560Hz, and the 5th is at 17600Hz, and the 7th should be at 24640Hz, but it is clearly wrapped (aliased) to 19460Hz, and so on and so forth, etc., etc…

I guess I am going to have to reread the literature to get my head wrapped around this, but the best explanation I can come up with is that I have digitized a perfect triangle waveform (that has harmonics extending out to infinity) inside my computer without any alias filtering — when I think about it this way it is obvious that there is going to be aliasing.

[to be continued…]
post edited by dcastle - 2009/02/21 19:12:27

ASUS M3A78 AMD 9950 Quad 2.6G 8GB
Shure • Rhode • Audio-Technica • Allen&Heath GL2200-24
MOTU 24i • Presonus Firepod • E-MU 1212m • Zoom H2
SONAR 2XL-8PE • Sound Forge 1-9 • Audacity 0.1-1.3
#60
Page: < 123 > Showing page 2 of 3
Jump to:
© 2024 APG vNext Commercial Version 5.1