[sdiy] Harmonic bandwidth

Scott Gravenhorst music.maker at gte.net
Wed Jan 9 15:18:16 CET 2008


music.maker at gte.net wrote:
>Ok, now I've done it.  I wrote a C program to generate 3 .wav files using double float,
>one with zero starting phase values and 2 more each with different random, but constant
>phase values.  The program uses 32 harmonics in the series that produces a sawtooth.  I
>was careful to limit clipping and applied the same worst case attenuation value to all
>three.  Each sample is several seconds long.
>
>I most definately hear a difference in timbre.
>
>The question is "why?".  
>
>Surely, there is something about digital generation of waveforms.
>

One thing I just noticed, in the documentation for the sin() function for C, it says "The sin()
function may lose accuracy when its argument is far from 0.0".  

My particular program checks the value before handing it to the sin() function, but I have two
questions:

1) No computer value for pi is exactly accurate, so to monitor the current angle value and subtract
2*pi when it goes over 2*pi is also an inaccurate value.

2) how far from 0.0 does one have to go to get an inaccurate _enough_ sin() value?

Is it possible that these reasons are all it takes?  I would have to assume that these problems
exist in any digital approximation of this.

-------------------------------------------------------------

-- Scott Gravenhorst
-- GateMan-III - FPGA Based Monophonic MIDI Synthesizer with SVF
-- PolyDaWG/8 - FPGA Based 8 Voice Polyphonic MIDI Synthesizer
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.




More information about the Synth-diy mailing list