Nsound
0.9.4
|
#include <Nsound/Kernel.h>
Public Member Functions | |
Kernel (uint32 b_length, uint32 a_length, int32 f1=0, int32 f2=0, int32 f3=0, int32 f4=0) | |
Kernel (const Kernel ©) | |
virtual | ~Kernel () |
boolean | operator< (const Kernel &rhs) const |
float64 | getA (uint32 i) |
Returns kernel 'a[i]' coef. More... | |
float64 * | getA () |
Returns Kernel 'a' array, the length is returned by getALegnth() More... | |
const float64 * | getA () const |
Returns Kernel 'a' array, the length is returned by getALegnth() More... | |
float64 | getB (uint32 i) |
Returns kernel 'b[i]' coef. More... | |
float64 * | getB () |
Returns kernel 'b' array, the length is returned by getBLegnth() More... | |
const float64 * | getB () const |
Returns kernel 'b' array, the length is returned by getBLegnth() More... | |
uint32 | getALength () const |
uint32 | getBLength () const |
float64 | getSum () const |
Kernel & | operator= (const Kernel &rhs) |
void | randomize (const float64 &min=-1.0, const float64 &max=1.0) |
Sets all coefs to random float64 values between min & max. More... | |
void | setA (const float64 *a) |
Copy getALength() values from the array a into the Kernel. Use setLength() to set the number of values to copy. More... | |
void | setA (const float64 &d, uint32 i) |
Set a_[i] = d. More... | |
void | setA (const Buffer &a) |
Copy getALength() values from the array a into the Kernel. Use setLength() to set the number of values to copy. More... | |
void | setB (const float64 *b) |
Copy getBLength() values from the array a into the Kernel. Use setLength() to set the number of values to copy. More... | |
void | setB (const float64 &d, uint32 i) |
Set b_[i] = d. More... | |
void | setB (const Buffer &b) |
Copy getALength() values from the array a into the Kernel. Use setLength() to set the number of values to copy. More... | |
void | setLength (uint32 b_length, uint32 a_length) |
void | ga_swap_ab (Kernel &rhs) |
Genitic Algorithm Helper Function: swaps the A & B coefs. More... | |
void | ga_interleave (Kernel &rhs) |
Genitic Algorithm Helper Function: interleave B coefs with B, A with A. More... | |
void | ga_interleave () |
Genitic Algorithm Helper Function: interleave B coefs with A. More... | |
Protected Attributes | |
uint32 | b_length_ |
uint32 | a_length_ |
int32 | f1_ |
int32 | f2_ |
int32 | f3_ |
int32 | f4_ |
float64 * | b_ |
float64 * | a_ |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Kernel &rhs) |
Prints the coeffents. More... | |
WARNING: This is Experimental, you should not use this class as it may not be working or will change in future releases of Nsound.
Kernel::Kernel | ( | uint32 | b_length, |
uint32 | a_length, | ||
int32 | f1 = 0 , |
||
int32 | f2 = 0 , |
||
int32 | f3 = 0 , |
||
int32 | f4 = 0 |
||
) |
Kernel::Kernel | ( | const Kernel & | copy | ) |
Returns kernel 'a[i]' coef.
Definition at line 70 of file Kernel.h.
Referenced by Nsound::FilterIIR::designKernel(), Nsound::FilterIIR::filter(), and ga_swap_ab().
|
inline |
Returns Kernel 'a' array, the length is returned by getALegnth()
Definition at line 75 of file Kernel.h.
References a_.
Referenced by ga_swap_ab().
|
inline |
Returns kernel 'b[i]' coef.
Definition at line 86 of file Kernel.h.
Referenced by Nsound::FilterIIR::designKernel(), Nsound::FilterIIR::filter(), and ga_swap_ab().
|
inline |
Returns kernel 'b' array, the length is returned by getBLegnth()
Definition at line 91 of file Kernel.h.
References b_.
Referenced by ga_swap_ab().
|
inline |
|
inline |
|
inline |
float64 Kernel::getSum | ( | ) | const |
Sets all coefs to random float64 values between min & max.
Definition at line 194 of file Kernel.cc.
References a_, a_length_, b_, b_length_, and Nsound::RngTausworthe::get().
Referenced by Nsound::FilterIIR::designKernel().
void Kernel::setA | ( | const float64 * | a | ) |
Copy getALength() values from the array a into the Kernel. Use setLength() to set the number of values to copy.
Definition at line 211 of file Kernel.cc.
Referenced by Nsound::FilterIIR::designKernel(), ga_swap_ab(), and Nsound::FilterParametricEqualizer::makeKernel().
void Kernel::setA | ( | const Buffer & | a | ) |
Copy getALength() values from the array a into the Kernel. Use setLength() to set the number of values to copy.
Definition at line 218 of file Kernel.cc.
References a_, a_length_, and Nsound::Buffer::getLength().
void Kernel::setB | ( | const float64 * | b | ) |
Copy getBLength() values from the array a into the Kernel. Use setLength() to set the number of values to copy.
Definition at line 233 of file Kernel.cc.
Referenced by Nsound::FilterIIR::designKernel(), ga_swap_ab(), and Nsound::FilterParametricEqualizer::makeKernel().
void Kernel::setB | ( | const Buffer & | b | ) |
Copy getALength() values from the array a into the Kernel. Use setLength() to set the number of values to copy.
Definition at line 240 of file Kernel.cc.
References b_, b_length_, and Nsound::Buffer::getLength().
void Kernel::ga_swap_ab | ( | Kernel & | rhs | ) |
Genitic Algorithm Helper Function: swaps the A & B coefs.
Definition at line 275 of file Kernel.cc.
References getA(), getB(), setA(), and setB().
Referenced by Nsound::FilterIIR::designKernel().
void Kernel::ga_interleave | ( | Kernel & | rhs | ) |
Genitic Algorithm Helper Function: interleave B coefs with B, A with A.
Definition at line 296 of file Kernel.cc.
References a_, a_length_, b_, b_length_, and swap_().
Referenced by Nsound::FilterIIR::designKernel().
void Kernel::ga_interleave | ( | ) |
|
friend |
Prints the coeffents.
|
protected |
Definition at line 164 of file Kernel.h.
Referenced by ga_interleave(), getB(), getBLength(), getSum(), Kernel(), operator<(), Nsound::operator<<(), operator=(), randomize(), setB(), and setLength().
|
protected |
Definition at line 165 of file Kernel.h.
Referenced by ga_interleave(), getA(), getALength(), getSum(), Kernel(), operator<(), Nsound::operator<<(), operator=(), randomize(), setA(), and setLength().
|
protected |
Definition at line 167 of file Kernel.h.
Referenced by operator<(), and operator=().
|
protected |
Definition at line 168 of file Kernel.h.
Referenced by operator<(), and operator=().
|
protected |
Definition at line 169 of file Kernel.h.
Referenced by operator<(), and operator=().
|
protected |
Definition at line 170 of file Kernel.h.
Referenced by operator<(), and operator=().
|
protected |
Definition at line 172 of file Kernel.h.
Referenced by ga_interleave(), getB(), getSum(), Kernel(), Nsound::operator<<(), operator=(), randomize(), setB(), setLength(), and ~Kernel().
|
protected |
Definition at line 173 of file Kernel.h.
Referenced by ga_interleave(), getA(), getSum(), Kernel(), Nsound::operator<<(), operator=(), randomize(), setA(), setLength(), and ~Kernel().