[music-dsp] OSC problem on STM32F4Discovery

Julian Schmidt julian_schmidt at chipmusik.de
Mon Apr 9 17:21:30 EDT 2012


here are some screenshots...

the beating bell shape on 440Hz sinus with 84 harmonics
http://i.imgur.com/B4s0M.png

a simple sine table 220Hz
http://i.imgur.com/hPKj1.png

julian


Am 09.04.2012 22:32, schrieb Julian Schmidt:
> 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.
>
> julian
>
>
>
>
> 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
>> frequency.
>>
>> -olli
>> -- 
>> dupswapdrop -- the music-dsp mailing list and website:
>> subscription info, FAQ, source code archive, list archive, book 
>> reviews, dsp links
>> http://music.columbia.edu/cmc/music-dsp
>> http://music.columbia.edu/mailman/listinfo/music-dsp
>
> -- 
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book 
> reviews, dsp links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp



More information about the music-dsp mailing list