I tried generating two nearly inaudible tones in Audacity, with frequencies 16 kHz and 18 kHz. (With a sampling rate of 48 kHz, I also tried this at 44.1 kHz) Playing each in isolation results in a high frequency tone, as expected. But when they are both played together, a loud low frequency sound is heard.
After playing it and recording it, I looked at the spectrogram, it looked like this (the top two tracks are the 16 and 18 kHz tones, generated by audacity-- the bottom two are the results of recording it (in stereo, oops)):
This seemed very odd to me-- the sum of two inaudible frequencies should never result in an audible frequency-- in fact, it should never contain any other frequencies at all!
I expected this to be the result of some sort of non linear operation like saturation, aliasing-- but the most likely culprit seems to be resampling. This site looks a lot like what I'm experiencing. This looks exactly like what I'm seeing...Image below
I tried it again, synthesizing a file from scratch with Python/NumPy/SciPy. output.wav (make sure to download this *.wav file rather than using the embedded player, as the embedded player seems to produce something similar to Audacity on my machine. In Foobar 2000 or VLC it sounds high frequency like expected, but after importing to Audacity without editing the sampling rate it sounds low frequency. Windows Media Player can not even open the file).
So the problem seems to be with Audacity, as generating my own wav file from "scratch" and playing it in VLC or Foobar 2000 works as expected.
I know some signal processing math but I have limited experience actually dealing with the practical effects of audio processing software (or could it be the hardware's fault?). I hope someone could shed some light on this!
(Here is the Python code to generate the wav file):
import numpy as np
from scipy.io import wavfile
#fs = 44.1e3 # similar effects with either of these
fs = 48.0e3
t = np.arange(0, 1.0, 1.0/fs)
f1 = 16e3
f2 = 18e3
x = np.sin(2*np.pi*f1*t) + np.sin(2*np.pi*f2*t)
fname = 'output.wav'
wavfile.write( fname, fs, x )
TL;DR: download and listen to output.wav in VLC or Foobar 2000. It sounds high frequency, as expected. But Audacity butchers it! Why?