What happens when I resample audio?

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
pranavj
Posts: 8
Joined: Tue Jun 29, 2010 7:12 am
Operating System: Please select

What happens when I resample audio?

Post by pranavj » Tue Jul 06, 2010 6:18 am

Hi,

My project rate is 16000 Hz. I generate a 5000 Hz tone. Listen to it.
Then I change project rate to 8000 Hz. Now when I listen to it, it sounds different. Plot spectrum still gives peak at 5KHz.

Then I export that tone (keeping project rate 8K). When I open it, the waveform is gone.

Can somebody please explain what is happening?

Thanks.

pranavj
Posts: 8
Joined: Tue Jun 29, 2010 7:12 am
Operating System: Please select

Re: What happens when I resample audio?

Post by pranavj » Tue Jul 06, 2010 1:54 pm

I recorded the output of my sound card while Audacity played the different sounding tone (when project rate was 8k). It was a 3KHz tone. Seems like it occurred due to folding back of 5KHz, also it's amplitude was much lower than that of the 5KHz tone. I guess this is happening because of roll off of the low pass filter Audacity implements.

kozikowski
Forum Staff
Posts: 68938
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: What happens when I resample audio?

Post by kozikowski » Tue Jul 06, 2010 2:38 pm

It doesn't have to be filtering damage. You're suffering from straight sample damage. Digital sampling has to be at least 2 times the tone you're trying to reproduce. I use the older number of 2.6. To sample a 5000 Hz tone with unquestioned accuracy requires a 13000 Hz sampling frequency. Barely adequate results can be had by sampling at 10000Hz. Lower than that will produce trash, more or less unpredictable depending on the show.

Koz

kozikowski
Forum Staff
Posts: 68938
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: What happens when I resample audio?

Post by kozikowski » Tue Jul 06, 2010 2:41 pm


pranavj
Posts: 8
Joined: Tue Jun 29, 2010 7:12 am
Operating System: Please select

Re: What happens when I resample audio?

Post by pranavj » Tue Jul 06, 2010 3:45 pm

kozikowski wrote: Barely adequate results can be had by sampling at 10000Hz. Lower than that will produce trash, more or less unpredictable depending on the show.

Koz
Thanks for your reply.

I was trying to figure out why this 'trash' output was 3 KHz and not any other frequency. It seems if sampled below Nyquist rate aliasing effect (http://en.wikipedia.org/wiki/Aliasing#S ... _functions) occurs.
It says that in this case the apparent frequency would be |f - N*fs|, where f = sinusoid frequency = 5KHz. N = any integer, fs = sampling rate (8 KHz in my case). So it turns out | 5 -1*8| = 3KHz ! Seems like we can learn some dsp using audacity :)

kozikowski
Forum Staff
Posts: 68938
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: What happens when I resample audio?

Post by kozikowski » Tue Jul 06, 2010 10:53 pm

In analog systems, you'd be getting sum and difference frequencies.

It's picket fencing. View two picket fences one in front of the other and with different numbers of boards. The "wave" you see from across the street is the difference between the two numbers of boards. You get into the brain-bleeding math if the original two fences weren't nailed together evenly.

Koz

Post Reply