|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectframed.Melfilter
public class Melfilter
Triangular mel-filter with log application in the end (if desired). Note that
the bandwidth is fixed(*), thus the number of filters can be controlled using
the overlap parameter.
(*) as suggested by Florian Hoenig
Field Summary | |
---|---|
static double |
DEFAULT_FO
Default filter overlap |
static double |
DEFAULT_FW
Default filter width in mel |
static double |
DEFAULT_LB
Default lower boundary frequency (Hz) of mel filter bank |
static double |
DEFAULT_UB
Default upper boundary frequency (Hz) of mel filter bank |
static double |
EPSILON
Epsilon constant for logarithm |
Constructor Summary | |
---|---|
Melfilter(FrameSource source,
int sampleRate)
Create the default mel filter bank (bandwidth = 226.79982mel) |
|
Melfilter(FrameSource source,
int sampleRate,
boolean logMel)
Create the default mel filter bank (bandwidth = 226.79982mel) and apply the logarithm in the end. |
Method Summary | |
---|---|
static Melfilter |
create(FrameSource source,
int sampleRate,
java.lang.String parameterString)
Create a Melfilter object using the given parameter string and connect it to the source. |
double |
getActualFilterOverlap()
Though a certain overlap is requested at initialization, the actual overlap might be slightly different to exactly match start and end freqs. |
int |
getFrameSize()
The frame size is the size of the filter bank! |
static void |
main(java.lang.String[] args)
|
java.lang.String |
printFilterBank()
get a String representation of the filter bank format 3 lines per filter (gnuplot ready): filterNum 0 startFreq filterNum 1 centerFreq filterNum 0 endFreq |
boolean |
read(double[] buf)
Extract the next frame from the the source stream using a window function |
java.lang.String |
toString()
Return a String representation of the FrameSource |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double DEFAULT_FO
public static double DEFAULT_FW
public static double DEFAULT_LB
public static double DEFAULT_UB
public static double EPSILON
Constructor Detail |
---|
public Melfilter(FrameSource source, int sampleRate)
source
- FrameSource to read fromsampleRate
- sample rate of the original signal in Hzpublic Melfilter(FrameSource source, int sampleRate, boolean logMel)
source
- FrameSource to read fromsampleRate
- sample rate of the original signal in HzlogMel
- if true, log is applied to all values in the endMethod Detail |
---|
public static Melfilter create(FrameSource source, int sampleRate, java.lang.String parameterString) throws MalformedParameterStringException
source
- sampleRate
- parameterString
- "start-hz,end-hz,width-mel,val"; val < 1: min-overlap, val > 1: min-num filters
MalformedParameterStringException
public double getActualFilterOverlap()
public int getFrameSize()
getFrameSize
in interface FrameSource
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public java.lang.String printFilterBank()
public boolean read(double[] buf) throws java.io.IOException
FrameSource
read
in interface FrameSource
buf
- buffer to save the frame; implementing objects may depend
on a constant dimensionduring subsequent calls
java.io.IOException
public java.lang.String toString()
FrameSource
toString
in interface FrameSource
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |