[music-dsp] Re: Waveshaping
Erik de Castro Lopo
mdsp-erikd at mega-nerd.com
Fri Oct 5 04:33:20 EDT 2007
Aaron Oxford wrote:
> Hi all,
>
> I am by no means an expert on oversampling, but FWIW I recently
> needed to upsample some stuff to between 4x and 16x from 'normal',
> and I found that a simple linear interpol upsample followed by a
> couple of passes through a bandpass (I wanted to remove DC also)
> worked well (and more importantly in my case was easy to write from
> first principles in C#).
Please do not suggest linear interpolation without mention its
rather severe limititions, in particular that the signal to noise
ratio is signal dependant and appallingly bad under many normal
situations.
For instance, for upsampling a single sine wave from 44100Hz to
48000Hz result in the following SNRs:
Sine freq SNR
==========================
333 Hz 146.0 dB
666 Hz 115.8 dB
1332 Hz 103.8 dB
2664 Hz 49.8 dB
5328 Hz 38.7 dB
10656 Hz 28.4 dB
21312 Hz 19.5 dB
Signal to noise ratios worse than about 40db are unacceptable for
most applications (ie only acceptable if you are *trying* to generate
noisy signals). As you can see, linear interpolation worlk quite
well when the maximum frequency component in the source signal is
less than about 1/8 of the sample rate.
> I didn't need to downsample but I'd imagine the same would work well
> in reverse
Please don't imagine. Measure. Its really not that hard.
> As for the technique you suggested yourself, I'm not sure if you're
> applying that equation to create intermediate samples or simply using
> that function to effectively create a smoothed waveform as your input
> (you're just applying the shaping function in the same step, right?).
The original poster was talking about waveshaping synthesis:
http://en.wikipedia.org/wiki/Waveshaper
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
C++ is a siren song. It *looks* like a HLL in which you ought
to be able to write an application, but it really isn't."
-- Alain Picard (comp.lang.lisp)
More information about the music-dsp
mailing list