Just a test reply to see if I have the same problem Robert's having...

douglas

On 4/9/12 10:43 AM, Julian Schmidt wrote:
Am 09.04.2012 16:24, schrieb Ross Bencina:
Hello Julian,

Assuming all variables are integers, if phase doesn't divide TABLESIZE
then you will get a different waveform amplutude for adjacent cycles.
Perhaps that's what you're seeing?

oh sorry, i forgot to mention.

the phase accumulator is a float.
as well as the phaseIncrement value.

I know that my waveform will start on different amplitudes, but the
effect i'm hearing is very audible.
like a "click" noise about 2-3 times a second.
the root frequency is unaffected, around 10kHz it's a 6dB drop in
frequency, at 20kHz its allready12dB.
the error from the floating point phase wrapping shouldn't be THAT audible.

what confuses me is that i coded a lot of wavetable OSCs on PCand never
had any problems with phase wrap noise.

maybe it's a problem related to the hardware... I'm new to the cortex m4.
could it have to do with a frequency error on the I2S bus?
The I2S bus is configured to run on 44100Hz
but due to prescalers and external xtal frequency i can only get an
actual SR of 44002.75Hz SR

so when i generate a waveform of 440Hz it is nearly a multiple of the SR
my audio codec is running on.

julian

At each cycle start the he value of phase will be different. The
pattern of different waveforms will repeat at the rate of the LCM of
phaseInc and TABLESIZE.

Usually you would use a fixed point phase accumulator and phase
increment so you can have subsample accurate increment. That won't
change the fact that frequencies that don't have an integer-sample
period will look different each cycle.

Ross.



On 9/04/2012 11:28 PM, Julian Schmidt wrote:
Hello all,

I'm trying to get an oscillator running on the STM32F4 discovery board.
I'm sending my audio with 44100Hz via I2S to the onboard codec.
However I'm experiencing strange problems.

my code ist quite straight forward:

phase += phaseInc(440); // calculate the phase increment for 440 hz and
add it to phase
if(phase >= TABLESIZE) phase -= TABLESIZE;
return phase/TABLESIZE;

this should give me a non bw limited saw from 0 to 1.f
(I also tried it with an actual wavetable in use. a sine is played fine.
but as soon as overtones are added i get the fluttering)

My problem is that i get periodic amplitude modulations on the overtones
about 2-3 times a second.
the root frequency amplitude is fixed, but the higher the overtone
frequency, the more it's amplitude drops every now and then.
this screenshot illustrates the waveform. the upper waveform has some
ringing on the discontinuity and the lower has not.
http://i.imgur.com/JyuEr.png (this image is taken from an inverted saw
wavetable. but the flutter is the same, no matter if i use a bandlimited
WT or output the phase counter directly)
the waveform oscillates between the upper and the lower image.

the amplitude flutter from the overtones is also frequency dependent.
at 439 and 441 Hz its not really audible.

so my tought is that is has to do with the wrap of the phase counter.
but i can't get my head around whats wrong.
any ideas where this change in overtone amplitude could come from?

cheers,
julian






--
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

--
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


--
............................................... http://artbots.org
.....douglas.....irving........................ http://dorkbot.org
.......................... http://music.columbia.edu/cmc/music-dsp
...........repetto............. http://music.columbia.edu/organism
............................... http://music.columbia.edu/~douglas

--
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

Reply via email to