sine wave with phasor~
Hi guys,
Just for fun today I felt like recreating a sine wave without cycle~ object.
It should have been a simple task, but for some reason the resulting frequency, as detected by scope~, is slightly different from the desired one. The difference is not big at lower frequencies but get significant at higher ones.
Can anyone take a look and advise please?
nope.
[+~ 0.75]
[cos~ ]
i don't get it... and why cos~?
i believe the generation of the cosine wavetable in cycle~ is only that precise because it is so short (512 samples), isnt it?
for a"useful" and "bandlimited" sinewave oscillator it should be enough to calculate points in 32 bits or lower, and if you are gonna store the result, 16 bits will be fine. :)
thanks guys, that's pretty interesting information :)
yes i know that it can be longer now, but i thought not for the default sine?
i only believe what i see. ^^
... of course there are audiophiles which can hear the difference between a single float64 sample calculated in precise mode vs calculated in strict mode, but i have seen so many weird quirks in max objects that for now i assume that in cycle~ there is simply a little green man sitting on a little chair knitting the cosine waves by hand when it receives a bang. (and knitting is limited to 512/minute as we all know.)
I only believe what I hear... (Klirrfaktor...; - )
Here is a different approach to this kind of question: the applied physicist's perspective, thinking in terms of relative magnitude, rather than specific numbers. First, the relative step size of a wave with 512Hz frequency is ~1/500, or 2/1000, or 0.2%. That means a 512-step staircase wave is, generally speaking, 99.8% accurate in the temporal domain. Linear interpolation halves the noise factor to 99.9%. Spline interpolation increases predictive accuracy by about a third.
Floating-point rounding errors, aliasing artifacts, distortion from digital-to-analog conversion, speakercone nonlinearity, and listening-space audio reflections altogether tend to be far more significant. 512Hz is close to Middle C, so it is about in the middle of the average adult's hearing span.
It's a fair tradeoff to use 64-bit floating-point instead of doubling the lookup to 1024 entries. And it's fair to say a 512-sample wavetable is more than sufficient, providing comparatively little deviation from an ideal reproduction in the DSP domain by itself.