Perceptual spectral centroid

Perceptually-informed spectral centroid.
다운로드 수: 945
업데이트 날짜: 2018/5/5

NOTE: this function is now available from the IoSR Matlab Toolbox as iosr.auditory.perceptualCentroid.
-------------------------
PCMEAN = PERCEPTUALCENTROID(X,FS) calculates the spectral centroid of
signal X, sampled at FS, with respect to mel-frequency.
The algorithm first calculates the spectrogram of X; each segment has
the maximum of length(X)/8 or 2048 samples, calculated with 50% overlap
and windowed with a hamming window. The spectrogram function is the
built-in Matlab function SPECTROGRAM. The centroid is calculated with
respect to mels by converting the FFT bin frequencies to mels. PCMEAN
is the mean of the perceptual spectral centroids calculated for each
segment. The perceptual spectral centroid can also be calculated using
ERBs, cents, or hertz (see below).

X can be a vector, matrix, or multidimensional array;
PERCEPTUALCENTROID will operate along the first non-signleton
dimension, and return a value for each corresponding row/column/etc.

PCmean = perceptualCentroid(x,fs,'parameter',value) allows numerous
parameters to be specified. These parameters are:-
'cref' : {27.5} | scalar
Specifies the reference frequency when calulating the centroid
in terms of cents.
'dim' : {first non-singleton dimension} | integer
Specify the dimension over which to calculate the perceptual
spectral centroid.
'loudness' : {'none'} | 'A' | 'B' | 'C' | 'D' | 'ISO-226'
Specifies whether loudness weighting is applied to the spectrum
prior to the centroid calculation. The default is for no
weighting to be applied. 'A', 'B', 'C', and 'D' correspond to
frequency weighting curves defined in IEC 61672:2003; 'ISO-226'
applies loudness weighting derived from ISO 226:2003.
'nfft' : {max([length(x)/2, 2048])} | integer
Specifies SPECTROGRAM's FFT size.
'noverlap' : {nfft/2} | integer
Specifies the number of samples over which SPECTROGRAM's
segments overlap.
'output' : {'units'} | 'hz'
Specifies whether the output data are in Hz ('hz') or in units
determined by the 'scale' option ('units') (default).
'phon' : {65} | scalar
Specifies the loudness level if using ISO 226:2003-based
loudness weighting.
'scale' : {'mel'} | 'linear' | 'erb' | 'cents'
Specifies frequency scale use to calculate the centroid. 'mel'
uses the mel-frequency scale, 'linear' uses a linear frequency
scale (corresponding to the traditional spectral centroid
measure), 'erb' uses the equivalent-rectangular-bandwidth-rate
scale, and cents uses a scale based on musical cents with
respect to A-1 (27.5 Hz).
'window' : {hamming(nfft)} | vector
Specifies the window applied to each SPECTROGRAM segment.

[PCmean,PCstd,PCmax,PCmin,N] = ... returns additional information:-
PCmean : as described above.
PCstd : the standard deviation of the perceptual spectral
centroids.
PCmax : the maximum of the perceptual spectral centroids.
PCmin : the minimum of the perceptual spectral centroids.
N : the sample size for each statistic.

For more information about the FFT calculation and its options, consult
the SPECTROGRAM documentation.

Examples

Example 1: Calculate the mel-frequency spectral centroid of random
noise:

fs = 44100;
x = randn(fs,1);
PC = perceptualCentroid(x,fs);

Example 2: Calculate the ERB-spaced spectral centroid of random
noise with the output in Hertz:

PC = perceptualCentroid(x,fs,'scale','erb','output','hz');

Example 3: Calculate the musically-spaced spectral centroid of
random noise using a 4096-point Hann window:

PC = perceptualCentroid(x,fs,'scale','cents',...
'window',hann(4096));

Authors: Chris Hummersone & Kirsten Hermes, 2014

인용 양식

Christopher Hummersone (2024). Perceptual spectral centroid (https://github.com/IoSR-Surrey/MatlabToolbox), GitHub. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2014a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.6.0.0

Fixed bug whereby output dimensions would be incorrect for multidimensional array.
Migrated to GitHub.

1.5.0.0

Corrected title.

1.4.0.0

Uploaded correct file and updated description.

1.3.0.0

Added loudness weighting options.

1.2.0.0

Corrected title.

1.1.0.0

Made a number of changes: corrected error in method (no longer uses interpolation); removed fq output; added sample size N output; added 'cref' and 'output' options (default output is now it 'scale' units); simplified input parsing; updated help.

1.0.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.