public class TF32J
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
class |
TF32J.MainFrame |
Modifier and Type | Method | Description |
---|---|---|
void |
clearText() |
|
void |
close() |
|
static java.lang.Object |
createObject(java.lang.String cname) |
|
boolean |
dllFilt(int ch,
java.lang.String lib,
java.lang.String proc,
java.lang.String id,
double[] fcoef,
boolean newchan) |
|
double |
getFCur() |
|
double |
getFScn() |
|
double |
getICur() |
|
double |
getIScn() |
|
int |
getNChan() |
|
double |
getPrimaryMs() |
|
int |
getPrimaryMSamp() |
|
int |
getSpecCursorIndex() |
|
double |
getSpecdB(int ix) |
Spectrum frequency is ix*getSpecDkHz()
Nyquist (half-sampling) of viewed channel is (getSpecLength()-1)*getSpecDkHz()
|
double |
getSpecDkHz() |
|
int |
getSpecIndex(double fkHz) |
|
int |
getSpecLength() |
|
WaveSourceJ |
getWaveSourceJ(int ch) |
|
void |
impulseGen() |
|
void |
invoke(java.lang.String cname,
java.lang.String mname) |
|
boolean |
javaFilt(int ch,
java.lang.String filt_name,
double[] fcoef,
boolean newchan) |
|
boolean |
javaFilt(java.lang.String filt_name) |
|
boolean |
javaFilt(java.lang.String filt_name,
double[] fcoef) |
|
static void |
main(java.lang.String[] args) |
|
int |
maxViewedCh() |
|
void |
newWavePlot() |
|
boolean |
newWavePlot(int nch,
double bufsec,
double sample_ms) |
|
boolean |
openWaveDlg() |
|
boolean |
openWaveFile(java.lang.String fname) |
|
boolean |
plotWave() |
|
void |
setFCur(double fcur_ms) |
|
void |
setICur(double icur_ms) |
|
void |
setScreen(double[] curs) |
|
double |
setSpecCursorIndex(int ix) |
|
void |
setSpecHamming(boolean val) |
|
void |
setSpecPreem(boolean val) |
|
boolean |
setSpecViewedCh(int ch) |
|
void |
setSpecYRange() |
Restore defaults yrange = new double[] {0, -100, -100, 10};
|
void |
setSpecYRange(double[] yrange) |
|
void |
setWaveSourceJ(int ch,
WaveSourceJ wsJ) |
|
boolean |
sisoFilt(int ch,
SISOFilter filt,
double[] fcoef,
boolean newchan) |
|
boolean |
sisoFilt(SISOFilter filt) |
|
boolean |
sisoFilt(SISOFilter filt,
double[] fcoef) |
|
void |
squareGen() |
|
boolean |
vocFilt(int ch,
java.lang.String filt_name,
double[] fcoef,
boolean newchan) |
|
boolean |
vocFilt(java.lang.String filt_name) |
|
boolean |
vocFilt(java.lang.String filt_name,
double[] fcoef) |
|
void |
zeroWave() |
|
void |
zoomIn() |
|
void |
zoomOut() |
public static void main(java.lang.String[] args)
public void invoke(java.lang.String cname, java.lang.String mname)
cname
- Class name -- constructor that takes reference to this class (TF32J)mname
- Method name -- name of a null-argument method in that class
Used for calling methods operating on WaveSourceJ objects in myjava\ModDemod.java for purposes of implementing modulators, demodulators or other signal processing implemented as a graph of single-input single-output filters.
Uses a Java Classloader of directory myjava relative to the current directory to allow modifying and recompiling cname.mname without having to exit TF32J and restart it to get the changes. Directory myjava must not be on the Java classpath used in launching TF32J/TF32JMod, otherwise this "trick" will not work.
Uses Java "reflection" to link to cname.mname at runtime -- this becomes flexible like Python but also with the limitation of Python of no compile-time checking hence the use of Exceptions to flag a runtime error. This feature implements "duck typing" (if it looks like a duck and quacks like a duck) to invoke a method on any object, regardless of its statically compiled type if its name matches the supplied string and if its "signature" (pattern of supplied arguments) matches the specified template.
public static java.lang.Object createObject(java.lang.String cname)
cname
- Class namepublic boolean openWaveFile(java.lang.String fname)
fname
- is filename to openpublic boolean openWaveDlg()
public boolean newWavePlot(int nch, double bufsec, double sample_ms)
nch
- Number of waveform channelsbufsec
- Length of waveform in secondssample_ms
- Interval between samples in mspublic void newWavePlot()
public boolean plotWave()
public void close()
public void clearText()
public int maxViewedCh()
public int getNChan()
public int getPrimaryMSamp()
public double getPrimaryMs()
public double getIScn()
public double getFScn()
public double getICur()
public double getFCur()
public void setScreen(double[] curs)
public void setICur(double icur_ms)
public void setFCur(double fcur_ms)
public void zoomIn()
public void zoomOut()
public boolean dllFilt(int ch, java.lang.String lib, java.lang.String proc, java.lang.String id, double[] fcoef, boolean newchan)
ch
- The channel to filterlib
- Name of dll/dylib/soproc
- Function entry pointid
- A text string further identifying the filterfcoef
- Double array of filter parametersnewchan
- Overwrite ch if false, output to new channel if truepublic boolean javaFilt(int ch, java.lang.String filt_name, double[] fcoef, boolean newchan)
ch
- The channel to filterfilt_name
- Name of the Java class of the filterfcoef
- Double array of filter parametersnewchan
- Overwrite ch if false, output to new channel if truepublic boolean javaFilt(java.lang.String filt_name, double[] fcoef)
filt_name
- Name of the Java class of the filterfcoef
- Double array of filter parameterspublic boolean javaFilt(java.lang.String filt_name)
filt_name
- Name of the Java class of the filterpublic boolean vocFilt(int ch, java.lang.String filt_name, double[] fcoef, boolean newchan)
ch
- The channel to filterfilt_name
- Function entry point in VocFiltfcoef
- Double array of filter parametersnewchan
- Overwrite ch if false, output to new channel if truepublic boolean vocFilt(java.lang.String filt_name, double[] fcoef)
filt_name
- Function entry point in VocFiltfcoef
- Double array of filter parameterspublic boolean vocFilt(java.lang.String filt_name)
filt_name
- Function entry point in VocFiltpublic boolean sisoFilt(int ch, SISOFilter filt, double[] fcoef, boolean newchan)
ch
- The channel to filterfilt
- Filter object descended from net.cspeech.DSP.SISOFilter,
which includes net.cspeech.DSP.InPlace and net.cspeech.DSP.NonCausalfcoef
- Double array of filter parametersnewchan
- Overwrite ch if false, output to new channel if truepublic boolean sisoFilt(SISOFilter filt, double[] fcoef)
filt
- Filter object descended from net.cspeech.DSP.SISOFilter,
which includes net.cspeech.DSP.InPlace and net.cspeech.DSP.NonCausalfcoef
- Double array of filter parameterspublic boolean sisoFilt(SISOFilter filt)
filt
- Filter object descended from net.cspeech.DSP.SISOFilter,
which includes net.cspeech.DSP.InPlace and net.cspeech.DSP.NonCausalpublic void squareGen()
public void impulseGen()
public void zeroWave()
public WaveSourceJ getWaveSourceJ(int ch)
public void setWaveSourceJ(int ch, WaveSourceJ wsJ)
ch
- Channel to overwrite or addwsJ
- WaveSourceJ waveform stream objectpublic boolean setSpecViewedCh(int ch)
ch
- Selects channel in the displaypublic void setSpecPreem(boolean val)
val
- Selects spectrum preemphasispublic void setSpecHamming(boolean val)
val
- selects Hamming window if true, rectangular if falsepublic void setSpecYRange(double[] yrange)
yrange
- = new double[] {dB_top, dB_bot, dB_ref, dB_step}public void setSpecYRange()
public int getSpecLength()
public double getSpecDkHz()
public int getSpecIndex(double fkHz)
fkHz
- is frequency in kHzpublic double getSpecdB(int ix)
ix
- is the integer index on the range .. getSpecLength()-1public double setSpecCursorIndex(int ix)
ix
- is the new cursor index on the range 0 .. getSpecLength()-1public int getSpecCursorIndex()