Compensate delay of non-symmetric (non-linear phase) filter Lets assume I want to apply a matched filter h which is non-symmetric to my signal x and the output is y in matlab:

y=filter(h,1,x);


Now I am interested in comparing the information between my filtered signal yand my input x. For this I want to compensate for the delay of the filter h.

When googling this topic I found the following tutorial which handles linear-phase fir filters. Obviously in such a case the group delay is $\frac{N-1}{2}$ given that the filter has the length $N$. 

%this is the example from matlab
delay = mean(grpdelay(h,1,128)); 
x = x(1:end-delay);
y(1:delay) = [];


However, I am aware that the group delay of a non symmetric filter is frequency depending and I am not sure how to proceed to align my signals in time to compare them. As I am interested in real time application the function filtfilter is not applicable.

So my question is, how do I estimate in the best way the time delay to align (sync?) my signals in time given the coefficients of a non-symmetric filter h?

delay = .... h ....? 
x = x(1:end-delay);
y(1:delay) = [];


The desired output should look like the red curve in the following figure



Here the signal in blue is the input signal x and in green the filtered signal y. However, I would like to to compensate for the delay of the green signal so that the input and output align in time as in the case of the red curve.
If your filters have a low pass characteristic (which at least the one in your example appears to have), then a possibly useful measure for the delay is the center of gravity of the impulse response:

$$\hat{\tau}=\frac{\displaystyle\sum_nnh[n]}{\displaystyle\sum_nh[n]}\tag{1}$$

For more general impulse responses, other than low pass, you can modify $(1)$ by either taking magnitudes or squares of $h[n]$. Note that $(1)$ is the filter's group delay evaluated at DC.