From fd72e78e4c5d2df609c6a4b58662b25a9cfd21ca Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Thu, 30 May 2019 18:20:53 +0100 Subject: [PATCH] confirmed that (buf)spectralshape is now in Hz --- .../Classes/FluidBufSpectralShape.schelp | 12 ++++++------ .../Classes/FluidSpectralShape.schelp | 18 ++++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp b/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp index 78250cc..fc65a97 100644 --- a/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp @@ -11,12 +11,12 @@ The descriptors are: LIST:: ##the four first statistical moments (https://en.wikipedia.org/wiki/Moment_(mathematics) ), more commonly known as: LIST:: - ## the spectral centroid (1) in spectral bins as units. This is the point that splits the spectrum in 2 halves of equal energy. It is the weighted average of the magnitude spectrum. - ## the spectral spread (2) in spectral bins. This is the standard deviation of the spectrum envelop, or the average of the distance to the centroid. - ## the normalised skewness (3) as ratio. This indicates how tilted is the spectral curve in relation to the middle of the spectral frame, i.e. half of the Nyquist frequency. If it is below the bin representing that frequency, i.e. the central bin of the magnitude spectrum, it is positive. + ## the spectral centroid (1) in Hz. This is the point that splits the spectrum in 2 halves of equal energy. It is the weighted average of the magnitude spectrum. + ## the spectral spread (2) in Hz. This is the standard deviation of the spectrum envelop, or the average of the distance to the centroid. + ## the normalised skewness (3) as ratio. This indicates how tilted is the spectral curve in relation to the middle of the spectral frame, i.e. half of the Nyquist frequency. If it is below that frequency, i.e. the central bin of the magnitude spectrum, it is positive. ## the normalised kurtosis (4) as ratio. This indicates how focused is the spectral curve. If it is peaky, it is high. :: - ## the rolloff (5) in bin number. This indicates the bin under which 95% of the energy is included. + ## the rolloff (5) in Hz. This indicates the frequency under which 95% of the energy is included. ## the flatness (6) in dB. This is the ratio of geometric mean of the magnitude, over the arithmetic mean of the magnitudes. It yields a very approximate measure on how noisy a signal is. ## the crest (7) in dB. This is the ratio of the loudest magnitude over the RMS of the whole frame. A high number is an indication of a loud peak poking out from the overal spectral curve. @@ -86,7 +86,7 @@ Routine{ // listen to the source and look at the buffer b.play; -c.plot(minval:-5, maxval:250) +c.plot(separately:true) :: STRONG::A stereo buffer example.:: @@ -115,5 +115,5 @@ Routine{ ) // look at the buffer: 7shapes for left, then 7 shapes for right -c.plot(minval:-25, maxval:150) +c.plot(separately:true) :: \ No newline at end of file diff --git a/release-packaging/HelpSource/Classes/FluidSpectralShape.schelp b/release-packaging/HelpSource/Classes/FluidSpectralShape.schelp index 5dc28c4..8436237 100644 --- a/release-packaging/HelpSource/Classes/FluidSpectralShape.schelp +++ b/release-packaging/HelpSource/Classes/FluidSpectralShape.schelp @@ -10,12 +10,12 @@ The descriptors are: LIST:: ##the four first statistical moments (https://en.wikipedia.org/wiki/Moment_(mathematics) ), more commonly known as: LIST:: - ## the spectral centroid (1) in spectral bins as units. This is the point that splits the spectrum in 2 halves of equal energy. It is the weighted average of the magnitude spectrum. - ## the spectral spread (2) in spectral bins. This is the standard deviation of the spectrum envelop, or the average of the distance to the centroid. - ## the normalised skewness (3) as ratio. This indicates how tilted is the spectral curve in relation to the middle of the spectral frame, i.e. half of the Nyquist frequency. If it is below the bin representing that frequency, i.e. the central bin of the magnitude spectrum, it is positive. + ## the spectral centroid (1) in Hz. This is the point that splits the spectrum in 2 halves of equal energy. It is the weighted average of the magnitude spectrum. + ## the spectral spread (2) in Hz. This is the standard deviation of the spectrum envelop, or the average of the distance to the centroid. + ## the normalised skewness (3) as ratio. This indicates how tilted is the spectral curve in relation to the middle of the spectral frame, i.e. half of the Nyquist frequency. If it is below that frequency, i.e. the central bin of the magnitude spectrum, it is positive. ## the normalised kurtosis (4) as ratio. This indicates how focused is the spectral curve. If it is peaky, it is high. :: - ## the rolloff (5) in bin number. This indicates the bin under which 95% of the energy is included. + ## the rolloff (5) in Hz. This indicates the frequency under which 95% of the energy is included. ## the flatness (6) in dB. This is the ratio of geometric mean of the magnitude, over the arithmetic mean of the magnitudes. It yields a very approximate measure on how noisy a signal is. ## the crest (7) in dB. This is the ratio of the loudest magnitude over the RMS of the whole frame. A high number is an indication of a loud peak poking out from the overal spectral curve. @@ -129,7 +129,7 @@ a = Array.fill(7, {arg i; }); ) -// this time, update a little more slowly, and convert in Hz the 3 descriptors published in bins by the algorythm. +// this time, update a little more slowly. ( r = Routine { { @@ -138,13 +138,7 @@ r = Routine { { if(w.isClosed.not) { val.do({arg item,index; - if ((index < 2) || (index == 4)) - { - a[index].string = (item * s.sampleRate / 1024).round(0.01); - } { - a[index].string = item.round(0.01); - }; - }) + a[index].string = item.round(0.01)}) } }.defer });