Hi Klaus,
The filters are necessary to obtain a -1 +1 range, I think.

import("stdfaust.lib");

correlate(l,r) = l*l ,r*r , l*r : par(i,3, si.smooth(0.9)) : sqrt, sqrt, _ : 
*,_ : /;
correlate_meter(x,y) = x,y <: x , attach(y, (correlate : 
hbargraph("corr”,-1,1)));

process = correlate_meter;

Try playing with the si.smooth coefficient. 

best,
giuseppe

> On 3 Aug 2021, at 14:09, Klaus Scheuermann <kla...@posteo.de> wrote:
> 
> Could it be something like this?
> 
> (according to the 'correct' algorithm in 
> https://www.beis.de/Elektronik/Correlation/CorrelationCorrectAndWrong.html )
> import("stdfaust.lib");
> 
> correlate(l,r) = l*l ,r*r , l*r : sqrt, sqrt, _ : *,_ : / :_;
> correlate_meter(x,y) = x,y <: x , attach(y, (correlate : 
> hbargraph("corr",-1,1))) : _,_;
> 
> process = _,_ : correlate_meter: _,_;
> 
> I am not sure about the lowpass filters though. Maybe not needed in the 
> digital domain?
> 
> Also, my code only returns -1 or 1 while it should be returning a range of -1 
> and 1, right?
>> The correlation is either expressed in % from -100% to +100% or as the 
>> correlation factor, which ranges from -1 to +1. Note that due to the 
>> correlation algorithm the level of both signals does not matter, i.e., it 
>> does not influence the measured result.
>> 
>> When a mono source is used for a stereo signal both stereo channels will be 
>> +100% correlated. When e.g. in a stereo signal both channels contain 
>> completely different signals, e.g. left (and only left) is the trumpet and 
>> right (and only right) is the guitar these stereo channels will be 0% 
>> correlated. With a third instrument appearing in both channels, the 
>> correlation will be somewhere between 0 and +100%.
>> 
> 
> Ideas?
> Danke :)
> Klaus
> 
> 
> 
> 
> On 03.08.21 12:48, Klaus Scheuermann wrote:
>> Hello List,
>> 
>> I just wondered, if anyone has implemented a stereo audio correlation
>> meter/analyser in faust?
>> 
>> If yes - great!
>> If no - I have another project :)
>> 
>> Here is what I found about the algorithm(s):
>> 
>> https://www.beis.de/Elektronik/Correlation/CorrelationCorrectAndWrong.html
>> 
>> 
>> I never learned analog electronic schematics, but it seems it should not
>> be extremely hard to transfer to faust.
>> 
>> Cheers, Klaus
>> 
>> 
>> 
>> _______________________________________________
>> Faudiostream-users mailing list
>> 
>> Faudiostream-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to