|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.meapsoft.STFT
A class to extract and hold STFT info from an AudioInputStream. Calls listeners when a new frame is added. Calculates the log magnitude spectrogram.
Field Summary | |
int |
nhop
|
float |
samplingRate
|
Constructor Summary | |
STFT(javax.sound.sampled.AudioInputStream input,
int frameLen,
int history)
|
|
STFT(javax.sound.sampled.AudioInputStream input,
int frameLen,
int hopsize,
int history)
|
Method Summary | |
void |
addFrameListener(FrameListener fl)
|
void |
bytes2doubles(byte[] audioBytes,
double[] audioData)
|
long |
fr2Samp(long frAddr)
|
double |
fr2Seconds(long frAddr)
|
int |
getColumns()
|
double[] |
getFrame(long frAddr)
|
long |
getLastFrameAddress()
Get the frame address of the last frame read into this object. |
int |
getRows()
|
double[] |
getSamples(long frStart,
long frEnd)
|
static RingMatrix |
getSTFT(double[] samples,
int nfft)
Get the STFT of samples, with no overlap between frames |
static RingMatrix |
getSTFT(double[] samples,
int nfft,
int nhop)
Get the STFT of samples |
void |
notifyListeners(long frAddr)
|
int |
readFrames(long nframes)
Fill this STFT object with up to the next nframes frames of data. |
void |
removeFrameListener(FrameListener fl)
|
long |
samp2fr(long sampAddr)
|
long |
seconds2fr(double sec)
|
void |
setFrame(long frAddr,
double[] dat)
|
long |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public float samplingRate
public int nhop
Constructor Detail |
public STFT(javax.sound.sampled.AudioInputStream input, int frameLen, int hopsize, int history)
public STFT(javax.sound.sampled.AudioInputStream input, int frameLen, int history)
Method Detail |
public long start()
public double[] getSamples(long frStart, long frEnd)
public long fr2Samp(long frAddr)
public long samp2fr(long sampAddr)
public double[] getFrame(long frAddr)
public void setFrame(long frAddr, double[] dat)
public int getColumns()
public int getRows()
public void addFrameListener(FrameListener fl)
public void removeFrameListener(FrameListener fl)
public void notifyListeners(long frAddr)
public void bytes2doubles(byte[] audioBytes, double[] audioData)
public double fr2Seconds(long frAddr)
public long seconds2fr(double sec)
public static RingMatrix getSTFT(double[] samples, int nfft)
public static RingMatrix getSTFT(double[] samples, int nfft, int nhop)
public int readFrames(long nframes)
nframes
- number of audio frames to read
public long getLastFrameAddress()
public void stop() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |