Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 3999hz Sine at 8khz SR (Read 31471 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

3999hz Sine at 8khz SR

Reply #25
Well, yeah if you already know the answer you'll understand "distortion" as "aliasing".

Regarding the output: using bandpass' commands but with 3999 Hz (instead of 3990 Hz) the tone will be attenuated by roughly 54 dB, the image by about 108 dB. (With very high quality you get higher attenuation.)
Using 3990 Hz you'll see negligible attenuation.
"I hear it when I see it."

3999hz Sine at 8khz SR

Reply #26
The spectrograms generated by sox look and sound similar for dither and no-dither versions:

sox -V -r 8000 -n  -r 8000 -b16 -c1 test4k-dither.wav synth 5 sine 3999

[attachment=7613:spectrum-dither.png]

sox -V -r 8000 -n -D -r 8000 -b16 -c1 test4k-nodither.wav synth 5 sine 3999

[attachment=7614:spectrum-nodither.png]

3999hz Sine at 8khz SR

Reply #27
Regarding the output: using bandpass' commands but with 3999 Hz (instead of 3990 Hz) the tone will be attenuated by roughly 54 dB, the image by about 108 dB. (With very high quality you get higher attenuation.)
Using 3990 Hz you'll see negligible attenuation.

With 3990, it's about 6dB atten (i.e a little more than for the 3dB point at 99.7%: 3988Hz.  I'd level-matched for the graph though). But different versions of SoX have slightly different roll-off curves, so don't expect consistency of level in the transition band.

For minimal distortion and roll-off with 3999Hz @8k (or even, according to its documentation, 3999.9999...), have a look at the "Brick resampler". I don't believe filters this steep have any practical use though. For audio, the tightest spec I've come across is 15kHz bandwidth with 32kHz sample rate, i.e. 0dB point at 93.75%.

3999hz Sine at 8khz SR

Reply #28
Thanks, ktf and xnor, now I get it. I was thinking only about resampling for file storage (i.e. 8 to 48-ish kHz), not about D/A conversion (which, as I failed to realize, ideally represents resampling to an infinitely large sampling rate). So yes, both any D/A converter as well as Audition's interpolative waveform display use time-limited interpolation filters for reasons mentioned earlier.

What I find curious is that I see the beating in Adobe Audition where I had assumed it could display what the waveform would look like with perfect reconstruction.  Clearly I don't understand how the program is going about connecting the dots.

That beating is just because its using linear or at most polynomial to generate the display. Its too slow to use high quality interpolation for display so almost nothing does.

I think - and recall reading this somewhere - that Audition is doing better than that, meaning it uses a time-windowed sinc filter. Here's what a Dirac (single-sample) impulse looks like in Audition 1.x:

[attachment=7615:dirac_audition.png]

Edit: zooming in vertically reveals that this smooth interpolation curve extends to the entire time-range visible in that screenshot.

Chris
If I don't reply to your reply, it means I agree with you.


3999hz Sine at 8khz SR

Reply #30
Aliasing is linear.

No, it's not.

sin(2*pi*f*t) turns into sin(2*pi*f*t)+sin(2*pi*(f+2)*t) for the 3999 Hz example above.

Still, I'd just call it by what it is: aliasing.
"I hear it when I see it."

3999hz Sine at 8khz SR

Reply #31
I think - and recall reading this somewhere - that Audition is doing better than that, meaning it uses a time-windowed sinc filter.

I think there may have been some confusion between Audition and Audacity. Audacity just connects the dots with straight lines. Audition does far better.

I'm going to walk back what I said earlier. When I looked at the waveform in Audition, I had created the tone in Audition. The visual beating may be due to this and not some problem with the way the program renders the waveform. For all I know a waveform created or resampled with sox or some other capable software will display perfectly in Audition and maybe Audacity too, despite its gross rendering.

3999hz Sine at 8khz SR

Reply #32
I think there may have been some confusion between Audition and Audacity. Audacity just connects the dots with straight lines. Audition does far better.

I'm going to walk back what I said earlier. When I looked at the waveform in Audition, I had created the tone in Audition. The visual beating may be due to this and not some problem with the way the program renders the waveform. For all I know a waveform created or resampled with sox or some other capable software will display perfectly in Audition and maybe Audacity too, despite its gross rendering.

Audition, like Chris wrote, uses windowed sinc filters. As I explained, these have to be trimmed for speed instead of performance.
If Chris had zoomed in in his screenshot we could see that the filter stops abruptly after about 20 taps on each side of the impulse - that's rather short.

As for visual beating: smooth visualization is identical to resampling to a (much) higher sampling rate.
#14

What you see is the result of aliasing. What you hear is the result of aliasing. I don't know how to put it any clearer.
"I hear it when I see it."

3999hz Sine at 8khz SR

Reply #33
Audition's interpolation depends on your zoom ratio. When you are zoomed out, a digital waveform is displayed. When you are zoomed in, a bandlimited interpolation is used, where the order is up to 40 and depends on your zoom ratio. It means that the transition band (–1 dB to –60 dB) occupies approx. 10% of the sampling rate. So, if your sampling rate is 8 kHz, do not expect beat-free drawing of anything above ~3700 Hz.

A typical transition band of DACs is 5% of the sampling rate, so they do better than Audition's waveform drawing engine.

With software SRCs, like SoX or iZotope SRC, you can narrow the transition band as much as you like.


3999hz Sine at 8khz SR

Reply #35
I think - and recall reading this somewhere - that Audition is doing better than that, meaning it uses a time-windowed sinc filter. Here's what a Dirac (single-sample) impulse looks like in Audition 1.x:


Actually, it is already displayed with a ~40 tap sinc filter in Cool Edit 96 (released in 1996), which is what eventually became Adobe Audition.

3999hz Sine at 8khz SR

Reply #36
Using the resampler from here with the "-r 44100 -fl -10000000 -f 4" parameters, a 60 seconds long sample of 3999 Hz sine wave (8000 Hz sample rate, 2 channels, 32-bit PCM format) is converted in about 0.4 s on a Core i3 2120 CPU, and the spectrum looks like this: image.

Although in practice it does not make much sense to use such a steep filter, and when upsampling from 8000 Hz, it even produces audible ringing at 4 kHz.

3999hz Sine at 8khz SR

Reply #37
What setup do I need to hear this played back as a pure 3.999khz tone?


You won't. I've been making this argument for 15 years. Nyquist was right that you will record the frequency but he didn't say anything about the amplitude. You will get interference patterns like this close to f/2. This is one reason why the 16/44 standard wasn't well conceived - it's a borderline standard. 18bit/100kHz would have been ideal. Oh well, we have 24/96 now so problem solved.

3999hz Sine at 8khz SR

Reply #38
This is one reason why the 16/44 standard wasn't well conceived - it's a borderline standard. 18bit/100kHz would have been ideal. Oh well, we have 24/96 now so problem solved.


Thats ridiculous.  A typical modern system is good to about .96 of Nyquist.  That will get you easily to 21 kHz, which is more than adequate.  Going higher serves no purpose.

Edit:  You should probably read this thread, several people already explained why your reasoning here is wrong.

3999hz Sine at 8khz SR

Reply #39
Nyquist was right that you will record the frequency but he didn't say anything about the amplitude. You will get interference patterns like this close to f/2.


After 15 years, don't you think its about time that you finally educated yourself on the sampling theorem and stop spreading nonsense? 
"I hear it when I see it."

3999hz Sine at 8khz SR

Reply #40
Nyquist was right that you will record the frequency but he didn't say anything about the amplitude. You will get interference patterns like this close to f/2.


After 15 years, don't you think its about time that you finally educated yourself on the sampling theorem and stop spreading nonsense? 


I'm doing this very thing right now for someone over on the Head-Fi forum in the Sound Science section.
Regards,
   Don Hills
"People hear what they see." - Doris Day

3999hz Sine at 8khz SR

Reply #41
Aliasing is nonlinear distortion so I don't see what's confusing about saying distortion is likely when resampling tones very close to Nyquist.

I'm sorry if I'm annoying but this:
Because its being resampled to 48k, and there is generally massive distortion of anything with 1% of the Nyquist limit with even very high quality resamplers.  Theres a reason 44.1khz audio is 4.1khz above the highest frequency humans are expected to hear.

doesn't sound like you're talking about aliasing.


I see some conflation possibly leading some to confusion.

When the problem is stated as "Within 1% of Nyquist" there are actually two very different conditions. One is 1% above Nyquist, and the other is 1% below Nyquist. 1% below Nyquist cannot generate any aliasing, and 1% above Nyquist is supposed to produce a practically null output with any well-designed digital gear or software. 

Since signals 1% above Nyquist are not legitimate signals there seems to be no need for much discussion of them.  The real world comes to our assistance here, as the intensity of the musical audio spectrum is generally decreasing with increasing frequency and by 15 KHz it is generally very small.

Because the low pass filters commonly used in audio today have pretty steep cut-offs things get interesting if you test with tone bursts at a fairly high repetition rate with carrier frequencies just below Nyquist. This becomes a problem related to Amplitude Modulation. The upper sideband gets chopped off or vastly attenuated and the transient response gets strange. Again the real world comes to our assistance for the reason stated in the previous paragraph.

Resampling software is subject to more variation in performance, and one area of performance is the width of the transition band. Like so  many other things it can be optimized and optimal may not be the narrowest transition band that we can produce. Hardware tends to represent a larger investment, is more inflexible and tends to be more conservatively designed.  I've looked at the transition band for some real world DACs and 3-5 KHz are not unusual.

I don't know of any exhaustive subjective studies that might lead to optimal choices of transition band width.