There's a strange behavior in canvases with overlapped blocks without resampling (e.g. set with [block~ 1024 2]).
In such canvases e.g. [osc~ 440] delivers a cosine wave with an actual frequency of 220 Hz, because of the double overlap.
This is because dsp signal vectors carry the wrong sample rate (sp[0]->s_sr = 88200 instead of 44100).
[samplerate~] correctly reports 44100 because it uses a different method of retrieving the sample rate.
For osc~ it's possible to take into account the wrong internal sample rate, but that's certainly not possible in more general cases.
Anonymous
i always wanted to have the samplerate & the overlap factor within the signal-structure (with samplerate being the "real" samplerate times all the upsampling)
I have encountered this when playing with FFTs, and wonder why it's like this.
The behavior is directly traceable to d_ugen.c which says:
srate = parent_srate * realoverlap * upsample / downsample;
The
* upsample / downsample
part makes total sense to me, but I don't understand whyrealoverlap
is folded into the samplerate. Could you explain why?Am 28. Dezember 2019 11:35:53 MEZ schrieb mrshpot mrshpot@users.sourceforge.net:
"samplerate" is really just a measure of how many samples you process in a given timespan.
if you have an overlap-factor of 2, you get:
so in 1 second, Pd has to process (44100/2+44100+44100/2) samples. which makes a total of 88200 samples.
given the above, it's obvious that you process twice as much samples (on a second, or any given timespan) with
[block * 2]
than with[block * 1]
, that's why samplerate doubles as well...(indeed, there's a loss of information)