[music-dsp] OSC problem on STM32F4Discovery
julian_schmidt at chipmusik.de
Mon Apr 9 16:32:48 EDT 2012
I think you win! ;)
first i tried switching to integer phase accumulators like RBJ suggested.
It sounded exacly the same.
I really think it is an aliasing problem.
but not due to the wrong wavetable content, but due to a cheap audio
codec with poor filters.
I toyed around with the mip mapping settings of the limited saw table
and an FFT analyzer.
even when i output a single 440hz sine i get harmonics starting at -48db
up to nyquist and beyond.
the amplidude of these harmonics increases as i increase the number of
sines in my wavetable.
if i play 10 harmonics from the saw table at 440Hz beginning from the
4th harmonic I see that harmonics are damped or increased in the shape
of the codecs filter stopband riffle ( 4th and 5th harmonic damped, than
amplified in a bell shape)
the harmonics go up to nyquist (allthoug the higher ones are in the
range ob -60 to -66dB)
with the right amount of harmonics i get a 4dB beating at 6.5Khz at -30dB
and a 30dB beating at around 12kHz at around -42dB again in the shape of
a bell like in the codecs stopband ripple
I think now i will activate the tone control of the codec and see if
that can surpress the bleeding harmonics.
Am 09.04.2012 20:28, schrieb Olli Niemitalo:
> On Mon, Apr 9, 2012 at 7:17 PM, Julian Schmidt
> <julian_schmidt at chipmusik.de> wrote:
>> setting the phase increment to an integer value solves the problem.
>> adding linear or cubic interpolation makes it a little better, but the
>> pulsing is still very audible.
>> The nearer i get to an integer phase increment, the slower the amplitude
>> of the harmonics is pulsating. at an integer value it stops.
> All of these findings support the hypothesis that it is an aliasing
> problem. So it doesn't need to have to do with phase wrapping. Saw
> wave and similarly discontinuous waveforms are particularly nasty when
> it comes to aliasing problems because the harmonics decay so slowly
> (amplitude of Nth harmonic = 1/N). I bet the reason why you had so
> little problems with the sine wave is because it was greatly
> oversampled (that is, the highest frequency, in this case the
> fundamental frequency, is less than sampling frequency / 2).
> Do a mental check on what the bandwidth of your wavetable is, and
> whether you will get aliasing by playing back the wavetable at a
> different rate than 1:1 and by resampling it to the target sampling
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
More information about the music-dsp