First off I’m using windows 8.1 Pro and Audacity 2.2.2
Whenever I resample something in audacity, it resamples it but it also has an automatic low pass to prevent the alias frequencies from coming through. Is there a way I can disable this to hear for example a 8 khz sample rate file without the low pass, meaning including all of the hiss and alias noises along with that sample rate?
Thanks.
PS: I am willing to modify code in my copy of audacity to attempt this
PS: I am willing to modify code in my copy of audacity to attempt this
You’ll probably have to do that. Filtering is part of any proper downsampling algorithm. I’ve never even looked at the Audacity code but I assume you know it’s open source.
You can probably make a [u]Nyquist[/u] plug-in. That should be easier than modifying the Audacity code and I’d imagine it’s “easy” if divide the sample rate by even numbers.
From the track drop-down menu, select “Rate” and set it to 8000.
The “force-srate” command resamples a sound using linear interpolation without pre-filtering. TRACK is a special variable that passes the selected audio from Audacity to Nyquist.
By the way, the current and recommended version of Audacity is 2.3.2. It is available via the Audacity website: Audacity ® | Download for Windows
Yes, I know of that nyquist command. But it still acts the same as if I just clicked resample. This simply does that but in a more complicated way and it doesn’t give the results I want.
To the Trikit solution:
Yes, I know I can use a bit crusher, but that defeats the whole purpose of being able to set a specific sample rate.
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.
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.
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
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.