Module Signal


module Signal: sig .. end
Module: Signal Description: type signal = rate * (int -> value), operations of signals.
Author(s): WANG Haisheng Created: 03/06/2013 Modified: 03/06/2013

exception Signal_operation of string
Exception raised in operations of signals.

type signal_macro =
| Delay_Memory_Length_int
Macro constants of the file.
val signal_macro_to_int : signal_macro -> int
val signal_macro_to_int : signal_macro -> int.
val frequency : 'a * 'b -> 'a
val frequency : signal -> int, returns the frequency of a signal.
val signal_fun : 'a * 'b -> 'b
val signal_fun : signal -> (int -> value), returns the functional part of a signal.
val check_frequency : int -> int -> int
val check_frequency : int -> int -> int, returns the correction of frequency.
val signal_check_frequency : int * 'a -> int * 'b -> int
val signal_check_frequency : signal -> signal -> int, checks the frequencies of two input signals, and returns common frequency or raise an exception.
val signal_check_frequency3 : int * 'a -> int * 'b -> int * 'c -> int
val signal_check_frequency3 : signal -> signal -> signal -> int, checks the frequencies of three input signal, and returns common frequency or raise an exception.
val signal_check_frequency4 : int * 'a -> int * 'b -> int * 'c -> int * 'd -> int
val signal_check_frequency4 : signal -> signal -> signal -> signal -> int, checks the frequencies of three input signal, and returns common frequency or raise an exception.
val signal_add_one_memory : 'a * (int -> 'b) -> 'a * (int -> 'b)
val signal_add_one_memory : signal -> signal, returns the signal with memory of one latest sample.
val beam_add_one_memory : ('a * (int -> 'b)) list -> ('a * (int -> 'b)) list
val beam_add_one_memory : signal list -> signal list, adds memory of one latest sample for each element in signal list.
val signal_add : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_add : signal -> signal -> signal, output(t) = input1(t) + input2(t), frequency consistent.
val signal_neg : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_neg : signal -> signal, output(t) = -input(t), frequency consistent.
val signal_sub : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_sub : signal -> signal -> signal, output(t) = input1(t) - input2(t), frequency consistent.
val signal_mul : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_mul : signal -> signal -> signal, output(t) = input1(t) * input2(t), frequency consistent.
val signal_div : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_div : signal -> signal -> signal, output(t) = input1(t) / input2(t), frequency consistent.
val signal_delay : 'a * (int -> Types.value) ->
'b * (int -> Types.value) -> 'a * (int -> Types.value)
val signal_delay : signal -> signal -> signal, output(t) = input1(t - input2(t)), Attention: delay dynamic, frequency of output signal equals to that of first input signal.
val signal_mem : 'a * (int -> Types.value) -> 'a * (int -> Types.value)
val signal_mem : signal -> signal, equivalent to signal_delay with constant delay 1.
val signal_vectorize : int * (int -> Types.value) ->
'a * (int -> Types.value) -> int * (int -> Types.value)
val signal_vectorize : signal -> signal -> signal, output(t)(i) = input1(input2(0) * t + i), Attention: vector size n static, frequency of output signal is (1/n * frequency of input1)
val signal_serialize : int * (int -> Types.value) -> int * (int -> Types.value)
val signal_serialize : signal -> signal, output(t) = input(floor(t/n))(t%n), with n = size of input(0). Attention: input size unknown in the cas of "rec".
val signal_append : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_append : signal -> signal -> signal, symbol "#", appends vectors of the two input signals at each time, frequency consistent.
val signal_nth : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_nth : signal -> signal -> signal, symbol "[]", output(t) = input1(t)(input2(t)), frequency consistent. Attention: selection index dynamic.
val signal_floor : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_floor : signal -> signal, output(t) = v_floor(input(t)), frequency consistent.
val signal_int : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_int : signal -> signal, output(t) = v_int(input(t)), frequency consistent.
val signal_sin : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_sin : signal -> signal, output(t) = v_sin(input(t)), frequency consistent.
val signal_cos : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_cos : signal -> signal, output(t) = v_cos(input(t)), frequency consistent.
val signal_atan : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_atan : signal -> signal, output(t) = v_atan(input(t)), frequency consistent.
val signal_atantwo : 'a * ('b -> Types.value) ->
'c * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_sqrt : 'a * ('b -> Types.value) -> 'a * ('b -> Types.value)
val signal_sqrt : signal -> signal, output(t) = v_sqrt(input(t)), frequency consistent.
val signal_rdtable : 'a * (int -> Types.value) ->
'b * (int -> 'c) -> 'd * ('e -> Types.value) -> 'd * ('e -> 'c)
val signal_rdtable : signal -> signal -> signal, output(t) = input1(input2(t)), frequency equals to that of input2. Attention: no memory implemented, very expensive when input1 comes from rec or delays.
val signal_mod : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_mod : signal -> signal -> signal, output(t) = input1(t) % input2(t), frequency consistent.
val signal_sup : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_sup : signal -> signal -> signal, output(t) = input1(t) > input2(t), frequency consistent.
val signal_inf : int * ('a -> Types.value) ->
int * ('a -> Types.value) -> int * ('a -> Types.value)
val signal_inf : signal -> signal -> signal, output(t) = input1(t) < input2(t), frequency consistent.
val signal_select2 : int * ('a -> Types.value) ->
int * ('a -> 'b) -> int * ('a -> 'b) -> int * ('a -> 'b)
val signal_select2 : signal -> signal -> signal -> signal, signal_select2 si s0 s1 selects s0 or s1 by index si, frequency consistent.
val signal_select3 : int * ('a -> Types.value) ->
int * ('a -> 'b) -> int * ('a -> 'b) -> int * ('a -> 'b) -> int * ('a -> 'b)
val signal_select3 : signal -> signal -> signal -> signal -> signal, signal_select3 si s0 s1 s2 selects s0 or s1 or s2 by index si, frequency consistent.
val signal_prefix : 'a * (int -> 'b) -> 'c * (int -> 'b) -> 'c * (int -> 'b)
val signal_prefix : signal -> signal -> signal, signal_prefix s0 s1 returns s0(0) if t = 0, s1(t-1) if t > 0, frequency same to s1.