IPB

Welcome Guest ( Log In | Register )

> Upload forum rules

- No over 30 sec clips of copyrighted music. Cite properly and never more than necessary for the discussion.


- No copyrighted software without permission.


- Click here for complete Hydrogenaudio Terms of Service

2 Pages V  < 1 2  
Reply to this topicStart new topic
3999hz Sine at 8khz SR, Generated by Audacity to prove a point.
xnor
post Aug 31 2013, 20:36
Post #26





Group: Developer
Posts: 1430
Joined: 29-April 11
From: Austria
Member No.: 90198



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.

This post has been edited by xnor: Aug 31 2013, 20:44


--------------------
Sighted evaluation without blind testing is blind.
Go to the top of the page
+Quote Post
phofman
post Aug 31 2013, 20:41
Post #27





Group: Members
Posts: 357
Joined: 14-February 12
Member No.: 97162



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

Attached Image


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

Attached Image

Go to the top of the page
+Quote Post
bandpass
post Aug 31 2013, 21:24
Post #28





Group: Members
Posts: 378
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (xnor @ Aug 31 2013, 20:36) *
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%.
Go to the top of the page
+Quote Post
C.R.Helmrich
post Aug 31 2013, 21:32
Post #29





Group: Developer
Posts: 705
Joined: 6-December 08
From: Erlangen Germany
Member No.: 64012



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.

QUOTE (saratoga @ Aug 31 2013, 20:33) *
QUOTE (greynol @ Aug 31 2013, 13:51) *
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:

Attached Image


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

Chris

This post has been edited by C.R.Helmrich: Aug 31 2013, 21:39


--------------------
If I don't reply to your reply, it means I agree with you.
Go to the top of the page
+Quote Post
Banned
post Aug 31 2013, 22:15
Post #30





Group: Members
Posts: 13
Joined: 12-January 13
Member No.: 105821



QUOTE (saratoga @ Aug 31 2013, 20:37) *
Aliasing is nonlinear distortion so I don't see what's confusing about saying distortion is likely when resampling tones very close to Nyquist.

Aliasing is linear.
Go to the top of the page
+Quote Post
xnor
post Aug 31 2013, 22:20
Post #31





Group: Developer
Posts: 1430
Joined: 29-April 11
From: Austria
Member No.: 90198



QUOTE (Banned @ Aug 31 2013, 23:15) *
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.

This post has been edited by xnor: Aug 31 2013, 22:22


--------------------
Sighted evaluation without blind testing is blind.
Go to the top of the page
+Quote Post
greynol
post Sep 1 2013, 03:00
Post #32





Group: Super Moderator
Posts: 10715
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (C.R.Helmrich @ Aug 31 2013, 13:32) *
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.

This post has been edited by greynol: Sep 1 2013, 03:32


--------------------
My eyes are equipped with false negative prevention.
Go to the top of the page
+Quote Post
xnor
post Sep 1 2013, 03:38
Post #33





Group: Developer
Posts: 1430
Joined: 29-April 11
From: Austria
Member No.: 90198



QUOTE (greynol @ Sep 1 2013, 04:00) *
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.

This post has been edited by xnor: Sep 1 2013, 03:40


--------------------
Sighted evaluation without blind testing is blind.
Go to the top of the page
+Quote Post
Alexey Lukin
post Sep 1 2013, 03:53
Post #34





Group: Members
Posts: 209
Joined: 31-July 08
Member No.: 56508



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.
Go to the top of the page
+Quote Post
greynol
post Sep 1 2013, 06:33
Post #35





Group: Super Moderator
Posts: 10715
Joined: 1-April 04
From: San Francisco
Member No.: 13167



Thanks everyone. Sorry for not getting it the first time around.


--------------------
My eyes are equipped with false negative prevention.
Go to the top of the page
+Quote Post
stv014
post Sep 1 2013, 09:14
Post #36





Group: Members
Posts: 48
Joined: 26-February 13
Member No.: 106902



QUOTE (C.R.Helmrich @ Aug 31 2013, 22:32) *
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.

This post has been edited by stv014: Sep 1 2013, 09:16
Go to the top of the page
+Quote Post
stv014
post Sep 1 2013, 09:34
Post #37





Group: Members
Posts: 48
Joined: 26-February 13
Member No.: 106902



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.

This post has been edited by stv014: Sep 1 2013, 09:41
Go to the top of the page
+Quote Post
graham_mitchell
post Jan 3 2015, 03:36
Post #38





Group: Members
Posts: 41
Joined: 24-August 04
Member No.: 16498



QUOTE (hornpipe2 @ Aug 30 2013, 21:04) *
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.
Go to the top of the page
+Quote Post
saratoga
post Jan 3 2015, 03:42
Post #39





Group: Members
Posts: 5403
Joined: 2-September 02
Member No.: 3264



QUOTE (graham_mitchell @ Jan 2 2015, 21:36) *
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.

This post has been edited by saratoga: Jan 3 2015, 03:50
Go to the top of the page
+Quote Post
xnor
post Jan 3 2015, 14:12
Post #40





Group: Developer
Posts: 1430
Joined: 29-April 11
From: Austria
Member No.: 90198



QUOTE (graham_mitchell @ Jan 3 2015, 03:36) *
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? sad.gif


--------------------
Sighted evaluation without blind testing is blind.
Go to the top of the page
+Quote Post
splice
post Jan 4 2015, 01:33
Post #41





Group: Members
Posts: 151
Joined: 23-July 03
Member No.: 7935



QUOTE (xnor @ Jan 3 2015, 06:12) *
QUOTE (graham_mitchell @ Jan 3 2015, 03:36) *
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? sad.gif


I'm doing this very thing right now for someone over on the Head-Fi forum in the Sound Science section.


--------------------
Regards,
Don Hills
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Jan 4 2015, 15:20
Post #42





Group: Members
Posts: 5498
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (xnor @ Aug 31 2013, 14:15) *
QUOTE (saratoga @ Aug 31 2013, 20:37) *
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:
QUOTE (saratoga @ Aug 30 2013, 22:08) *
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.


Go to the top of the page
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 6th May 2015 - 23:17