Thanks gf, is there some clever way of combining the first convolution into the 3 stage filter, and get a vector so, all the work could be done with a single run of conv?
I mean combining the ref signal with the 3 stage filters.
Not normally. The multiplication with the referrence signal is not a convolution.
A special case applies to your program, though. If you are
only interested in y3(end) and y3(end-1), then you can omit the calculation of y3(1:end-2). In this case the convolution degrades and could be replaced by two dot product calculations, and the multiplication with the reference signal could be merged into one term of each dot product. But as I said, that's a special case, applying only to your program as is. The algorith from the paper is rather suposed to be fed with an infinite continuous streams of samples, and to calculatae a frequency estimate for
each sample, and not just once every 768
th sample.