[mirtoolbox] smoothing of spectrum

  • From: Hendrik Schreiber <hs@xxxxxxxxxxxx>
  • To: mirtoolbox@xxxxxxxxxxxxx
  • Date: Wed, 16 Feb 2011 13:26:24 +0100

Hi,

I just stumbled over line 891 in mirspectrum.

There we attempt to smooth the spectrum using a moving average filter like this:

            m{k}{i} = filter(ones(1,option.aver),1,m{k}{i});

In essence this is a simple rectangle/box filter. The way it's currently 
implemented it works, but changes the area under the curve, as the area under 
the filter is exactly option.aver and not 1, as it probably should be.

I propose changing that line to 

            m{k}{i} = filter(ones(1,option.aver)/option.aver,1,m{k}{i});

in order to get a smoother spectrum without changing the overall energy.

Cheers,

-hendrik

tagtraum industries incorporated
724 Nash Drive
Raleigh, NC 27608
USA
http://www.tagtraum.com/
http://www.beatunes.com/


Other related posts: