sfm | R Documentation |

This function estimates the flatness of a frequency spectrum.

`sfm(spec)`

`spec` |
a data set resulting of a spectral analysis obtained
with |

SFM is calculated as the ratio between the geometric mean and the
arithmetic mean :

`F = N\times{\frac{\sqrt[N]{\prod_{i=1}^N{y_i}}}{\sum_{i=1}^N{y_i}}}`

with:

*y* = relative amplitude of the *i* frequency,

and *N* = number of frequencies.

A single value varying between 0 and 1 is returned. The value has no unit.

The SFM of a noisy signal will tend towards 1 whereas
the SFM of a pure tone signal will tend towards 0.

See `sh`

for another measure of signal noisiness/pureness.

Jerome Sueur sueur@mnhn.fr

`sh`

, `csh`

```
a<-synth(f=8000,d=1,cf=2000,plot=FALSE)
speca<-spec(a,f=8000,at=0.5,plot=FALSE)
sfm(speca)
# [1] 0
b<-noisew(d=1,f=8000)
specb<-spec(b,f=8000,at=0.5,plot=FALSE)
sfm(specb)
# [1] 0.8233202
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.