Let's say I have two signals $x$ and $y$, sampled $N$ times, i.e.
$$ x = [ x_{1}, x_{2}, ..., x_{N} ] $$ $$ y = [ y_{1}, y_{2}, ..., y_{N} ] $$
I would like to check whether $x$ and $y$ are statistically independent, with a certain level of probability.
I have been looking into the Chi-Square Test For Independence. However, since it can be applied to categorical data, I do not know how I can apply it to my signal samples.
As was suggested on this related question, once we compute the histogram for each signal, we do have categories on which a chi-squared test can be applied. But how do we use the histograms to generate the required contingency table?
For what it's worth, I am currently computing the histograms using this code:
n1 = hist(x);
n2 = hist(y);
n3 = hist3([x' y']);
Thank you for your help and suggestions.
EDIT
As an example, two signal samples would be the following:
xx = 0.2:0.2:34;
x = sin(xx);
y = randn(size(xx));