nedlrichards , will sampling a 40 kHz signal at 48 kHz create the theoretically predicted aliasing? I
If you sample with the audio converters, which use sigma-delta technology, then the built-in digital filter will filter it out. From the CTAG codec datasheet, it seems that when sampling at 96kHz the bandwidth of the filter will go up above 50kHz(see page 11), so that would work to sample a 40kHz signal.
If you use Bela's own analog in (which use the Successive Approximation Register technology), then those are not filtered, and so you should be able to sample a 40kHz signal, even when sampling at 22.05kHz: let's not forget that the sampling theorem talks about a bandwidth of Fs/2, and not a maximum frequency of Fs/2 ! Because of the lack of flitering, these ADCs are noisier. For more info on SAR vs Sigma-delta converters on Bela (and not only), see here.
nedlrichards As a follow up, I looked into twiddle factors but they are a little new to me. I can certainly save effort precomputing and using a few rows in the matrix representation of a DFT. Hope I got that right, and I appreciate the idea.
Remember the DFT definition:

Now, because of Euler's identity, you see that you can compute the value of the DFT at a given frequency bin k as the sum of the product of your signal x and a pair of sinewaves, that is, e.g., in MATLAB:
n = 1:length(x));
X(k) = sum(x .* cos(2*pi*k*n/N) - 1j * sin(2*pi*k*n/N))