From: WANG Date: Wed, 21 Aug 2013 15:24:25 +0000 (+0200) Subject: MRFausti -> Faustine in Makefile.in. X-Git-Url: https://scm.cri.mines-paristech.fr/git/Faustine.git/commitdiff_plain/d1f93175cc683d72876cb56b4a8f566578296bb9?ds=sidebyside MRFausti -> Faustine in Makefile.in. --- diff --git a/Makefile b/Makefile index a4338bd..9eb9354 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ SOURCE_DIR = interpretor PREPROCESSOR_DIR = $(SOURCE_DIR)/faust-0.9.47mr3 -all: MRFausti +all: Faustine -MRFausti: +Faustine: @(cp $(SNDFILE_PATH)/sndfile_stub.o $(SOURCE_DIR)) @(cd $(SOURCE_DIR) && $(MAKE) opt OCAML_INCLUDE_PATH=$(OCAML_INCLUDE_PATH) SNDFILE_PATH=$(SNDFILE_PATH)) @(cd $(SOURCE_DIR) && $(MAKE) clean) diff --git a/Makefile.in b/Makefile.in index 56aa7b1..a6e557b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,9 +2,9 @@ SOURCE_DIR = interpretor PREPROCESSOR_DIR = $(SOURCE_DIR)/faust-0.9.47mr3 -all: MRFausti +all: Faustine -MRFausti: +Faustine: @(cp $(SNDFILE_PATH)/sndfile_stub.o $(SOURCE_DIR)) @(cd $(SOURCE_DIR) && $(MAKE) opt OCAML_INCLUDE_PATH=$(OCAML_INCLUDE_PATH) SNDFILE_PATH=$(SNDFILE_PATH)) @(cd $(SOURCE_DIR) && $(MAKE) clean) diff --git a/dsp_files/fft2d.dsp b/dsp_files/fft2d.dsp index 2b50b0b..3498eba 100644 --- a/dsp_files/fft2d.dsp +++ b/dsp_files/fft2d.dsp @@ -39,6 +39,11 @@ output(n, m) = serialize; //fft2d(x, y) = matricize(x, y) : output(x, y); fft2d(x, y) = normalize(GREY_MAX) : matricize(x, y) : lines_fft(x, y) : matrix_transpose(x, y) : lines_fftc(y, x) : matrix_transpose(y, x) : norm_out(x, y); +new_fft2d(x, y) = normalize(GREY_MAX) : vectorize(x) : lines_fft(x, y) : matrix_transpose(x, y) : lines_fftc(y, x) : matrix_transpose(y, x) : norm_out(x, y); + //safer with x=y because tests and zero padding are still to implement -process = fft2d(32,32); +//process = fft2d(32,32); +process = new_fft2d(32,32); + + diff --git a/interpretor/aux.ml b/interpretor/aux.ml index 9463cae..3f75f06 100644 --- a/interpretor/aux.ml +++ b/interpretor/aux.ml @@ -22,3 +22,5 @@ let array_map3 = fun f -> fun a -> fun b -> fun c -> let n3 = Array.length c in if n1 = n2 && n1 = n3 then Array.init n1 (fun i -> f a.(i) b.(i) c.(i)) else raise (Invalid_argument "Array.map3 size not matched.");; + +let decorate = fun s -> " Faustine -> " ^ s;; diff --git a/interpretor/beam.ml b/interpretor/beam.ml index 273ae1c..f9ea667 100644 --- a/interpretor/beam.ml +++ b/interpretor/beam.ml @@ -72,6 +72,9 @@ class beam : signal_type array -> beam_type = method output : int -> float array array array = fun (length_max : int) -> + let () = print_string(" Faustine -> Calculating...") in + let tic = Sys.time () in + let transpose : 'a array array -> 'a array array = fun matrix -> let get_element = fun i -> fun array -> array.(i) in @@ -88,7 +91,10 @@ class beam : signal_type array -> beam_type = container.(!index) <- Array.map value2float (self#at !index); incr index; done; - transpose container + let result = transpose container in + let toc = Sys.time () in + let () = print_endline (" Done. (duration: " ^ (string_of_float (toc -. tic)) ^ "s.)") in + result with x -> let error_message = @@ -97,11 +103,14 @@ class beam : signal_type array -> beam_type = | Basic_operation s -> "Basic_operation: " ^ s | Signal_operation s -> "Signal_operation: " ^ s | Beam_matching s -> "Beam_Matching_Error: " ^ s - | Invalid_argument s -> "Compute finished." + | Invalid_argument s -> "" | _ -> "Unknown error" in - let () = print_string error_message in - transpose (Array.sub container 0 !index) + let () = print_string (error_message) in + let result = transpose (Array.sub container 0 !index) in + let toc = Sys.time () in + let () = print_endline (" Done. (duration: " ^ (string_of_float (toc -. tic)) ^ "s.)") in + result method frequency : int array = let each_rate : signal -> int = diff --git a/interpretor/faustine b/interpretor/faustine index b87845f..585ed24 100755 Binary files a/interpretor/faustine and b/interpretor/faustine differ diff --git a/interpretor/gmon.out b/interpretor/gmon.out index aca0945..8c27fb9 100644 Binary files a/interpretor/gmon.out and b/interpretor/gmon.out differ diff --git a/interpretor/main.ml b/interpretor/main.ml index 5e074a2..e214802 100644 --- a/interpretor/main.ml +++ b/interpretor/main.ml @@ -5,6 +5,7 @@ Created: 15/05/2013 Modified: 14/08/2013 *) +open Aux;; open Process;; open Faustio;; @@ -63,17 +64,35 @@ let main () = let wave = new waveio in let csv = new csvio in - let input = wave#read (Array.of_list !inwavs) in + let input_wave = wave#read (Array.of_list !inwavs) in + let input_csv = csv#read (Array.of_list !incsvs) in + let input = input_wave#append input_csv in + + let () = print_string(" Faustine -> Preprocessing...") in + let tic1 = Sys.time () in let faust_core = Preprocess.preprocess !path_dsp in + let toc1 = Sys.time () in + let () = print_endline(" Done. (duration: " ^ (string_of_float (toc1 -. tic1)) ^ "s.)") in + + + let () = print_string(" Faustine -> Interpretation...") in + let tic2 = Sys.time () in let faust_exp = exp_of_string faust_core in let proc = (new proc_factory)#make faust_exp in + let toc2 = Sys.time () in + let () = print_endline(" Done. (duration: " ^ (string_of_float (toc2 -. tic2)) ^ "s.)") in + + let output = proc#eval input in let data = output#output time_maximum in let rates = output#frequency in let output_wave_paths = wave#write rates data in - let _ = csv#write rates data in - let _ = Array.map print_endline output_wave_paths in + let output_csv_paths = csv#write rates data in + let _ = Array.map print_endline + (Array.map decorate output_wave_paths) in + let _ = Array.map print_endline + (Array.map decorate output_csv_paths) in ();;