Hi everyone,
First of all, thank you all for your amazing achievement with Faust. I am
delighted to use it and amazed by all this work. Regarding my problem, I try
for some time now to implement a pitch tracker implementing autocorrelation,
for a more reliable metering than the zero crossing method. I ended with the
following version, strongly inspired from Tiziano Bole work :
import("stdfaust.lib");
BufferLength=4;
pitch(x) = ma.SR / max(M, 1) - ma.SR * (M == 0)
with {
AC(x, k) = sum(j, BufferLength, (x@(j))*(x@(j+k))) / (BufferLength) ; //
Correlating two signals, on the buffer length, ideally over 600 samples with
actual SR
i = +(1) ~_ ;
U = AC(x,i) > AC(x,0)/2; // Detection of a good correlation,
AC(x,0) being the highest possible value, so its half becomes the detection
threshold
V = AC(x,i) <= AC(x,i+1);
W = AC(x,i+1) > AC(x,i+2);
Y = U: *(V) : *(W);
N = (+(1) : *(1 - Y)) ~ _;
M = (N' + 1) : ba.sAndH(Y);
};
process = pitch : hbargraph(“Frequency", 50, 2000);
The problem seems to be located in the Autocorrelation function : AC(x, k) =
sum(j, BufferLength, (x@(j))*(x@(j+k))) / (BufferLength) since the error says
“can’t compute the min and max values of […] used in delay expression […]
(probably a recursive signal).
Any chance to get it working? I do not see actually how to fix boundaries for
the delay lines, or get rid of the recursive guess from the compiler.
Thanks for reading this,
Nicolas_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users