# [PD] [OT] spectral irregularity to measure noisiness (was Re: about fiddle~)

matteo sisti sette matteosistisette at gmail.com
Fri Jan 18 15:47:15 CET 2008

Thank you very much :)

By the way, I have just tried Spectral Flatness (as defined in
Wikipedia) and it seems promising.

I attach an abstraction that outputs spectral flatness in PD-vanilla.

2008/1/18, Jamie Bullock <jamie at postlude.co.uk>:
>
> Hi,
>
> On Fri, 2008-01-18 at 14:04 +0100, matteo sisti sette wrote:
> > Jamie Bullock wrote:
> >
> > > I find spectral irregularity to be quite a good noisiness metric,
> > > [...]
> > > Krimphoff:
> > > Irregularity = \sum_{k=2}^{N-1} |a_k - \frac{a_{k-1} + a_k + a_{k+1}}{3}|
> > > Jensen:
> > > Irregularity = \frac{\sum_{k=1}^{N} (a_k - a_{k+1})} {\sum_{k=1}^Na_k^2}
> > > [...]
> > > Where a_k is the amplitude of the kth coefficient in the magnitude spectrum.
> >
> > I googled a little bit, and as far as I understand, these definitions
> > seem to apply to an harmonic sound, and a_k seems to be the amplitude
> > of the k-th partial... that is the sound is supposed to be pitch and
> > its spectral peaks (partials) have already been extracted...
>
> The irregularity metric is generally computed on the magnitude spectrum,
> but there is no reason not use it on the harmonic spectrum, as some
> authors do. It is just giving you a measure of the 'jaggedness' of a
> given sequence of numbers, you could use it on any distribution, e.g.
> you could take the irregularity measure of the numbers of Pd mailing
> list postings over a 12 month period!
>
> For the purposes of computing noise content it makes sense to use the
> mag spectrum. Some authors e.g. Park (2004) use the log magnitude
> spectrum.
>
> > Would it make any sense to apply the above formulas using just the
> > magnitude spectrum coefficients of the whole spectrum as a_k??
> > If so, I'm not sure whether a high irregularity should be expected to
> > correspond to a high or low noisiness.....
>
> It depends which formula you use. Using Krimphoff ('Irregularity I' in
> libxtract), a high irregularity value corresponds to high noise content.
> The relationship is approximately inverted if you use Jensen.
>
> I performed an analysis in Sonic Visualiser using a sound that contains
> a linear crossfade between a 440Hz sine wave and white noise. The
> results can be found at:
>
> http://www.postlude.co.uk/incoming/sine-noise/sine-noise.png
>
> The red line shows Irregularity calculated via Krimphoff's method, the
> blue line shows Jensen.
>
> The audio file I used is at:
>
> http://www.postlude.co.uk/incoming/sine-noise/sine-noise.wav
>
>
> Jamie
>
> --
> www.postlude.co.uk
>
>

--
Matteo Sisti Sette
matteosistisette at gmail.com
http://www.matteosistisette.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: spectralflatness.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080118/6f4eaf87/attachment.asc>