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: 498
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
Go to the top of the page
+Quote Post
phofman
post Aug 31 2013, 20:41
Post #27





Group: Members
Posts: 283
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: 326
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: 686
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: 498
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
Go to the top of the page
+Quote Post
greynol
post Sep 1 2013, 03:00
Post #32





Group: Super Moderator
Posts: 10000
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


--------------------
Placebophiles: put up or shut up!
Go to the top of the page
+Quote Post
xnor
post Sep 1 2013, 03:38
Post #33





Group: Developer
Posts: 498
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
Go to the top of the page
+Quote Post
Alexey Lukin
post Sep 1 2013, 03:53
Post #34





Group: Members
Posts: 191
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: 10000
Joined: 1-April 04
From: San Francisco
Member No.: 13167



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


--------------------
Placebophiles: put up or shut up!
Go to the top of the page
+Quote Post
stv014
post Sep 1 2013, 09:14
Post #36





Group: Members
Posts: 47
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: 47
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

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: 31st July 2014 - 12:59