pyACA: Documentation 0.3.1
Source Code for Audio Content Analysis
Loading...
Searching...
No Matches
Functions
pyACA.ToolBin2Freq Namespace Reference

Functions

 ToolBin2Freq (fBin, iFftLength, f_s)
 helper function: convert FFT bin to Hz
 

Function Documentation

◆ ToolBin2Freq()

ToolBin2Freq ( fBin,
iFftLength,
f_s )

helper function: convert FFT bin to Hz

Parameters
fBinFFT bin index (can be float)
iFftLengthlength of the Fft (time domain block size)
f_ssample rate of audio data
Returns
f: bin frequency (in Hz)

Definition at line 13 of file ToolBin2Freq.py.

13def ToolBin2Freq(fBin, iFftLength, f_s):
14 def acaBin2Freq_scalar_I(fBin, iFftLength, f_s):
15 return fBin * f_s / float(iFftLength)
16
17 b = np.asarray(fBin)
18 if b.ndim == 0:
19 return acaBin2Freq_scalar_I(b, iFftLength, f_s)
20
21 f = np.zeros(b.shape)
22 for k, bk in enumerate(b):
23 f[k] = acaBin2Freq_scalar_I(bk, iFftLength, f_s)
24
25 return f