import{S as ws,i as bs,s as ys,e as a,k as l,w as F,t as o,M as Es,c as n,d as t,m as d,a as s,x as z,h as r,b as p,G as e,g as f,y as C,L as Ts,q as D,o as I,B as O,v as xs}from"../../chunks/vendor-hf-doc-builder.js";import{D as X}from"../../chunks/Docstring-hf-doc-builder.js";import{I as vs}from"../../chunks/IconCopyLink-hf-doc-builder.js";function qs(hn){let H,Nt,L,V,Me,Y,wo,qe,bo,Pe,yo,Bt,b,Eo,Ne,To,xo,Be,qo,ko,Se,$o,Fo,St,ke,zo,At,M,W,Ae,Z,Co,Ue,Do,Ut,P,ee,Io,Ve,Oo,Vt,N,te,Ho,We,Lo,Wt,u,oe,Mo,re,Po,Ge,No,Bo,So,Ke,Ao,Uo,T,ae,Vo,Re,Wo,Go,Ko,ne,Ro,je,jo,Jo,Qo,se,Xo,Je,Yo,Zo,er,ie,tr,Qe,or,rr,ar,g,nr,Xe,sr,ir,Ye,lr,dr,Ze,cr,mr,et,fr,hr,tt,pr,ur,Gt,x,le,gr,de,_r,ot,vr,wr,br,rt,yr,Kt,v,ce,Er,me,Tr,at,xr,qr,kr,nt,$r,Fr,B,$e,st,zr,Cr,Dr,Fe,it,Ir,Or,Hr,ze,lt,Lr,Mr,Rt,m,fe,Pr,dt,Nr,Br,ct,Sr,Ar,_,he,Ur,mt,Vr,Wr,Gr,pe,Kr,ft,Rr,jr,Jr,ue,Qr,ht,Xr,Yr,Zr,ge,ea,pt,ta,oa,ra,_e,aa,ut,na,sa,ia,S,la,gt,da,ca,_t,ma,fa,ha,vt,pa,ua,q,G,ga,wt,_a,va,bt,yt,wa,ba,ve,ya,Et,Ea,Ta,xa,Tt,qa,ka,xt,$a,Fa,qt,za,Ca,A,kt,Da,Ia,$t,Oa,Ha,Ft,La,Ma,we,Pa,zt,Na,Ba,Sa,U,Aa,Ct,Ua,Va,Dt,Wa,Ga,jt,w,be,Ka,ye,Ra,It,ja,Ja,Qa,Ot,Xa,Ya,Ee,Za,Ht,en,tn,Jt,k,Te,on,xe,rn,Lt,an,nn,sn,Mt,ln,Qt;return Y=new vs({}),Z=new vs({}),ee=new X({props:{name:"transformers.audio_utils.hertz_to_mel",anchor:"transformers.audio_utils.hertz_to_mel",parameters:[{name:"freq",val:": typing.Union[float, numpy.ndarray]"},{name:"mel_scale",val:": str = 'htk'"}],parametersDescription:[{anchor:"transformers.audio_utils.hertz_to_mel.freq",description:`<strong>freq</strong> (<code>float</code> or <code>np.ndarray</code>) &#x2014;
The frequency, or multiple frequencies, in hertz (Hz).`,name:"freq"},{anchor:"transformers.audio_utils.hertz_to_mel.mel_scale",description:`<strong>mel_scale</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;htk&quot;</code>) &#x2014;
The mel frequency scale to use, <code>&quot;htk&quot;</code> or <code>&quot;slaney&quot;</code>.`,name:"mel_scale"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L25",returnDescription:`
<p>The frequencies on the mel scale.</p>
`,returnType:`
<p><code>float</code> or <code>np.ndarray</code></p>
`}}),te=new X({props:{name:"transformers.audio_utils.mel_to_hertz",anchor:"transformers.audio_utils.mel_to_hertz",parameters:[{name:"mels",val:": typing.Union[float, numpy.ndarray]"},{name:"mel_scale",val:": str = 'htk'"}],parametersDescription:[{anchor:"transformers.audio_utils.mel_to_hertz.mels",description:`<strong>mels</strong> (<code>float</code> or <code>np.ndarray</code>) &#x2014;
The frequency, or multiple frequencies, in mels.`,name:"mels"},{anchor:"transformers.audio_utils.mel_to_hertz.mel_scale",description:`<strong>mel_scale</strong> (<code>str</code>, <em>optional</em>, <code>&quot;htk&quot;</code>) &#x2014;
The mel frequency scale to use, <code>&quot;htk&quot;</code> or <code>&quot;slaney&quot;</code>.`,name:"mel_scale"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L59",returnDescription:`
<p>The frequencies in hertz.</p>
`,returnType:`
<p><code>float</code> or <code>np.ndarray</code></p>
`}}),oe=new X({props:{name:"transformers.audio_utils.mel_filter_bank",anchor:"transformers.audio_utils.mel_filter_bank",parameters:[{name:"num_frequency_bins",val:": int"},{name:"num_mel_filters",val:": int"},{name:"min_frequency",val:": float"},{name:"max_frequency",val:": float"},{name:"sampling_rate",val:": int"},{name:"norm",val:": typing.Optional[str] = None"},{name:"mel_scale",val:": str = 'htk'"}],parametersDescription:[{anchor:"transformers.audio_utils.mel_filter_bank.num_frequency_bins",description:`<strong>num_frequency_bins</strong> (<code>int</code>) &#x2014;
Number of frequencies used to compute the spectrogram (should be the same as in <code>stft</code>).`,name:"num_frequency_bins"},{anchor:"transformers.audio_utils.mel_filter_bank.num_mel_filters",description:`<strong>num_mel_filters</strong> (<code>int</code>) &#x2014;
Number of mel filters to generate.`,name:"num_mel_filters"},{anchor:"transformers.audio_utils.mel_filter_bank.min_frequency",description:`<strong>min_frequency</strong> (<code>float</code>) &#x2014;
Lowest frequency of interest in Hz.`,name:"min_frequency"},{anchor:"transformers.audio_utils.mel_filter_bank.max_frequency",description:`<strong>max_frequency</strong> (<code>float</code>) &#x2014;
Highest frequency of interest in Hz. This should not exceed <code>sampling_rate / 2</code>.`,name:"max_frequency"},{anchor:"transformers.audio_utils.mel_filter_bank.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>) &#x2014;
Sample rate of the audio waveform.`,name:"sampling_rate"},{anchor:"transformers.audio_utils.mel_filter_bank.norm",description:`<strong>norm</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If <code>&quot;slaney&quot;</code>, divide the triangular mel weights by the width of the mel band (area normalization).`,name:"norm"},{anchor:"transformers.audio_utils.mel_filter_bank.mel_scale",description:`<strong>mel_scale</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;htk&quot;</code>) &#x2014;
The mel frequency scale to use, <code>&quot;htk&quot;</code> or <code>&quot;slaney&quot;</code>.`,name:"mel_scale"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L115",returnDescription:`
<p>Triangular filter bank matrix. This is a
projection matrix to go from a spectrogram to a mel spectrogram.</p>
`,returnType:`
<p><code>np.ndarray</code> of shape (<code>num_frequency_bins</code>, <code>num_mel_filters</code>)</p>
`}}),le=new X({props:{name:"transformers.audio_utils.optimal_fft_length",anchor:"transformers.audio_utils.optimal_fft_length",parameters:[{name:"window_length",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L193"}}),ce=new X({props:{name:"transformers.audio_utils.window_function",anchor:"transformers.audio_utils.window_function",parameters:[{name:"window_length",val:": int"},{name:"name",val:": str = 'hann'"},{name:"periodic",val:": bool = True"},{name:"frame_length",val:": typing.Optional[int] = None"},{name:"center",val:": bool = True"}],parametersDescription:[{anchor:"transformers.audio_utils.window_function.window_length",description:`<strong>window_length</strong> (<code>int</code>) &#x2014;
The length of the window in samples.`,name:"window_length"},{anchor:"transformers.audio_utils.window_function.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;hann&quot;</code>) &#x2014;
The name of the window function.`,name:"name"},{anchor:"transformers.audio_utils.window_function.periodic",description:`<strong>periodic</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the window is periodic or symmetric.`,name:"periodic"},{anchor:"transformers.audio_utils.window_function.frame_length",description:`<strong>frame_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The length of the analysis frames in samples. Provide a value for <code>frame_length</code> if the window is smaller
than the frame length, so that it will be zero-padded.`,name:"frame_length"},{anchor:"transformers.audio_utils.window_function.center",description:`<strong>center</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center the window inside the FFT buffer. Only used when <code>frame_length</code> is provided.`,name:"center"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L206",returnDescription:`
<p><code>np.ndarray</code> of shape <code>(window_length,)</code> or <code>(frame_length,)</code> containing the window.</p>
`}}),fe=new X({props:{name:"transformers.audio_utils.spectrogram",anchor:"transformers.audio_utils.spectrogram",parameters:[{name:"waveform",val:": ndarray"},{name:"window",val:": ndarray"},{name:"frame_length",val:": int"},{name:"hop_length",val:": int"},{name:"fft_length",val:": typing.Optional[int] = None"},{name:"power",val:": typing.Optional[float] = 1.0"},{name:"center",val:": bool = True"},{name:"pad_mode",val:": str = 'reflect'"},{name:"onesided",val:": bool = True"},{name:"preemphasis",val:": typing.Optional[float] = None"},{name:"mel_filters",val:": typing.Optional[numpy.ndarray] = None"},{name:"mel_floor",val:": float = 1e-10"},{name:"log_mel",val:": typing.Optional[str] = None"},{name:"reference",val:": float = 1.0"},{name:"min_value",val:": float = 1e-10"},{name:"db_range",val:": typing.Optional[float] = None"},{name:"dtype",val:": dtype = <class 'numpy.float32'>"}],parametersDescription:[{anchor:"transformers.audio_utils.spectrogram.waveform",description:`<strong>waveform</strong> (<code>np.ndarray</code> of shape <code>(length,)</code>) &#x2014;
The input waveform. This must be a single real-valued, mono waveform.`,name:"waveform"},{anchor:"transformers.audio_utils.spectrogram.window",description:`<strong>window</strong> (<code>np.ndarray</code> of shape <code>(frame_length,)</code>) &#x2014;
The windowing function to apply, including zero-padding if necessary. The actual window length may be
shorter than <code>frame_length</code>, but we&#x2019;re assuming the array has already been zero-padded.`,name:"window"},{anchor:"transformers.audio_utils.spectrogram.frame_length",description:`<strong>frame_length</strong> (<code>int</code>) &#x2014;
The length of the analysis frames in samples. With librosa this is always equal to <code>fft_length</code> but we also
allow smaller sizes.`,name:"frame_length"},{anchor:"transformers.audio_utils.spectrogram.hop_length",description:`<strong>hop_length</strong> (<code>int</code>) &#x2014;
The stride between successive analysis frames in samples.`,name:"hop_length"},{anchor:"transformers.audio_utils.spectrogram.fft_length",description:`<strong>fft_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The size of the FFT buffer in samples. This determines how many frequency bins the spectrogram will have.
For optimal speed, this should be a power of two. If <code>None</code>, uses <code>frame_length</code>.`,name:"fft_length"},{anchor:"transformers.audio_utils.spectrogram.power",description:`<strong>power</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If 1.0, returns the amplitude spectrogram. If 2.0, returns the power spectrogram. If <code>None</code>, returns
complex numbers.`,name:"power"},{anchor:"transformers.audio_utils.spectrogram.center",description:`<strong>center</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to pad the waveform so that frame <code>t</code> is centered around time <code>t * hop_length</code>. If <code>False</code>, frame
<code>t</code> will start at time <code>t * hop_length</code>.`,name:"center"},{anchor:"transformers.audio_utils.spectrogram.pad_mode",description:`<strong>pad_mode</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;reflect&quot;</code>) &#x2014;
Padding mode used when <code>center</code> is <code>True</code>. Possible values are: <code>&quot;constant&quot;</code> (pad with zeros), <code>&quot;edge&quot;</code>
(pad with edge values), <code>&quot;reflect&quot;</code> (pads with mirrored values).`,name:"pad_mode"},{anchor:"transformers.audio_utils.spectrogram.onesided",description:`<strong>onesided</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If True, only computes the positive frequencies and returns a spectrogram containing <code>fft_length // 2 + 1</code>
frequency bins. If False, also computes the negative frequencies and returns <code>fft_length</code> frequency bins.`,name:"onesided"},{anchor:"transformers.audio_utils.spectrogram.preemphasis",description:`<strong>preemphasis</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Coefficient for a low-pass filter that applies pre-emphasis before the DFT.`,name:"preemphasis"},{anchor:"transformers.audio_utils.spectrogram.mel_filters",description:`<strong>mel_filters</strong> (<code>np.ndarray</code> of shape <code>(num_freq_bins, num_mel_filters)</code>, <em>optional</em>) &#x2014;
The mel filter bank. If supplied, applies a this filter bank to create a mel spectrogram.`,name:"mel_filters"},{anchor:"transformers.audio_utils.spectrogram.mel_floor",description:`<strong>mel_floor</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-10) &#x2014;
Minimum value of mel frequency banks.`,name:"mel_floor"},{anchor:"transformers.audio_utils.spectrogram.log_mel",description:`<strong>log_mel</strong> (<code>str</code>, <em>optional</em>) &#x2014;
How to convert the spectrogram to log scale. Possible options are: <code>None</code> (don&#x2019;t convert), <code>&quot;log&quot;</code> (take
the natural logarithm) <code>&quot;log10&quot;</code> (take the base-10 logarithm), <code>&quot;dB&quot;</code> (convert to decibels). Can only be
used when <code>power</code> is not <code>None</code>.`,name:"log_mel"},{anchor:"transformers.audio_utils.spectrogram.reference",description:`<strong>reference</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Sets the input spectrogram value that corresponds to 0 dB. For example, use <code>np.max(spectrogram)</code> to set
the loudest part to 0 dB. Must be greater than zero.`,name:"reference"},{anchor:"transformers.audio_utils.spectrogram.min_value",description:`<strong>min_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1e-10</code>) &#x2014;
The spectrogram will be clipped to this minimum value before conversion to decibels, to avoid taking
<code>log(0)</code>. For a power spectrogram, the default of <code>1e-10</code> corresponds to a minimum of -100 dB. For an
amplitude spectrogram, the value <code>1e-5</code> corresponds to -100 dB. Must be greater than zero.`,name:"min_value"},{anchor:"transformers.audio_utils.spectrogram.db_range",description:`<strong>db_range</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Sets the maximum dynamic range in decibels. For example, if <code>db_range = 80</code>, the difference between the
peak value and the smallest value will never be more than 80 dB. Must be greater than zero.`,name:"db_range"},{anchor:"transformers.audio_utils.spectrogram.dtype",description:`<strong>dtype</strong> (<code>np.dtype</code>, <em>optional</em>, defaults to <code>np.float32</code>) &#x2014;
Data type of the spectrogram tensor. If <code>power</code> is None, this argument is ignored and the dtype will be
<code>np.complex64</code>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L267",returnDescription:`
<p><code>nd.array</code> containing a spectrogram of shape <code>(num_frequency_bins, length)</code> for a regular spectrogram or shape
<code>(num_mel_filters, length)</code> for a mel spectrogram.</p>
`}}),be=new X({props:{name:"transformers.audio_utils.power_to_db",anchor:"transformers.audio_utils.power_to_db",parameters:[{name:"spectrogram",val:": ndarray"},{name:"reference",val:": float = 1.0"},{name:"min_value",val:": float = 1e-10"},{name:"db_range",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"transformers.audio_utils.power_to_db.spectrogram",description:`<strong>spectrogram</strong> (<code>np.ndarray</code>) &#x2014;
The input power (mel) spectrogram. Note that a power spectrogram has the amplitudes squared!`,name:"spectrogram"},{anchor:"transformers.audio_utils.power_to_db.reference",description:`<strong>reference</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Sets the input spectrogram value that corresponds to 0 dB. For example, use <code>np.max(spectrogram)</code> to set
the loudest part to 0 dB. Must be greater than zero.`,name:"reference"},{anchor:"transformers.audio_utils.power_to_db.min_value",description:`<strong>min_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1e-10</code>) &#x2014;
The spectrogram will be clipped to this minimum value before conversion to decibels, to avoid taking
<code>log(0)</code>. The default of <code>1e-10</code> corresponds to a minimum of -100 dB. Must be greater than zero.`,name:"min_value"},{anchor:"transformers.audio_utils.power_to_db.db_range",description:`<strong>db_range</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Sets the maximum dynamic range in decibels. For example, if <code>db_range = 80</code>, the difference between the
peak value and the smallest value will never be more than 80 dB. Must be greater than zero.`,name:"db_range"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L455",returnDescription:`
<p>the spectrogram in decibels</p>
`,returnType:`
<p><code>np.ndarray</code></p>
`}}),Te=new X({props:{name:"transformers.audio_utils.amplitude_to_db",anchor:"transformers.audio_utils.amplitude_to_db",parameters:[{name:"spectrogram",val:": ndarray"},{name:"reference",val:": float = 1.0"},{name:"min_value",val:": float = 1e-05"},{name:"db_range",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"transformers.audio_utils.amplitude_to_db.spectrogram",description:`<strong>spectrogram</strong> (<code>np.ndarray</code>) &#x2014;
The input amplitude (mel) spectrogram.`,name:"spectrogram"},{anchor:"transformers.audio_utils.amplitude_to_db.reference",description:`<strong>reference</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Sets the input spectrogram value that corresponds to 0 dB. For example, use <code>np.max(spectrogram)</code> to set
the loudest part to 0 dB. Must be greater than zero.`,name:"reference"},{anchor:"transformers.audio_utils.amplitude_to_db.min_value",description:`<strong>min_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1e-5</code>) &#x2014;
The spectrogram will be clipped to this minimum value before conversion to decibels, to avoid taking
<code>log(0)</code>. The default of <code>1e-5</code> corresponds to a minimum of -100 dB. Must be greater than zero.`,name:"min_value"},{anchor:"transformers.audio_utils.amplitude_to_db.db_range",description:`<strong>db_range</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Sets the maximum dynamic range in decibels. For example, if <code>db_range = 80</code>, the difference between the
peak value and the smallest value will never be more than 80 dB. Must be greater than zero.`,name:"db_range"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/audio_utils.py#L506",returnDescription:`
<p>the spectrogram in decibels</p>
`,returnType:`
<p><code>np.ndarray</code></p>
`}}),{c(){H=a("meta"),Nt=l(),L=a("h1"),V=a("a"),Me=a("span"),F(Y.$$.fragment),wo=l(),qe=a("span"),bo=o("Utilities for "),Pe=a("code"),yo=o("FeatureExtractors"),Bt=l(),b=a("p"),Eo=o("This page lists all the utility functions that can be used by the audio "),Ne=a("code"),To=o("FeatureExtractor"),xo=o(" in order to compute special features from a raw audio using common algorithms such as "),Be=a("em"),qo=o("Short Time Fourier Transform"),ko=o(" or "),Se=a("em"),$o=o("log mel spectrogram"),Fo=o("."),St=l(),ke=a("p"),zo=o("Most of those are only useful if you are studying the code of the audio processors in the library."),At=l(),M=a("h2"),W=a("a"),Ae=a("span"),F(Z.$$.fragment),Co=l(),Ue=a("span"),Do=o("Audio Transformations"),Ut=l(),P=a("div"),F(ee.$$.fragment),Io=l(),Ve=a("p"),Oo=o("Convert frequency from hertz to mels."),Vt=l(),N=a("div"),F(te.$$.fragment),Ho=l(),We=a("p"),Lo=o("Convert frequency from mels to hertz."),Wt=l(),u=a("div"),F(oe.$$.fragment),Mo=l(),re=a("p"),Po=o("Creates a frequency bin conversion matrix used to obtain a mel spectrogram. This is called a "),Ge=a("em"),No=o("mel filter bank"),Bo=o(`, and
various implementation exist, which differ in the number of filters, the shape of the filters, the way the filters
are spaced, the bandwidth of the filters, and the manner in which the spectrum is warped. The goal of these
features is to approximate the non-linear human perception of the variation in pitch with respect to the frequency.`),So=l(),Ke=a("p"),Ao=o("Different banks of mel filters were introduced in the literature. The following variations are supported:"),Uo=l(),T=a("ul"),ae=a("li"),Vo=o(`MFCC FB-20: introduced in 1980 by Davis and Mermelstein, it assumes a sampling frequency of 10 kHz and a speech
bandwidth of `),Re=a("code"),Wo=o("[0, 4600]"),Go=o(" Hz."),Ko=l(),ne=a("li"),Ro=o(`MFCC FB-24 HTK: from the Cambridge HMM Toolkit (HTK) (1995) uses a filter bank of 24 filters for a speech
bandwidth of `),je=a("code"),jo=o("[0, 8000]"),Jo=o(" Hz. This assumes sampling rate \u2265 16 kHz."),Qo=l(),se=a("li"),Xo=o(`MFCC FB-40: from the Auditory Toolbox for MATLAB written by Slaney in 1998, assumes a sampling rate of 16 kHz and
speech bandwidth of `),Je=a("code"),Yo=o("[133, 6854]"),Zo=o(" Hz. This version also includes area normalization."),er=l(),ie=a("li"),tr=o(`HFCC-E FB-29 (Human Factor Cepstral Coefficients) of Skowronski and Harris (2004), assumes a sampling rate of
12.5 kHz and speech bandwidth of `),Qe=a("code"),or=o("[0, 6250]"),rr=o(" Hz."),ar=l(),g=a("p"),nr=o("This code is adapted from "),Xe=a("em"),sr=o("torchaudio"),ir=o(" and "),Ye=a("em"),lr=o("librosa"),dr=o(`. Note that the default parameters of torchaudio\u2019s
`),Ze=a("code"),cr=o("melscale_fbanks"),mr=o(" implement the "),et=a("code"),fr=o('"htk"'),hr=o(" filters while librosa uses the "),tt=a("code"),pr=o('"slaney"'),ur=o(" implementation."),Gt=l(),x=a("div"),F(le.$$.fragment),gr=l(),de=a("p"),_r=o("Finds the best FFT input size for a given "),ot=a("code"),vr=o("window_length"),wr=o(`. This function takes a given window length and, if not
already a power of two, rounds it up to the next power or two.`),br=l(),rt=a("p"),yr=o(`The FFT algorithm works fastest when the length of the input is a power of two, which may be larger than the size
of the window or analysis frame. For example, if the window is 400 samples, using an FFT input size of 512 samples
is more optimal than an FFT size of 400 samples. Using a larger FFT size does not affect the detected frequencies,
it simply gives a higher frequency resolution (i.e. the frequency bins are smaller).`),Kt=l(),v=a("div"),F(ce.$$.fragment),Er=l(),me=a("p"),Tr=o("Returns an array containing the specified window. This window is intended to be used with "),at=a("code"),xr=o("stft"),qr=o("."),kr=l(),nt=a("p"),$r=o("The following window types are supported:"),Fr=l(),B=a("ul"),$e=a("li"),st=a("code"),zr=o('"boxcar"'),Cr=o(": a rectangular window"),Dr=l(),Fe=a("li"),it=a("code"),Ir=o('"hamming"'),Or=o(": the Hamming window"),Hr=l(),ze=a("li"),lt=a("code"),Lr=o('"hann"'),Mr=o(": the Hann window"),Rt=l(),m=a("div"),F(fe.$$.fragment),Pr=l(),dt=a("p"),Nr=o("Calculates a spectrogram over one waveform using the Short-Time Fourier Transform."),Br=l(),ct=a("p"),Sr=o("This function can create the following kinds of spectrograms:"),Ar=l(),_=a("ul"),he=a("li"),Ur=o("amplitude spectrogram ("),mt=a("code"),Vr=o("power = 1.0"),Wr=o(")"),Gr=l(),pe=a("li"),Kr=o("power spectrogram ("),ft=a("code"),Rr=o("power = 2.0"),jr=o(")"),Jr=l(),ue=a("li"),Qr=o("complex-valued spectrogram ("),ht=a("code"),Xr=o("power = None"),Yr=o(")"),Zr=l(),ge=a("li"),ea=o("log spectrogram (use "),pt=a("code"),ta=o("log_mel"),oa=o(" argument)"),ra=l(),_e=a("li"),aa=o("mel spectrogram (provide "),ut=a("code"),na=o("mel_filters"),sa=o(")"),ia=l(),S=a("li"),la=o("log-mel spectrogram (provide "),gt=a("code"),da=o("mel_filters"),ca=o(" and "),_t=a("code"),ma=o("log_mel"),fa=o(")"),ha=l(),vt=a("p"),pa=o("How this works:"),ua=l(),q=a("ol"),G=a("li"),ga=o("The input waveform is split into frames of size "),wt=a("code"),_a=o("frame_length"),va=o(" that are partially overlapping by `frame_length"),bt=a("ul"),yt=a("li"),wa=o("hop_length` samples."),ba=l(),ve=a("li"),ya=o("Each frame is multiplied by the window and placed into a buffer of size "),Et=a("code"),Ea=o("fft_length"),Ta=o("."),xa=l(),Tt=a("li"),qa=o("The DFT is taken of each windowed frame."),ka=l(),xt=a("li"),$a=o("The results are stacked into a spectrogram."),Fa=l(),qt=a("p"),za=o("We make a distinction between the following \u201Cblocks\u201D of sample data, each of which may have a different lengths:"),Ca=l(),A=a("ul"),kt=a("li"),Da=o("The analysis frame. This is the size of the time slices that the input waveform is split into."),Ia=l(),$t=a("li"),Oa=o("The window. Each analysis frame is multiplied by the window to avoid spectral leakage."),Ha=l(),Ft=a("li"),La=o("The FFT input buffer. The length of this determines how many frequency bins are in the spectrogram."),Ma=l(),we=a("p"),Pa=o(`In this implementation, the window is assumed to be zero-padded to have the same size as the analysis frame. A
padded window can be obtained from `),zt=a("code"),Na=o("window_function()"),Ba=o(`. The FFT input buffer may be larger than the analysis frame,
typically the next power of two.`),Sa=l(),U=a("p"),Aa=o("Note: This function is not optimized for speed yet. It should be mostly compatible with "),Ct=a("code"),Ua=o("librosa.stft"),Va=o(` and
`),Dt=a("code"),Wa=o("torchaudio.functional.transforms.Spectrogram"),Ga=o(`, although it is more flexible due to the different ways spectrograms
can be constructed.`),jt=l(),w=a("div"),F(be.$$.fragment),Ka=l(),ye=a("p"),Ra=o("Converts a power spectrogram to the decibel scale. This computes "),It=a("code"),ja=o("10 * log10(spectrogram / reference)"),Ja=o(`, using basic
logarithm properties for numerical stability.`),Qa=l(),Ot=a("p"),Xa=o(`The motivation behind applying the log function on the (mel) spectrogram is that humans do not hear loudness on a
linear scale. Generally to double the perceived volume of a sound we need to put 8 times as much energy into it.
This means that large variations in energy may not sound all that different if the sound is loud to begin with.
This compression operation makes the (mel) spectrogram features match more closely what humans actually hear.`),Ya=l(),Ee=a("p"),Za=o("Based on the implementation of "),Ht=a("code"),en=o("librosa.power_to_db"),tn=o("."),Jt=l(),k=a("div"),F(Te.$$.fragment),on=l(),xe=a("p"),rn=o("Converts an amplitude spectrogram to the decibel scale. This computes "),Lt=a("code"),an=o("20 * log10(spectrogram / reference)"),nn=o(`, using
basic logarithm properties for numerical stability.`),sn=l(),Mt=a("p"),ln=o(`The motivation behind applying the log function on the (mel) spectrogram is that humans do not hear loudness on a
linear scale. Generally to double the perceived volume of a sound we need to put 8 times as much energy into it.
This means that large variations in energy may not sound all that different if the sound is loud to begin with.
This compression operation makes the (mel) spectrogram features match more closely what humans actually hear.`),this.h()},l(i){const c=Es('[data-svelte="svelte-1phssyn"]',document.head);H=n(c,"META",{name:!0,content:!0}),c.forEach(t),Nt=d(i),L=n(i,"H1",{class:!0});var Xt=s(L);V=n(Xt,"A",{id:!0,class:!0,href:!0});var pn=s(V);Me=n(pn,"SPAN",{});var un=s(Me);z(Y.$$.fragment,un),un.forEach(t),pn.forEach(t),wo=d(Xt),qe=n(Xt,"SPAN",{});var dn=s(qe);bo=r(dn,"Utilities for "),Pe=n(dn,"CODE",{});var gn=s(Pe);yo=r(gn,"FeatureExtractors"),gn.forEach(t),dn.forEach(t),Xt.forEach(t),Bt=d(i),b=n(i,"P",{});var K=s(b);Eo=r(K,"This page lists all the utility functions that can be used by the audio "),Ne=n(K,"CODE",{});var _n=s(Ne);To=r(_n,"FeatureExtractor"),_n.forEach(t),xo=r(K," in order to compute special features from a raw audio using common algorithms such as "),Be=n(K,"EM",{});var vn=s(Be);qo=r(vn,"Short Time Fourier Transform"),vn.forEach(t),ko=r(K," or "),Se=n(K,"EM",{});var wn=s(Se);$o=r(wn,"log mel spectrogram"),wn.forEach(t),Fo=r(K,"."),K.forEach(t),St=d(i),ke=n(i,"P",{});var bn=s(ke);zo=r(bn,"Most of those are only useful if you are studying the code of the audio processors in the library."),bn.forEach(t),At=d(i),M=n(i,"H2",{class:!0});var Yt=s(M);W=n(Yt,"A",{id:!0,class:!0,href:!0});var yn=s(W);Ae=n(yn,"SPAN",{});var En=s(Ae);z(Z.$$.fragment,En),En.forEach(t),yn.forEach(t),Co=d(Yt),Ue=n(Yt,"SPAN",{});var Tn=s(Ue);Do=r(Tn,"Audio Transformations"),Tn.forEach(t),Yt.forEach(t),Ut=d(i),P=n(i,"DIV",{class:!0});var Zt=s(P);z(ee.$$.fragment,Zt),Io=d(Zt),Ve=n(Zt,"P",{});var xn=s(Ve);Oo=r(xn,"Convert frequency from hertz to mels."),xn.forEach(t),Zt.forEach(t),Vt=d(i),N=n(i,"DIV",{class:!0});var eo=s(N);z(te.$$.fragment,eo),Ho=d(eo),We=n(eo,"P",{});var qn=s(We);Lo=r(qn,"Convert frequency from mels to hertz."),qn.forEach(t),eo.forEach(t),Wt=d(i),u=n(i,"DIV",{class:!0});var $=s(u);z(oe.$$.fragment,$),Mo=d($),re=n($,"P",{});var to=s(re);Po=r(to,"Creates a frequency bin conversion matrix used to obtain a mel spectrogram. This is called a "),Ge=n(to,"EM",{});var kn=s(Ge);No=r(kn,"mel filter bank"),kn.forEach(t),Bo=r(to,`, and
various implementation exist, which differ in the number of filters, the shape of the filters, the way the filters
are spaced, the bandwidth of the filters, and the manner in which the spectrum is warped. The goal of these
features is to approximate the non-linear human perception of the variation in pitch with respect to the frequency.`),to.forEach(t),So=d($),Ke=n($,"P",{});var $n=s(Ke);Ao=r($n,"Different banks of mel filters were introduced in the literature. The following variations are supported:"),$n.forEach(t),Uo=d($),T=n($,"UL",{});var R=s(T);ae=n(R,"LI",{});var oo=s(ae);Vo=r(oo,`MFCC FB-20: introduced in 1980 by Davis and Mermelstein, it assumes a sampling frequency of 10 kHz and a speech
bandwidth of `),Re=n(oo,"CODE",{});var Fn=s(Re);Wo=r(Fn,"[0, 4600]"),Fn.forEach(t),Go=r(oo," Hz."),oo.forEach(t),Ko=d(R),ne=n(R,"LI",{});var ro=s(ne);Ro=r(ro,`MFCC FB-24 HTK: from the Cambridge HMM Toolkit (HTK) (1995) uses a filter bank of 24 filters for a speech
bandwidth of `),je=n(ro,"CODE",{});var zn=s(je);jo=r(zn,"[0, 8000]"),zn.forEach(t),Jo=r(ro," Hz. This assumes sampling rate \u2265 16 kHz."),ro.forEach(t),Qo=d(R),se=n(R,"LI",{});var ao=s(se);Xo=r(ao,`MFCC FB-40: from the Auditory Toolbox for MATLAB written by Slaney in 1998, assumes a sampling rate of 16 kHz and
speech bandwidth of `),Je=n(ao,"CODE",{});var Cn=s(Je);Yo=r(Cn,"[133, 6854]"),Cn.forEach(t),Zo=r(ao," Hz. This version also includes area normalization."),ao.forEach(t),er=d(R),ie=n(R,"LI",{});var no=s(ie);tr=r(no,`HFCC-E FB-29 (Human Factor Cepstral Coefficients) of Skowronski and Harris (2004), assumes a sampling rate of
12.5 kHz and speech bandwidth of `),Qe=n(no,"CODE",{});var Dn=s(Qe);or=r(Dn,"[0, 6250]"),Dn.forEach(t),rr=r(no," Hz."),no.forEach(t),R.forEach(t),ar=d($),g=n($,"P",{});var y=s(g);nr=r(y,"This code is adapted from "),Xe=n(y,"EM",{});var In=s(Xe);sr=r(In,"torchaudio"),In.forEach(t),ir=r(y," and "),Ye=n(y,"EM",{});var On=s(Ye);lr=r(On,"librosa"),On.forEach(t),dr=r(y,`. Note that the default parameters of torchaudio\u2019s
`),Ze=n(y,"CODE",{});var Hn=s(Ze);cr=r(Hn,"melscale_fbanks"),Hn.forEach(t),mr=r(y," implement the "),et=n(y,"CODE",{});var Ln=s(et);fr=r(Ln,'"htk"'),Ln.forEach(t),hr=r(y," filters while librosa uses the "),tt=n(y,"CODE",{});var Mn=s(tt);pr=r(Mn,'"slaney"'),Mn.forEach(t),ur=r(y," implementation."),y.forEach(t),$.forEach(t),Gt=d(i),x=n(i,"DIV",{class:!0});var Ce=s(x);z(le.$$.fragment,Ce),gr=d(Ce),de=n(Ce,"P",{});var so=s(de);_r=r(so,"Finds the best FFT input size for a given "),ot=n(so,"CODE",{});var Pn=s(ot);vr=r(Pn,"window_length"),Pn.forEach(t),wr=r(so,`. This function takes a given window length and, if not
already a power of two, rounds it up to the next power or two.`),so.forEach(t),br=d(Ce),rt=n(Ce,"P",{});var Nn=s(rt);yr=r(Nn,`The FFT algorithm works fastest when the length of the input is a power of two, which may be larger than the size
of the window or analysis frame. For example, if the window is 400 samples, using an FFT input size of 512 samples
is more optimal than an FFT size of 400 samples. Using a larger FFT size does not affect the detected frequencies,
it simply gives a higher frequency resolution (i.e. the frequency bins are smaller).`),Nn.forEach(t),Ce.forEach(t),Kt=d(i),v=n(i,"DIV",{class:!0});var j=s(v);z(ce.$$.fragment,j),Er=d(j),me=n(j,"P",{});var io=s(me);Tr=r(io,"Returns an array containing the specified window. This window is intended to be used with "),at=n(io,"CODE",{});var Bn=s(at);xr=r(Bn,"stft"),Bn.forEach(t),qr=r(io,"."),io.forEach(t),kr=d(j),nt=n(j,"P",{});var Sn=s(nt);$r=r(Sn,"The following window types are supported:"),Sn.forEach(t),Fr=d(j),B=n(j,"UL",{});var De=s(B);$e=n(De,"LI",{});var cn=s($e);st=n(cn,"CODE",{});var An=s(st);zr=r(An,'"boxcar"'),An.forEach(t),Cr=r(cn,": a rectangular window"),cn.forEach(t),Dr=d(De),Fe=n(De,"LI",{});var mn=s(Fe);it=n(mn,"CODE",{});var Un=s(it);Ir=r(Un,'"hamming"'),Un.forEach(t),Or=r(mn,": the Hamming window"),mn.forEach(t),Hr=d(De),ze=n(De,"LI",{});var fn=s(ze);lt=n(fn,"CODE",{});var Vn=s(lt);Lr=r(Vn,'"hann"'),Vn.forEach(t),Mr=r(fn,": the Hann window"),fn.forEach(t),De.forEach(t),j.forEach(t),Rt=d(i),m=n(i,"DIV",{class:!0});var h=s(m);z(fe.$$.fragment,h),Pr=d(h),dt=n(h,"P",{});var Wn=s(dt);Nr=r(Wn,"Calculates a spectrogram over one waveform using the Short-Time Fourier Transform."),Wn.forEach(t),Br=d(h),ct=n(h,"P",{});var Gn=s(ct);Sr=r(Gn,"This function can create the following kinds of spectrograms:"),Gn.forEach(t),Ar=d(h),_=n(h,"UL",{});var E=s(_);he=n(E,"LI",{});var lo=s(he);Ur=r(lo,"amplitude spectrogram ("),mt=n(lo,"CODE",{});var Kn=s(mt);Vr=r(Kn,"power = 1.0"),Kn.forEach(t),Wr=r(lo,")"),lo.forEach(t),Gr=d(E),pe=n(E,"LI",{});var co=s(pe);Kr=r(co,"power spectrogram ("),ft=n(co,"CODE",{});var Rn=s(ft);Rr=r(Rn,"power = 2.0"),Rn.forEach(t),jr=r(co,")"),co.forEach(t),Jr=d(E),ue=n(E,"LI",{});var mo=s(ue);Qr=r(mo,"complex-valued spectrogram ("),ht=n(mo,"CODE",{});var jn=s(ht);Xr=r(jn,"power = None"),jn.forEach(t),Yr=r(mo,")"),mo.forEach(t),Zr=d(E),ge=n(E,"LI",{});var fo=s(ge);ea=r(fo,"log spectrogram (use "),pt=n(fo,"CODE",{});var Jn=s(pt);ta=r(Jn,"log_mel"),Jn.forEach(t),oa=r(fo," argument)"),fo.forEach(t),ra=d(E),_e=n(E,"LI",{});var ho=s(_e);aa=r(ho,"mel spectrogram (provide "),ut=n(ho,"CODE",{});var Qn=s(ut);na=r(Qn,"mel_filters"),Qn.forEach(t),sa=r(ho,")"),ho.forEach(t),ia=d(E),S=n(E,"LI",{});var Ie=s(S);la=r(Ie,"log-mel spectrogram (provide "),gt=n(Ie,"CODE",{});var Xn=s(gt);da=r(Xn,"mel_filters"),Xn.forEach(t),ca=r(Ie," and "),_t=n(Ie,"CODE",{});var Yn=s(_t);ma=r(Yn,"log_mel"),Yn.forEach(t),fa=r(Ie,")"),Ie.forEach(t),E.forEach(t),ha=d(h),vt=n(h,"P",{});var Zn=s(vt);pa=r(Zn,"How this works:"),Zn.forEach(t),ua=d(h),q=n(h,"OL",{});var J=s(q);G=n(J,"LI",{});var Pt=s(G);ga=r(Pt,"The input waveform is split into frames of size "),wt=n(Pt,"CODE",{});var es=s(wt);_a=r(es,"frame_length"),es.forEach(t),va=r(Pt," that are partially overlapping by `frame_length"),bt=n(Pt,"UL",{});var ts=s(bt);yt=n(ts,"LI",{});var os=s(yt);wa=r(os,"hop_length` samples."),os.forEach(t),ts.forEach(t),Pt.forEach(t),ba=d(J),ve=n(J,"LI",{});var po=s(ve);ya=r(po,"Each frame is multiplied by the window and placed into a buffer of size "),Et=n(po,"CODE",{});var rs=s(Et);Ea=r(rs,"fft_length"),rs.forEach(t),Ta=r(po,"."),po.forEach(t),xa=d(J),Tt=n(J,"LI",{});var as=s(Tt);qa=r(as,"The DFT is taken of each windowed frame."),as.forEach(t),ka=d(J),xt=n(J,"LI",{});var ns=s(xt);$a=r(ns,"The results are stacked into a spectrogram."),ns.forEach(t),J.forEach(t),Fa=d(h),qt=n(h,"P",{});var ss=s(qt);za=r(ss,"We make a distinction between the following \u201Cblocks\u201D of sample data, each of which may have a different lengths:"),ss.forEach(t),Ca=d(h),A=n(h,"UL",{});var Oe=s(A);kt=n(Oe,"LI",{});var is=s(kt);Da=r(is,"The analysis frame. This is the size of the time slices that the input waveform is split into."),is.forEach(t),Ia=d(Oe),$t=n(Oe,"LI",{});var ls=s($t);Oa=r(ls,"The window. Each analysis frame is multiplied by the window to avoid spectral leakage."),ls.forEach(t),Ha=d(Oe),Ft=n(Oe,"LI",{});var ds=s(Ft);La=r(ds,"The FFT input buffer. The length of this determines how many frequency bins are in the spectrogram."),ds.forEach(t),Oe.forEach(t),Ma=d(h),we=n(h,"P",{});var uo=s(we);Pa=r(uo,`In this implementation, the window is assumed to be zero-padded to have the same size as the analysis frame. A
padded window can be obtained from `),zt=n(uo,"CODE",{});var cs=s(zt);Na=r(cs,"window_function()"),cs.forEach(t),Ba=r(uo,`. The FFT input buffer may be larger than the analysis frame,
typically the next power of two.`),uo.forEach(t),Sa=d(h),U=n(h,"P",{});var He=s(U);Aa=r(He,"Note: This function is not optimized for speed yet. It should be mostly compatible with "),Ct=n(He,"CODE",{});var ms=s(Ct);Ua=r(ms,"librosa.stft"),ms.forEach(t),Va=r(He,` and
`),Dt=n(He,"CODE",{});var fs=s(Dt);Wa=r(fs,"torchaudio.functional.transforms.Spectrogram"),fs.forEach(t),Ga=r(He,`, although it is more flexible due to the different ways spectrograms
can be constructed.`),He.forEach(t),h.forEach(t),jt=d(i),w=n(i,"DIV",{class:!0});var Q=s(w);z(be.$$.fragment,Q),Ka=d(Q),ye=n(Q,"P",{});var go=s(ye);Ra=r(go,"Converts a power spectrogram to the decibel scale. This computes "),It=n(go,"CODE",{});var hs=s(It);ja=r(hs,"10 * log10(spectrogram / reference)"),hs.forEach(t),Ja=r(go,`, using basic
logarithm properties for numerical stability.`),go.forEach(t),Qa=d(Q),Ot=n(Q,"P",{});var ps=s(Ot);Xa=r(ps,`The motivation behind applying the log function on the (mel) spectrogram is that humans do not hear loudness on a
linear scale. Generally to double the perceived volume of a sound we need to put 8 times as much energy into it.
This means that large variations in energy may not sound all that different if the sound is loud to begin with.
This compression operation makes the (mel) spectrogram features match more closely what humans actually hear.`),ps.forEach(t),Ya=d(Q),Ee=n(Q,"P",{});var _o=s(Ee);Za=r(_o,"Based on the implementation of "),Ht=n(_o,"CODE",{});var us=s(Ht);en=r(us,"librosa.power_to_db"),us.forEach(t),tn=r(_o,"."),_o.forEach(t),Q.forEach(t),Jt=d(i),k=n(i,"DIV",{class:!0});var Le=s(k);z(Te.$$.fragment,Le),on=d(Le),xe=n(Le,"P",{});var vo=s(xe);rn=r(vo,"Converts an amplitude spectrogram to the decibel scale. This computes "),Lt=n(vo,"CODE",{});var gs=s(Lt);an=r(gs,"20 * log10(spectrogram / reference)"),gs.forEach(t),nn=r(vo,`, using
basic logarithm properties for numerical stability.`),vo.forEach(t),sn=d(Le),Mt=n(Le,"P",{});var _s=s(Mt);ln=r(_s,`The motivation behind applying the log function on the (mel) spectrogram is that humans do not hear loudness on a
linear scale. Generally to double the perceived volume of a sound we need to put 8 times as much energy into it.
This means that large variations in energy may not sound all that different if the sound is loud to begin with.
This compression operation makes the (mel) spectrogram features match more closely what humans actually hear.`),_s.forEach(t),Le.forEach(t),this.h()},h(){p(H,"name","hf:doc:metadata"),p(H,"content",JSON.stringify(ks)),p(V,"id","utilities-for-featureextractors"),p(V,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(V,"href","#utilities-for-featureextractors"),p(L,"class","relative group"),p(W,"id","transformers.audio_utils.hertz_to_mel"),p(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(W,"href","#transformers.audio_utils.hertz_to_mel"),p(M,"class","relative group"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,c){e(document.head,H),f(i,Nt,c),f(i,L,c),e(L,V),e(V,Me),C(Y,Me,null),e(L,wo),e(L,qe),e(qe,bo),e(qe,Pe),e(Pe,yo),f(i,Bt,c),f(i,b,c),e(b,Eo),e(b,Ne),e(Ne,To),e(b,xo),e(b,Be),e(Be,qo),e(b,ko),e(b,Se),e(Se,$o),e(b,Fo),f(i,St,c),f(i,ke,c),e(ke,zo),f(i,At,c),f(i,M,c),e(M,W),e(W,Ae),C(Z,Ae,null),e(M,Co),e(M,Ue),e(Ue,Do),f(i,Ut,c),f(i,P,c),C(ee,P,null),e(P,Io),e(P,Ve),e(Ve,Oo),f(i,Vt,c),f(i,N,c),C(te,N,null),e(N,Ho),e(N,We),e(We,Lo),f(i,Wt,c),f(i,u,c),C(oe,u,null),e(u,Mo),e(u,re),e(re,Po),e(re,Ge),e(Ge,No),e(re,Bo),e(u,So),e(u,Ke),e(Ke,Ao),e(u,Uo),e(u,T),e(T,ae),e(ae,Vo),e(ae,Re),e(Re,Wo),e(ae,Go),e(T,Ko),e(T,ne),e(ne,Ro),e(ne,je),e(je,jo),e(ne,Jo),e(T,Qo),e(T,se),e(se,Xo),e(se,Je),e(Je,Yo),e(se,Zo),e(T,er),e(T,ie),e(ie,tr),e(ie,Qe),e(Qe,or),e(ie,rr),e(u,ar),e(u,g),e(g,nr),e(g,Xe),e(Xe,sr),e(g,ir),e(g,Ye),e(Ye,lr),e(g,dr),e(g,Ze),e(Ze,cr),e(g,mr),e(g,et),e(et,fr),e(g,hr),e(g,tt),e(tt,pr),e(g,ur),f(i,Gt,c),f(i,x,c),C(le,x,null),e(x,gr),e(x,de),e(de,_r),e(de,ot),e(ot,vr),e(de,wr),e(x,br),e(x,rt),e(rt,yr),f(i,Kt,c),f(i,v,c),C(ce,v,null),e(v,Er),e(v,me),e(me,Tr),e(me,at),e(at,xr),e(me,qr),e(v,kr),e(v,nt),e(nt,$r),e(v,Fr),e(v,B),e(B,$e),e($e,st),e(st,zr),e($e,Cr),e(B,Dr),e(B,Fe),e(Fe,it),e(it,Ir),e(Fe,Or),e(B,Hr),e(B,ze),e(ze,lt),e(lt,Lr),e(ze,Mr),f(i,Rt,c),f(i,m,c),C(fe,m,null),e(m,Pr),e(m,dt),e(dt,Nr),e(m,Br),e(m,ct),e(ct,Sr),e(m,Ar),e(m,_),e(_,he),e(he,Ur),e(he,mt),e(mt,Vr),e(he,Wr),e(_,Gr),e(_,pe),e(pe,Kr),e(pe,ft),e(ft,Rr),e(pe,jr),e(_,Jr),e(_,ue),e(ue,Qr),e(ue,ht),e(ht,Xr),e(ue,Yr),e(_,Zr),e(_,ge),e(ge,ea),e(ge,pt),e(pt,ta),e(ge,oa),e(_,ra),e(_,_e),e(_e,aa),e(_e,ut),e(ut,na),e(_e,sa),e(_,ia),e(_,S),e(S,la),e(S,gt),e(gt,da),e(S,ca),e(S,_t),e(_t,ma),e(S,fa),e(m,ha),e(m,vt),e(vt,pa),e(m,ua),e(m,q),e(q,G),e(G,ga),e(G,wt),e(wt,_a),e(G,va),e(G,bt),e(bt,yt),e(yt,wa),e(q,ba),e(q,ve),e(ve,ya),e(ve,Et),e(Et,Ea),e(ve,Ta),e(q,xa),e(q,Tt),e(Tt,qa),e(q,ka),e(q,xt),e(xt,$a),e(m,Fa),e(m,qt),e(qt,za),e(m,Ca),e(m,A),e(A,kt),e(kt,Da),e(A,Ia),e(A,$t),e($t,Oa),e(A,Ha),e(A,Ft),e(Ft,La),e(m,Ma),e(m,we),e(we,Pa),e(we,zt),e(zt,Na),e(we,Ba),e(m,Sa),e(m,U),e(U,Aa),e(U,Ct),e(Ct,Ua),e(U,Va),e(U,Dt),e(Dt,Wa),e(U,Ga),f(i,jt,c),f(i,w,c),C(be,w,null),e(w,Ka),e(w,ye),e(ye,Ra),e(ye,It),e(It,ja),e(ye,Ja),e(w,Qa),e(w,Ot),e(Ot,Xa),e(w,Ya),e(w,Ee),e(Ee,Za),e(Ee,Ht),e(Ht,en),e(Ee,tn),f(i,Jt,c),f(i,k,c),C(Te,k,null),e(k,on),e(k,xe),e(xe,rn),e(xe,Lt),e(Lt,an),e(xe,nn),e(k,sn),e(k,Mt),e(Mt,ln),Qt=!0},p:Ts,i(i){Qt||(D(Y.$$.fragment,i),D(Z.$$.fragment,i),D(ee.$$.fragment,i),D(te.$$.fragment,i),D(oe.$$.fragment,i),D(le.$$.fragment,i),D(ce.$$.fragment,i),D(fe.$$.fragment,i),D(be.$$.fragment,i),D(Te.$$.fragment,i),Qt=!0)},o(i){I(Y.$$.fragment,i),I(Z.$$.fragment,i),I(ee.$$.fragment,i),I(te.$$.fragment,i),I(oe.$$.fragment,i),I(le.$$.fragment,i),I(ce.$$.fragment,i),I(fe.$$.fragment,i),I(be.$$.fragment,i),I(Te.$$.fragment,i),Qt=!1},d(i){t(H),i&&t(Nt),i&&t(L),O(Y),i&&t(Bt),i&&t(b),i&&t(St),i&&t(ke),i&&t(At),i&&t(M),O(Z),i&&t(Ut),i&&t(P),O(ee),i&&t(Vt),i&&t(N),O(te),i&&t(Wt),i&&t(u),O(oe),i&&t(Gt),i&&t(x),O(le),i&&t(Kt),i&&t(v),O(ce),i&&t(Rt),i&&t(m),O(fe),i&&t(jt),i&&t(w),O(be),i&&t(Jt),i&&t(k),O(Te)}}}const ks={local:"utilities-for-featureextractors",sections:[{local:"transformers.audio_utils.hertz_to_mel",title:"Audio Transformations"}],title:"Utilities for `FeatureExtractors`"};function $s(hn){return xs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ds extends ws{constructor(H){super();bs(this,H,$s,qs,ys,{})}}export{Ds as default,ks as metadata};
