Granger causality in the frequency domain: derivation and applications