sc3-plugins icon indicating copy to clipboard operation
sc3-plugins copied to clipboard

TPV and SMS frequencies 1 bin too low?

Open weefuzzy opened this issue 8 years ago • 1 comments

I've been trying to understand why the results I get with TPV and SMS aren't as good as I'd expected. If I run something like the below (i.e. sinusoids in bin centres), and uncomment the printf, e.g. at line 456 of TPV.cpp then the reported frequency seems to be exactly one bin lower than the input sinusoid. Indeed, if I do something unprincipled and just change the expression for frequency from (i-1)*(angmult)*freqmult to i*(angmult)*freqmult then I hear the expected output.

b = Buffer.alloc(s,1024,1); 
(
{
	var in , fft, output;
	in = SinOsc.ar((SampleRate.ir / 1024) * (Stepper.kr(Impulse.kr(0.5), min:2,max:10)));
	fft = FFT(b, in, wintype:1);
	output=TPV.ar(fft, 1024, 512, currentpeaks:1);
	[output,in*0.25]
}.scope
)

or

(
{
	var in, output;
	in= SinOsc.ar((SampleRate.ir / 1024) * Stepper.kr(Impulse.kr(0.5), min:2,max:10));
	output=SMS.ar(in, maxpeaks: 1, useifft:0, tolerance:31, noisefloor: 0.001);
	[output[0],in*0.25]
}.scope
)

weefuzzy avatar Oct 11 '17 15:10 weefuzzy

Hello,

You'll get more answers on your questions regarding specific UGens in this repositpry if you ping the respective author... I can also try to help you finding her/his github name if needed (if you provide me with the real world name).

LFSaw avatar Oct 26 '17 14:10 LFSaw