No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

3.7 | 85 ratings Rate this file 128 Downloads (last 30 days) File Size: 2.92 MB File ID: #3013 Version: 1.0

HOSA - Higher Order Spectral Analysis Toolbox


Ananthram Swami (view profile)

  • 1 file
  • 3.71429


12 Feb 2003 (Updated )

Spectral and polyspectral analysis, and time-frequency distributions.

| Watch this File

File Information

There is much more information in a stochastic non-Gaussian or deterministic signal than is conveyed by its autocorrelation and power
spectrum. Higher-order spectra which are defined in terms of the higher-order moments or cumulants of a signal, contain this additional information. The Higher-Order Spectral Analysis (HOSA) Toolbox provides comprehensive higher-order spectral analysis capabilities for signal processing applications. The toolbox is an excellent resource for the advanced researcher and the practicing engineer, as well as the novice
student who wants to learn about concepts and algorithms in statistical signal processing.

The HOSA Toolbox is a collection of M-files that implement a variety of advanced signal processing algorithms for the estimation of cross- and auto-cumulants (including correlations), spectra and olyspectra,bispectrum, and bicoherence, and omputation of time-frequency
distributions. Based on these, algorithms for parametric and non-parametric blind system identification, time-delay estimation, harmonic retrieval, phase-coupling, direction of arrival estimation, parameter estimation of Volterra (non-linear) models, and adaptive linear prediction are implemented. Also included are algorithms for testing of Gaussianity and Linearity of a time series. A full tutorial and demo set are included in the toolbox.


This file inspired Fast Third Order Cross Cumulant Calculation.

Required Products Signal Processing Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (135)
20 Feb 2017 li wang

13 Feb 2017 ABB

ABB (view profile)

save/ rename file 'HOSAVER.M' as hosaver.m and do for all of the files. Furthermore, make minor corrections to avoid warnings and increase the speed.

Comment only
26 Jan 2017 obaldia

Could you generate a .tar for people who do not use windows?

19 Jan 2017 Seonghun Park

Thank you all, finally it works.

16 Jan 2017 Josh

Josh (view profile)

Common installation issues with HOSA Toolbox

Issue 1: All .m files are uppercase
Solution: Rename .m files to lowercase. See Stefano Tronci's post (25 Jul 2015) if using Linux.

Issue 2: HOSA Demo does not work
Solution: See Part d) of Stefano Tronci's post (25 Jul 2015) and Alexander Kalweit post (14 Mar 2016)

Issue 3: Every time MATLAB is launched, the following error appears:

"Warning: [...]\hosa\hosa\info.xml did not validate.
The schema [Ljava.lang.Object;@1f474720 shows the following errors:"

Solution: Open info.xml; On Line 5, change <area> to <type>, and </area> to </type>.

Comment only
06 Jan 2017 transform yi

after setup,I tried the command below,and an error occured.
>> hosaver
Cannot find an exact (case-sensitive) match for 'HOSAVER.m'

The closest match is E:\Program

To change the file extension, cd to the file's folder, type:
movefile HOSAVER.M HOSAVER.m_bad; movefile HOSAVER.m_bad
HOSAVER.m and then cd back.

and everytime I reluanch matlab2014a ,it rise up:
Warning: File e:\program
files\matlab\r2014a\toolbox\hosa\hosa\info.xml did not validate.
The schema [Ljava.lang.Object;@1f474720 shows the following errors:

org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 7;
cvc-complex-type.2.4.a: Invalid content was found starting with
element 'area'. One of '{MathWorksID, type}' is expected.

Often, errors result from incorrect ordering of XML tags. Correct
the error by updating the info.xml file contents to follow the
guidelines in the MATLAB help documentation.

Is anyone can help me ?thanks very much!!!

Comment only
06 Jan 2017 transform yi

Is anyone can help me ?thanks!!!

30 Dec 2016 tanglj22

the readme tells me to 'Download the SETUP.EXE file to your machine.' Where should I find thie SETUP.EXE file ?

Comment only
29 Dec 2016 Devyani

how to calculate zero squared bicoherence using the file bicoher.m?

Comment only
26 Dec 2016 Tien Kai Ming


21 Dec 2016 Genevieve

For those saying they ca'nt run it because filenames are uppercase: it is very easy to run a simple shell command like find to change filenames to lowercase.
find my_root_dir -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;

15 Oct 2016 Omid Khademhosseini

20 Jun 2016 Xiaohui Tao

Warning: File d:\program files\matlab\r2012a\toolbox\hosa\hosa\info.xml did not validate. The schema [Ljava.lang.Object;@4e69048b
shows the following errors:

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'area'. One of '{MathWorksID,
type}' is expected.

Often, errors result from incorrect ordering of XML tags. Correct the error by updating the info.xml file contents to follow the
guidelines in the MATLAB help documentation.

Comment only
12 May 2016 michael refaat

can this toolbox work on Matlab 2014a
I have this error message
Warning: File c:\users\michael\documents\matlab\hosa\info.xml did not validate. The schema [Ljava.lang.Object;@9d3e0b1
shows the following errors:

org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 7; cvc-complex-type.2.4.a: Invalid content was found starting
with element 'area'. One of '{MathWorksID, type}' is expected.

Comment only
03 May 2016 Feng Li

14 Mar 2016 Alexander Kalweit

Hi ..thx for this great toolbox...I also had some problems getting "hosademo" to run (but solved it):
for the choice.m-file problem:
get wafo from here:

copy the "choices.m" from
"yourFolder\wafo-.1.1\misc" to the hosademo-folder

if you start hosademo now you might get an error-message
to get rid of it change:

CHOICEHANDLES(matchn) = figure('Position',rect,'number','off', ...


CHOICEHANDLES(matchn) = figure('Position',rect,'NumberTitle','off', ...

so "NumberTitle" instead of "number"
it´s in line 162 of choice.m

Comment only
25 Jul 2015 Stefano Tronci

Hi. I think I got this running (I need some further test) on Matlab R2014a. Just unpack, rename all the files to lowercase and download choices.m. If you have Linux it is quite straightforward:

a) Unpack the hosa_d.exe file (I used virtualbox for that but probably also wine can do it. I bet that also tar or other utilities can do it somewhat...).

b) Follow the instructions in the README.TXT file to add the unpacked folder to the paths. The only difference is that the "Set Path" button is under the HOME tab in the current Matlab versions.

c) Open a command prompt on your Linux (probably works also with Mac) box and cd to the unpacked folder. Enter the hosa subfolder and issue this to convert all the filenames from Upper case to Lower case:

for f in * ; do mv -v $f `echo $f | tr '[A-Z]' '[a-z]'`; done

Do the same in the hosademo folder.

d) Go to, copy and paste the source code of choices.m in a empty file. Save this file in hosademo as choices.m. You need to get rid of the line numbers:

sed 's/^.\{4\}//g' choices.m >> temp

This will save a file called temp. Open it, remove the last survived number at the bottom (206) and save it as choice.m, overwriting the old one.

This should do the trick, hope it helps.

Comment only
16 Jun 2015 luo yisheng

28 May 2015 Siddharth

I want help to download and use this toolbox...
Someone please help..
Thank you..!

Comment only
22 Sep 2014 yue

yue (view profile)


14 Jul 2014 Khujasta

unable to install HOSA on MATLAB2012b..
can anybody help..i have followed all the steps in the read me text..but to no avail

Comment only
19 Jun 2014 Tiffany

Anybody else having issues getting the 'Hosa Demo' to work? It tells me
'Undefined function 'choices' for input arguments of type 'char'. Granted, I can go into the folder and open any demo I need, but I'm not really sure what they all are.

Second question (and maybe I just need to read on this), but how does the window work? From the demo, it seemed he chose an arbitrary size? I'm looking to calculate the bi-spectrum. I'm used to making my own hanning window when I do a regular FFT; this appears to be different.

Comment only
28 Aug 2013 yangyang

21 Jul 2013 zhongguo

very good

08 Dec 2012 Damon Bradley

Also, to remove the annoyance of inexact case matches when you use the any of the HOSA functions, I'd recommend putting this line of code at the top of your script:


For some strange reason, all of the HOSA function file names are written in all caps.

13 Nov 2012 Lyuboslav Petrov

Convert from upper to lower all files in both folder using this script:

files = dir;
for i = 3:length(files)
system(['REN ',lower(files(i).name),' ',lower(files(i).name)]);

Comment only
13 Nov 2012 Lyuboslav Petrov

25 Sep 2012 Wolfgang


i have tried as described in the readme.txt. Unfortunately all file names and extentions are in uppercase after extracting !

Because of that no chance to use anything (like hosaver or hosademo).

Please advice what to do.

Comment only
03 Jul 2012 Russell

I have the HOSA pack working, but I run out of memory with the WIG2C function when using a array of 2500 rows and 1 column. Can the function not handle a array like this?

Comment only
07 Mar 2012 MIAO DU

Hi,all, I tried to use the function bispecd.m on my data, but it always shows
??? Subscript indices must either be real positive integers or logicals.

Error in ==> BISPECD at 123
xseg = y(locseg);

How can I fix this problem?

Comment only
18 Jan 2012 Keith Thornicroft

Hi All,

I can't seem to get the toolbox installed having followed the text file to the T. I am using MATLAB Student Version (R2011a) with an additional wavelet toolbox. Any ideas? Does it even work for a student licence?


Comment only
19 Sep 2011 Jered Wells

For those who get an error due to the info.xml file: to fix the error in hosa\info.xlm, the line containing <area>matlab</area> should be changed to <type>matlab</type>. Now, to try HOSA...

Comment only
27 Apr 2011 XIAYANG xiayang

It is good and helpful.

Comment only

The installation seems to have worked incompletely. I get the following error:
??? Undefined function or method 'choices' for input arguments of type 'char'.
Error in ==> HOSADEMO at 68
choices('HoSatDemo', 'HOSA Demo', labels, callbacks, interruptible);
My Matlab cannot find the command/function "choices".
I have MATLAB Version (R2009a)
Signal Processing Toolbox Version 6.11 (R2009a)
Can you please help me solve this?
please tell me how to use these toolboxes.please reply on my email

Comment only
21 Apr 2011 Evan

Evan (view profile)

For those in need of choices.m

has the source code.

Create a new .m, paste in code, delete all code line numbers :)

06 Mar 2011 henry gorx

sorry, I was wrong. The comment was for other function (MATS).

Comment only
05 Mar 2011 henry gorx

Hi, I tested the function Bicorrelation(xV,tauV,flag), how I must to interpret the results? for example, bicV=-0.18738 and cumbicV=0.70683. Many thanks for your help.

Comment only
27 Jan 2011 leo

leo (view profile)

it is grateful

Comment only
13 Jan 2011 wu

wu (view profile)

File "choices.m" is lost. Is the problem of version of matlab, and mine is 7.1?

12 Jan 2011 wu

wu (view profile)

great tool of researchers whose major is signal processing

07 Jan 2011 andrea ruju

Why the window specification for frequency-domain smoothing is differetn in bispectrum and bicoherence estimation?

Hi, i'm a phd student in coastal oceanography. My e-mail is

Comment only
04 Dec 2010 asandu asandu

Help: why the bispectrum of the gaussian noise does not equal zero in HOSA
Hi :
I am a student from Wuhan, China. I have download the toolbox of HOSA. Thank you very much of your job. BUt I have met a problem in compute the bispectrum of the gaussian noise, because the result of it does not equal to zero. I can not find the solution of it. can you help me? and thanks.
The signal of gaussian noise is given by the commad 'rand'.
my e_mail:

Comment only
08 Nov 2010 Sayan

Sayan (view profile)

having errors please help
>> hosademo
??? Undefined function or method 'choices' for input arguments of type 'char'.

Error in ==> HOSADEMO at 68
choices('HoSatDemo', 'HOSA Demo', labels, callbacks, interruptible);

Comment only
02 Nov 2010 wang ?

wang ? (view profile)

thank you

12 Oct 2010 Rafael J.

Great toolbox, but there are clearly some typos and errors. Capitalized filenames causes warnings (or the fact that they don't match the functions calls with respective to caps).

Also, why does bicoherx and bispecdx have three inputs when most people only have two inputs for a cross-bicoherence or cross-bispectrum analysis? Anyone figure this issue out? Which two inputs should we use? (eg x-x-y, x-y-x, etc)

19 May 2010 Salai Selvam V

Salai Selvam V (view profile)


18 May 2010 Ali Ali

Thanks alot. fantastic tool

06 Nov 2009 zamrud fathima

The installation seems to have worked incompletely. I get the following error:
??? Undefined function or method 'choices' for input arguments of type 'char'.
Error in ==> HOSADEMO
choices('HoSatDemo', 'HOSA Demo', labels, callbacks, interruptible);
My Matlab cannot find the command/function "choices".
Can you please help me solve this?
please send reply to my e-mail

Comment only
03 Nov 2009 Rae

Rae (view profile)

Is there a simple way to edit bicoher to normalize it such that it's giving the bounded (0-1) version rather than the current skewness version?

I can't access the Kim and Powers paper and if others have sucessfully done this, I'd love to know how!

Comment only
11 Aug 2009 Paul

Paul (view profile)

The installation seems to have worked incompletely. I get the following error:
??? Undefined function or method 'choices' for input arguments of type 'char'.
Error in ==> HOSADEMO at 68
choices('HoSatDemo', 'HOSA Demo', labels, callbacks, interruptible);
My Matlab cannot find the command/function "choices".
I have MATLAB Version (R2009a)
Signal Processing Toolbox Version 6.11 (R2009a)
Can you please help me solve this?
Paul Axon, Sydney, Australia

Comment only
11 Jun 2009 David Gagnon

I meant to submit this post first...
(Both posts refer to BICOHER.m)

Beware that there are multiple ways to normalize the bispectrum, and they are all referred to as the "bicoherence." The formula that this m-file uses is NOT the one that bounds the bicoherence between 0 and 1. If you are looking for that one, check out Kim and Powers' 1979 paper "Digital Bispectral Analysis and Its Applications to Nonlinear Wave Interactions." They provide an explanation of how to code that version, and it has worked reasonably well for me.

Comment only
11 Jun 2009 David Gagnon

By the way, "segsamp" (actually implemented as "nsamp") is the number of samples per segment, that is, the number of points in each chunk of data that you're throwing into the bicoherence. You can use datasets of any length, and the program will typically calculate fft's with a length that is a power of two and is greater than or equal to "segsamp." It does this by adding zeros to the data record. However, you can specify "nfft" to tell the program how many points you want the fft to use. If you set "segsamp" and "nfft" to be equal, then you can avoid zero-padding. Powers of two are calculated faster, but MATLAB can handle fft's of any length.

As for the frequency axis, "waxis" is based on the number of points that are used in the fft. As a result, "0.5" on the axis corresponds to the highest frequency that can be resolved with that number of points, also known as the Nyquist frequency. Exactly how you want to scale the axis will depend on the nature of your data.

On an unrelated note, the demo gives me errors, too.

Comment only
04 Jun 2009 Rakesh

Rakesh (view profile)

I have tried WIG2.m function on a times series on 28800 samples (288 sec signal sampled at 100Hz) but function doesnt seem to handle this big signal. However, I have also tried it on chunks of this signal but it takes forever to complete. Is it my computer or the program itself? any help?

Comment only
08 Apr 2009 Gabriel Akira Schreiber

But, however, lowercase filenames would be a great improvement.

Comment only
08 Apr 2009 Gabriel Akira Schreiber

This toolbox is greatly appreciated. Is this still developed/maintained?

27 Oct 2008 Edwin Wu

Does anybody have the experience to use TDE.M? I encounter some problem when I use it as a way to estimate the time delay of 2 channels of signal. I would be so appreciated for your helps.My msn is,it is also my E-mail.I would like to make friends with anyone of you.join me , share our knowledge and be brilliant together.

21 Oct 2008 Bessie Bao


19 Oct 2008 elahe alavi

27 Aug 2008 Yue ZHOU

To identify whether one time serial is norm-distribution

Comment only
04 Aug 2008 Femi Osunnuyi

I've had some problems using the 'bicoher' function. With most industrial data sets, i obtain bicoherence values greater than 1, which in theory is not meant to be possible.
Any ideas?
Also is 'segasamp' meant to be square root of no. of data set (which must be even powers of 2 [4,16,64,256,1024], right?)?

28 Jul 2008 Alex Yakubovich

Does anybody what the frequency units are in BICOHER and BISPECD? Some of the examples in the tutorial suggest it is in Hz, but that doesn't make sense given the plot I get with my signal.

Comment only
17 Jun 2008 Guy Incognito

26 May 2008 jason yun

19 May 2008 Kacimi Abderrahmane

01 May 2008 Vinayak swarnkar

I downloaded it..but facing problem in running it. Even 'hosademo.m' dosent gives error saying 'Undefined function or method 'choices' for input arguments of type 'char'.'. Can some please help in this.
Thanks you

26 Jan 2008 as as

04 Dec 2007 bahman abc


07 Nov 2007 Alhade Mohamed


Comment only
11 Oct 2007 guang yang

it's good

Comment only
30 Sep 2007 Morteza Dardel

I want some more description about “nlpow” command (estimation with volterra serises). If this command can be used for more than one input and output cases?

11 Sep 2007 navya showry

I have downloaded this file, but .exe file is missing from the extracted one.. plz advice how to proceed further or email me the latest updated one.

Comment only
07 Sep 2007 Ali Ozgur Argunsah

?s there any linux matlab version of this toolbox?

Comment only
23 Aug 2007 ahmed badawy

pls I hope to make good relation in working
in HOSA and Signal Separation Using HOSA

13 Jun 2007 yhaofly yhaofly

your work is execellent,thank you very much,
I will support you for ever.

01 Jun 2007 song jianjiang

good article

17 May 2007 Chang David

I want to know if the software is only compliant with Matlab 6.0(R12 version)

Comment only
27 Jan 2007 Florencio Calle

03 Jan 2007 Vishnuvenkatesh Dhage

04 Dec 2006 liu xiangle

the help system is not covinent.

Comment only
17 Sep 2006 Frederico Melo

04 Jun 2006 Scott Miller

How do you open this thing? I have tried to extract it and nothing happens. It seems corrupted.

to reply take out chinese food

Comment only
02 Jun 2006 M Nage

not see yet

27 May 2006 ali dashti

needed box

20 Apr 2006 Mohsen Afrasiabi

19 Apr 2006 Sivaganesh Mullapudi

23 Mar 2006 Jon Hobbs

Great Box

23 Dec 2005 meng yusong

22 Dec 2005 Ghassan Maalouli

Excellent toolbox. Very good documentation.
Brilliant author.

05 Dec 2005 Jon-Fredrik Hopperstad

Excellent toolbox with very good documentation.

01 Dec 2005 essam anwer

i can not run this toolbox how can download and who can help me

Comment only
27 Nov 2005 xu guisen

how to download? who teach me!

Comment only
15 Nov 2005 Neil L Scott

Demo fails.
Crashes with GUI callback issues.
Uppercase file names???

09 Oct 2005 Bruce Lena

great tools for me

03 Aug 2005 xunkai wei


07 May 2005 xjtuljp Lin

19 Apr 2005 chen xushuang

very good


It is really good and very helpful to me

11 Mar 2005 Marcin J...

I would be thankfull if you can send me more informations about high order moments. Thank for help.

08 Mar 2005 farzaneh shayegh

15 Jan 2005 hawk wei

Anyway but can you share it ?
It's really great

10 Jan 2005 Chuanshuang Hu

It looks great. I need HOSA. Also, could you tell me whether it is possible to compute Auto-and cross-spectra or not using HOSA?

Comment only
11 Dec 2004 Wei Zhang

why this toolbox is not concluded in Matlab 7 ?

Comment only
22 Nov 2004 Nej Nej

Kindly send me a HOSA tool box for study purpose

Comment only
09 Nov 2004 Kim Gunnium

I need HOSA for learning.

05 Nov 2004 Kianoush Nazarpour

03 Nov 2004 Jim Green

I need much higher order spectral analysis toolbox

14 Aug 2004 sina niki

Dear Sir,
We want simulate by matlab "Passive Radar localization by time difference of arrival esimator".
For this purpose we have two site on the ground and we want by two widwband receivers estimate two same received pulse at separate station.
could you help me to send m.files for this purpose.
thanks your helps.

09 Aug 2004 Feng Changjian

I have like this toolbox because it can help me to complete my school work.

04 Aug 2004 abdelali belabassi

i'm etudiant ,i need it to complet my thesis , thanks

27 Jun 2004 Jianwen Luo

18 Jun 2004 Marcus Kruger

15 Jun 2004 xnkj xnkj

hao dong dong

11 Jun 2004 zheng qing

30 May 2004 wang shenghui


Comment only
29 Apr 2004 Dr. Abdul-Bary Sulaiman

A very useful toolbox, but i\I surprised that it is only found in V5.3 Matlab and has been cancelled in the uper versions !!!

28 Feb 2004 Camilo Londoño

Nice work!!!!

22 Dec 2003 Brian Powell

Excellent toolbox. The only negative is that it is distributed as an EXE. If you distribute as a tar, it should work everywhere. After unpacking on a borrowed windows box, I use it on Solaris and MacOSX.

18 Dec 2003 Norbert Marwan

Why this toolbox is not provided as a zip-package or Matlab-installation file (eg. created with Makeinstall). Moreover, all filenames are upperletter. The exe-package as well as the upperletter filenames make it hard for a Unix user to use this toolbox.

11 Nov 2003 Jaime Aviles

10 Sep 2003 qiang xueming


26 Aug 2003 Dale Clifford

This IS a matlab toolbox and installs the same even as far as the icon in the view window of Matlab. Previously not available as a student edition, but now free.This toolbox provides much information on signals, especially if the researcher is looking for non-linear dynamics. Works well when used along the side of wavelets.

12 Aug 2003 w w

very good

Comment only
05 Aug 2003 Moh Al-jebori

06 Jul 2003 Mokrane Malek

16 Jun 2003 dylan mckay

01 Jun 2003 extra ll

13 May 2003 Ma Yongfeng

It is good and helpful.

10 Apr 2003 x yg

20 Mar 2003 guojun yang

19 Mar 2003 Usama Zaher

Excellent application

If there are more examples it would be nice.Especially if it is concerned with some application of sensor validation

05 Mar 2003 D. Gansawat

28 Feb 2003 Dr. Cornelis Los

This the best non-wavelet, higher-order time-frequency analysis of time series and the only one freely available. Use it closely together with the excellent book for the best results and for easy and accurate interpretation.

21 Feb 2003 George Barakos

Pity it is not part of the main MatLab release!

17 Feb 2003 - -

Is this the same as TMW's HOSA Toolbox?

Comment only
16 Feb 2003 John Brown

Contact us