[sdiy] Harmonic bandwidth
Jim Palmer
jimp at pobox.com
Wed Jan 9 18:06:52 CET 2008
Scott Gravenhorst wrote:
> 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.
>>
great! double precision math will eliminate rounding error as a cause.
i looked for an old project i made to create shepard sweeps, but couldn't find it.
would be easy to mod that for this purpose. it was a delphi project though...
>> I most definately hear a difference in timbre.
>>
>> The question is "why?".
>>
>> Surely, there is something about digital generation of waveforms.
>>
i really hope not. it might be good to test the format itself by making clips with
different resolution (both bit depth and sample rate) and comparing them
compression techniques that use frequency domain will no doubt cause errors...
> 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.
>
i have very little doubt that the sin() function does exactly this and the accumulated error is
the only source of error here. this can be easily tested by checking the difference between
sin( mod(theta, 2*PI) ) and sin(theta). if there is a difference it may be due to a higher precision
representation of pi in the sin function. also, the error should be the same for
a given harmonic and time with only phase offset different
More information about the Synth-diy
mailing list