1 function [BISPEC,BIACF,ACF] = bispec(Z,N);
2 % Calculates Bispectrum
3 % [BISPEC] = bispec(Z,N);
7 % Output: BiACF bi-autocorrelation function = 3rd order cumulant
11 % C.L. Nikias and A.P. Petropulu "Higher-Order Spectra Analysis" Prentice Hall, 1993.
12 % M.B. Priestley, "Non-linear and Non-stationary Time series Analysis", Academic Press, London, 1988.
14 % $Id: bispec.m 5090 2008-06-05 08:12:04Z schloegl $
15 % Copyright (C) 1997-2003,2008 by Alois Schloegl <a.schloegl@ieee.org>
17 % This program is free software: you can redistribute it and/or modify
18 % it under the terms of the GNU General Public License as published by
19 % the Free Software Foundation, either version 3 of the License, or
20 % (at your option) any later version.
22 % This program is distributed in the hope that it will be useful,
23 % but WITHOUT ANY WARRANTY; without even the implied warranty of
24 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 % GNU General Public License for more details.
27 % You should have received a copy of the GNU General Public License
28 % along with this program. If not, see <http://www.gnu.org/licenses/>.
33 BIACF=zeros(2*N+1,2*N+1);
41 jc2=Z(1:M-K).*Z(1+K:M);
44 jc3 = sum(jc2(1:M-L).*Z(1+L:M))/M;
47 BIACF(L-K+P, -K+P)=jc3;
48 BIACF(-K+P, L-K+P)=jc3;
49 BIACF(K-L+P, -L+P)=jc3;
50 BIACF(-L+P, K-L+P)=jc3;
54 BISPEC=fft2(BIACF,128,128);