21
#include "kstbinding.h"
21
#include "bind_dataobject.h"
23
23
#include <kstpsd.h>
25
25
#include <kjs/interpreter.h>
26
26
#include <kjs/object.h>
28
using namespace KJSEmbed;
30
class KstBindPowerSpectrum : public KstBinding {
28
/* @class PowerSpectrum
30
@collection PowerSpectrumCollection
31
@description This class represents a power spectrum (PSD) object in Kst.
33
class KstBindPowerSpectrum : public KstBindDataObject {
36
@arg Vector vector The vector to use as input to the power spectrum.
37
@arg number freq The frequency for the power spectrum.
38
@optarg boolean average
39
@optarg number len The base 2 logarithm of the length of the power
40
spectrum. Should be an integer >= 4.
41
@optarg boolean apodize If true, sharp discontinuities are removed.
42
@optarg boolean removeMean True if the mean should be removed before
43
performing the transform.
44
@description Creates a new power spectrum (PSD) object in Kst. Units
45
are <i>V</i> and <i>Hz</i> by default.
32
47
KstBindPowerSpectrum(KJS::ExecState *exec, KstPSDPtr d);
33
48
KstBindPowerSpectrum(KJS::ExecState *exec, KJS::Object *globalObject = 0L);
34
49
~KstBindPowerSpectrum();
43
58
// member functions
46
void setTagName(KJS::ExecState *exec, const KJS::Value& value);
47
KJS::Value tagName(KJS::ExecState *exec) const;
60
/* @property number length
61
@description Contains the base 2 logarithm of the length of the power
62
spectrum. Should be an integer >= 4.
48
64
void setLength(KJS::ExecState *exec, const KJS::Value& value);
49
65
KJS::Value length(KJS::ExecState *exec) const;
66
/* @property boolean removeMean
67
@description True if the mean should be removed before performing the
50
70
void setRemoveMean(KJS::ExecState *exec, const KJS::Value& value);
51
71
KJS::Value removeMean(KJS::ExecState *exec) const;
72
/* @property number average
52
74
void setAverage(KJS::ExecState *exec, const KJS::Value& value);
53
75
KJS::Value average(KJS::ExecState *exec) const;
76
/* @property boolean apodize
77
@description If true, sharp discontinuities are removed.
54
79
void setApodize(KJS::ExecState *exec, const KJS::Value& value);
55
80
KJS::Value apodize(KJS::ExecState *exec) const;
81
/* @property number frequency
82
@description Contains the sampling rate of the power spectrum.
56
84
void setFrequency(KJS::ExecState *exec, const KJS::Value& value);
57
85
KJS::Value frequency(KJS::ExecState *exec) const;
86
/* @property Vector xVector
88
@description The X-axis vector for the power spectrum.
58
90
KJS::Value xVector(KJS::ExecState *exec) const;
91
/* @property Vector yVector
93
@description The Y-axi vector for the power spectrum.
59
95
KJS::Value yVector(KJS::ExecState *exec) const;
96
/* @property string vUnits
97
@description A string containing the units for the vector.
60
99
void setVUnits(KJS::ExecState *exec, const KJS::Value& value);
61
100
KJS::Value vUnits(KJS::ExecState *exec) const;
101
/* @property string rUnits
102
@description A string containing the units for the rate.
62
104
void setRUnits(KJS::ExecState *exec, const KJS::Value& value);
63
105
KJS::Value rUnits(KJS::ExecState *exec) const;
66
108
KstBindPowerSpectrum(int id);
67
109
void addBindings(KJS::ExecState *exec, KJS::Object& obj);
110
static KstBindDataObject *bindFactory(KJS::ExecState *exec, KstDataObjectPtr obj);