Help for Audacity on Windows.
Forum rules
This forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at
https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the
1.2.x and
1.3.x forums.
-
steve
- Site Admin
- Posts: 80679
- Joined: Sat Dec 01, 2007 11:43 am
- Operating System: Linux *buntu
Post
by steve » Sat Jun 08, 2019 5:14 pm
Trebor wrote: ↑Sat Jun 08, 2019 4:39 pm
In Audacity 2-3-2 on Windows 8 that code just speeds it up.
It doesn't "only" speed it up. It resamples the selected audio to 8 kHz, and returns the audio to the track. It does NOT change the Audacity track which is still set to 44.1 kHz.
Because there are less samples in the returned audio than there were in the original (because it has been resampled), it takes up less space in the audio track, effectively "speeding it up".
By changing the track sample rate (from the track's drop down menu) to 8000 Hz, the samples are then correctly spaced out at intervals of 1/8000 second, and the track will play at the correct speed.
-
Trebor
- Posts: 9847
- Joined: Sat Dec 27, 2008 5:22 pm
- Operating System: Windows 8 or 8.1
Post
by Trebor » Sat Jun 08, 2019 5:47 pm
steve wrote: ↑Sat Jun 08, 2019 5:14 pm
By changing the track sample rate (from the track's drop down menu) to 8000 Hz,
the samples are then correctly spaced out at intervals of 1/8000 second,
and the track will play at the correct speed.
OK but that plays it at the correct speed, but it has nothing above 4kHz.
It doesn't have the high-frequency digital-artefacts,
which was the brief.
-
DVDdoug
- Forum Crew
- Posts: 9278
- Joined: Fri Sep 10, 2010 11:30 pm
- Operating System: Windows 10
Post
by DVDdoug » Sun Jun 09, 2019 1:54 am
OK but that plays it at the correct speed, but it has nothing above 4kHz.
It doesn't have the high-frequency digital-artefacts, which was the brief.
Right. It won't. The Nyquist limit is half the sample rate.
Aliasing is "false"
lower frequencies that are created if you don't filter
before downsampling.
-
steve
- Site Admin
- Posts: 80679
- Joined: Sat Dec 01, 2007 11:43 am
- Operating System: Linux *buntu
Post
by steve » Sun Jun 09, 2019 10:36 am
DVDdoug wrote: ↑Sun Jun 09, 2019 1:54 am
Right. It won't. The Nyquist limit is half the sample rate.
Aliasing is "false" lower frequencies that are created if you don't filter before downsampling.
Exactly so.
Example, If you generate a sine tone at 5 kHz and resample to 8 kHz, the Nyquist frequency is 4 kHz. "Proper" resampling (with anti-alias filtering) will remove the 5 kHz sine tone and the result will be silence. Resampling without anti-alias filtering will create a strong peak at 3 kHz (the alias frequency).
The code I provided will also create additional frequencies at a much lower level. These are the result of "distortion" cause by the linear interpolation.

- firsttrack000.png (26.86 KiB) Viewed 399 times
-
8bit_coder
- Posts: 32
- Joined: Sun Dec 03, 2017 4:31 am
- Operating System: Windows 8 or 8.1
Post
by 8bit_coder » Sun Jun 09, 2019 5:06 pm
The problem is the sheer act of selecting 8khz in the drop down after using the nyquist command does the exact same effect as just selecting resample and selecting 8khz. The dblue crusher also doesn't allow for a specific sample rate, just a number of sample reductions
-
steve
- Site Admin
- Posts: 80679
- Joined: Sat Dec 01, 2007 11:43 am
- Operating System: Linux *buntu
Post
by steve » Sun Jun 09, 2019 5:27 pm
8bit_coder wrote: ↑Sun Jun 09, 2019 5:06 pm
the sheer act of selecting 8khz in the drop down after using the nyquist command does the exact same effect as just selecting resample and selecting 8khz.
No it doesn't.
When you select Resample, the audio is resampled by "soxr" (a high quality resampling library) which applies anti-alias filtering prior to resampling.
With the steps that I posted, the audio is resampled by Nyquist using linear interpolation and no pre-filtering.
Try the comparison that I described in this post:
viewtopic.php?p=371369#p371369
You will see that Audacity's resampling (using soxr) produces silence, whereas Nyquist's "force-srate" produces an alias 3 kHz waveform.