let signal_get s1 s2 =
let f1 = frequency s1 in
let f2 = frequency s2 in
let new_signal = fun t ->
let temp1 = (signal_fun s1) t in
let temp2 = (signal_fun s2) t in
match temp1 with
|Vec (size1, vec1) ->
(
match temp2 with
|N i -> vec1 i
|R f ->
raise (Signal_operation "Get: second input signal should be int.")
|Vec (size2, vec2) ->
raise (Signal_operation "Get: second input signal should be int.")
|Zero -> vec1 0
|W ->
raise (Signal_operation "Get: second input signal should be int.")
)
|_ -> raise (Signal_operation "Get: first input signal should be vector.")
in
if f1 = f2 || f2 = 0 then (f1, new_signal)
else if f1 = 0 then (f2, new_signal)
else raise (Signal_operation "frequency not matched in signal_get.")