How is downsampling done when recording new wave?

GoldWave general discussions and community help
Post Reply
Videogamer555
Posts: 43
Joined: Wed May 25, 2011 2:28 am

How is downsampling done when recording new wave?

Post by Videogamer555 » Tue Nov 06, 2012 4:49 pm

When I select something such as 1000 samples per second but the native SR of my sound card is 44100 samples per second, how does it convert 44100SPS to 1000SPS? Does it just drop the intermediate data points? Or does it perform an average of the data points over the duration of the slower SR, and use that average as the data point for the duration at the slow SR?

cdeamaze
Posts: 87
Joined: Thu Oct 05, 2006 3:19 pm

Re: How is downsampling done when recording new wave?

Post by cdeamaze » Tue Nov 06, 2012 8:56 pm

See, for example, 8/1/12 Forum discussion: downsampling an oversampled file.

Gord
Posts: 391
Joined: Thu May 21, 2009 4:26 pm
Location: Canada

Re: How is downsampling done when recording new wave?

Post by Gord » Wed Nov 07, 2012 8:24 am

Thanks, cdeamaze. The OP was asking about how resampling worked "on the fly" while recording a new sound. Having read the thread you cited I'm now curious about that too, as DewDude420's comment said that there's a "ton of math" involved in [doing a good job of] resampling. Specifically, I'm curious as to whether the same resampling algorithm can be used for both "on the fly" recording and for processing after the fact.

DougDbug
Posts: 2032
Joined: Wed Feb 16, 2005 3:33 pm
Location: Silicon Valley

Re: How is downsampling done when recording new wave?

Post by DougDbug » Wed Nov 07, 2012 2:54 pm

Specifically, I'm curious as to whether the same resampling algorithm can be used for both "on the fly" recording and for processing after the fact.
I'm pretty sure that's done by the drivers (not GoldWave). And, I assume it done by the Microsoft-supplied part of the "driver stack".

If you are using a pro audio device with ASIO drivers, you can bypass the normal Windows drivers and you will only be able to use the sample rate(s) supported by the hardware. (I don't know if GoldWave supports ASIO.)

cdeamaze
Posts: 87
Joined: Thu Oct 05, 2006 3:19 pm

Re: How is downsampling done when recording new wave?

Post by cdeamaze » Wed Nov 07, 2012 4:55 pm

Downsampling from 44.1K samples/sec to 1K samples/sec
For postprocessing, here is one way to do it:
(1) zero stuffing
Insert 9 zeros between samples to get sampling rate of 441K samples/sec
(2) lowpass filtering to 500Hz (anti-aliasing filter)
(3) For every 441 samples: pick 441th sample and throw 440 samples away. The end results: 1K samples/sec

Gord
Posts: 391
Joined: Thu May 21, 2009 4:26 pm
Location: Canada

Re: How is downsampling done when recording new wave?

Post by Gord » Wed Nov 07, 2012 5:30 pm

DougDbug wrote:
Specifically, I'm curious as to whether the same resampling algorithm can be used for both "on the fly" recording and for processing after the fact.
I'm pretty sure that's done by the drivers (not GoldWave). And, I assume it done by the Microsoft-supplied part of the "driver stack".

If you are using a pro audio device with ASIO drivers, you can bypass the normal Windows drivers and you will only be able to use the sample rate(s) supported by the hardware. (I don't know if GoldWave supports ASIO.)
Thanks, Doug. After reading your reply I remembered that there was some discussion around this topic during the last Beta because DirectSound and WASAPI behaved quite differently in that respect. DirectSound would bend over backwards to support modes that were not native to the audio hardware, whereas WASAPI stuck much closer to what the hardware would natively support.

So it looks like the answer to the OP's question is:
Videogamer555 wrote:When I select something such as 1000 samples per second but the native SR of my sound card is 44100 samples per second, how does it convert 44100SPS to 1000SPS? Does it just drop the intermediate data points? Or does it perform an average of the data points over the duration of the slower SR, and use that average as the data point for the duration at the slow SR?
When recording directly to a non-native sampling rate the resampling algorithm is whatever the drivers for your audio device were programmed to do.

Post Reply