let signal_serialize s = 
        let temp0 = (signal_fun s) 0 in
        match temp0 with
        |Vec (size0, vec0) ->
            let new_signal = fun t ->
                      (
                              let temp = (signal_fun s) (t/size0) in
                              match temp with
                              |Vec (size, vec) ->
                                      if size = size0 then 
                                        vec (t mod size)
                                      else 
                                        raise (Signal_operation "Serialize: vector length not consistent.")
                              |-> raise (Signal_operation "Serialize: signal type not consistent.")
                      )
            in
            let new_frequency = (frequency s) * size0 in
            (new_frequency, new_signal)
        |-> raise (Signal_operation "Serialize: input signal should be vector.")