carbon.stream

このモジュールは、信号処理のための試験的なモジュールです。 このモジュールで定義されているストリームは、Rangeに拡張を加える事で大量のデータを処理することに最適です。 また、状況によってはSIMD最適化を狙えるよう設計になっています。

Members

Functions

accumulator
auto accumulator(size_t integN)

積分器です。 積分するサンプル量が大きい場合の使用に適しています。

accumulator
auto accumulator(Sg sg, size_t bufSize)
auto accumulator(Sg sg, E[] buffer)

積分器です。 たとえば、連続する少数の個数のサンプルの和を取るような用途に適しています。

adder
auto adder(Sg1 sg1, Sg2 sg2)

二つの信号を足します。 2つ目の信号は、演算により生成された理想信号でなければいけません。

amplifier
auto amplifier(Sg sg, F gain)
Undocumented in source. Be warned that the author may not have intended to support it.
arrayMapper
auto arrayMapper(Sg sg, E[] arr, size_t[] buf, size_t bufSize)
binaryFunExt
A binaryFunExt(A a, B b)

InplaceComputableStreamを作成する際に有用な、std.functional.binaryFunの拡張です

fillBuffer
E[] fillBuffer(S s, E[] buf)

入力ストリームから、ストリーム終端になるまで可能な限り読み出します。

fillBufferOp
E[] fillBufferOp(S s, E[] buffer)
firFilter
auto firFilter(Sg sg, E[] taps)

FIRフィルタを構成します。

firFilter
auto firFilter(Sg sg, E[] tap, E[] buf)
lutNCO
auto lutNCO(R range, real freq, real deltaT, real theta)
mapper
auto mapper(Sg sg, ElementType!Sg[] buf, size_t bufSize)

信号をマッピングします

mixer
auto mixer(Sg1 sg1, Sg2 sg2)

二つの信号の積を返します。 2つ目の信号は演算による理想信号でなければいけません。

normalizer
auto normalizer(Sg sg, E limit)

信号の絶対値の最大値をlimitにするように線形に振幅を小さく、もしくは大きくします。

preciseComplexNCO
auto preciseComplexNCO(real freq, real deltaT, real theta)

正確なComplexNCO

rawFileStream
auto rawFileStream(string filename, size_t bufferSize)

一度に巨大なファイルを読み込むことに特化した,バッファ持ち入力ストリームです。

repeatStream
auto repeatStream(E[] array)
auto repeatStream(E element)

永遠とその配列をループし続けるストリーム

selector
auto selector(Sg sgs)
Undocumented in source. Be warned that the author may not have intended to support it.
toStream
auto toStream(R range)

レンジをisInplaceComputableStreamに変換します

Templates

lutNCO
template lutNCO(alias func, size_t divN)

Lookup-Table方式の高速な局部発振器を提供します。 テンプレートパラメータのfuncには周期2PIの周期関数を与えることが出来ます。 たとえば、std.math.expiを与えれば複素発振器となり、std.math.sinであれば正弦波を出力します。

Variables

isBufferedInputStream
enum bool isBufferedInputStream(T);

内部にバッファを持つような入力ストリームです。

isBufferedOutputStream
enum bool isBufferedOutputStream(T);

内部にバッファを持つような出力ストリームです。

isInplaceComputableStream
enum bool isInplaceComputableStream(T, alias op = "", U = Unqual!(ElementType!T));

演算可能なストリームとは、readOpメソッドに与えられたバッファ上に、計算した要素を格納可能な入力ストリームです。 これは、次のような実行時条件を満たしている必要があります。

isInputStream
enum bool isInputStream(T);

入力ストリームは、readメソッドに与えられたバッファに要素を格納可能な型です。 実行時には、次のような特徴を満たさなければいけません。

isOutputStream
enum bool isOutputStream(T, E);

出力ストリームは、t.writeメソッドに与えられたバッファを出力可能な型です。 実行時には次のような条件を満たしている必要があります。

Meta