Hi Raf, You can't specify the frequencies of interest as an input argument, but you can easily extract the mean-square coherence values for the frequencies you want. This of course implies that you have chosen your input parameters to ensure that the spacing between DFT bins is sufficient.
t = 0:0.001:1-0.001;
x = cos(2*pi*10*t)+0.25*sin(2*pi*40*t)+randn(size(t));
y = cos(2*pi*10*t-pi/4)+0.15*sin(2*pi*40*t-pi/2)+randn(size(t));
[Cxy,F] = mscohere(x,y,250,200,250,1000);
plot(F,Cxy)
In the above, I've chosen a segment length of 250, that gives me a frequency resolution of Fs/250 or 4 Hz. You can see this by looking at
diff(F)
If you really want a resolution of 1 Hz, then you have to choose your window length accordingly.
The overlap is trickier to give specific rules for. The larger the overlap, the more computation, but the more averaged the result (less bias)
