Merge branch 'master' of https://scm.cri.ensmp.fr/git/Faustine
authorWANG <wang@wang-OptiPlex-780.(none)>
Mon, 16 Sep 2013 15:56:12 +0000 (17:56 +0200)
committerWANG <wang@wang-OptiPlex-780.(none)>
Mon, 16 Sep 2013 15:56:12 +0000 (17:56 +0200)
Conflicts:
examples/Makefile

15 files changed:
Makefile
examples/Makefile
examples/close/img_read.m
examples/fft/Makefile
examples/fft/fft.png [new file with mode: 0644]
examples/fft/img_write.m [new file with mode: 0644]
examples/licenceplate/Makefile [moved from examples/licenseplate/Makefile with 100% similarity]
examples/licenceplate/img_read.m [moved from examples/licenseplate/img_read.m with 100% similarity]
examples/licenceplate/img_write.m [moved from examples/licenseplate/img_write.m with 100% similarity]
examples/licenceplate/licence.png [moved from examples/licenseplate/licence.png with 100% similarity]
examples/licenceplate/licence_small.png [moved from examples/licenseplate/licence_small.png with 100% similarity]
examples/licenceplate/licenceplate.dsp [moved from examples/licenseplate/licenceplate.dsp with 100% similarity]
examples/open/img_read.m
examples/primitives/Makefile
examples/sinwave/Makefile

index c558b8c..2743a33 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,7 @@ clean:
 mrproper: clean
        @($(MAKE) -C $(SRC_DIR) mrproper)
        @($(MAKE) -C $(PREPROCESSOR_DIR) clean)
+       @($(MAKE) -C $(EXAMPLES_DIR) clean)
 
 test:
        @$(MAKE) -C $(SINWAVE_DIR)
@@ -43,6 +44,9 @@ test:
        @echo "open $(SINWAVE_DIR)/output1.wav"
        @echo "octave -q --eval 'plot(wavread(\"$(SINWAVE_DIR)/output1.wav\")); pause'"
 
+example:
+       @($(MAKE) -C $(EXAMPLES_DIR))
+
 install :
        mkdir -p $(prefix)/lib/faustine/
        mkdir -p $(prefix)/bin/
index befe8b4..30cc6fa 100644 (file)
@@ -1,11 +1,10 @@
-SOURCES = $(wildcard */*.dsp)
-DIRS = sinwave fft primitives # 2d_fft close fft open sinwave dilation erosion licenseplate primitives
+EXAMPLES = 2d_fft close dilation erosion fft open primitives sinwave #licenceplate
 
-all: make-each-example
+all: examples
 
-define mytarget
-  make-each-example:: ; $(MAKE) -C $1
-endef
+examples::
+       @echo "Making all the examples, it may take several minutes..."
+       @$(foreach example, $(EXAMPLES), $(MAKE) -C $(example);)
 
-$(foreach dir,$(DIRS),$(eval $(call mytarget,$(dir))))
-       
+clean::
+       @$(foreach example, $(EXAMPLES), $(MAKE) -C $(example) clean;)
index 1f1beae..941dbfa 100644 (file)
@@ -1,2 +1,2 @@
-a = imread('circbw.png' );
+a = imread('circbw.gif' );
 csvwrite('circbw.csv', a);
index fa1e89d..20aeaf3 100644 (file)
@@ -4,10 +4,18 @@ INPUT2 = sin_2067Hz_0.005_ampli_128samples.wav
 INPUT3 = sin_16536Hz_0.005_ampli_128samples.wav
 INPUT4 = sin_22000Hz_0.005_ampli_128samples.wav
 
-all: clean fft
+BASENAME = output
+FORMAT = csv
+CSVOUT = $(BASENAME)1.$(FORMAT)
+IMGOUT = $(SRC:.dsp=.png)
 
-fft: $(SRC) $(INPUT1) $(INPUT2) $(INPUT3) $(INPUT4)
-       faustine -d $(SRC) -i $(INPUT1) -i $(INPUT2) -i $(INPUT3) -i $(INPUT4)
+all: $(IMGOUT)
+
+$(IMGOUT): $(CSVOUT)
+       octave -qf img_write.m
+
+$(CSVOUT): $(SRC) $(INPUT1) $(INPUT2) $(INPUT3) $(INPUT4)
+       faustine -d $(SRC) -i $(INPUT1) -i $(INPUT2) -i $(INPUT3) -i $(INPUT4) --oformat $(FORMAT) --obasename $(BASENAME)
 
 clean::
        rm -f gmon.out output*
diff --git a/examples/fft/fft.png b/examples/fft/fft.png
new file mode 100644 (file)
index 0000000..6e8739e
Binary files /dev/null and b/examples/fft/fft.png differ
diff --git a/examples/fft/img_write.m b/examples/fft/img_write.m
new file mode 100644 (file)
index 0000000..a359b40
--- /dev/null
@@ -0,0 +1,4 @@
+a = csvread('output1.csv' );
+plot(a);
+print('fft.png');
+
index 1f1beae..941dbfa 100644 (file)
@@ -1,2 +1,2 @@
-a = imread('circbw.png' );
+a = imread('circbw.gif' );
 csvwrite('circbw.csv', a);
index 80d4dbd..b392c2b 100644 (file)
@@ -2,10 +2,14 @@ EXAMPLE = primitives
 SRC = $(EXAMPLE).dsp
 SAMPLES = 30
 
-all: clean $(EXAMPLE)
+BASENAME = output
+FORMAT = csv
+CSVOUT = $(BASENAME)1.$(FORMAT)
 
-$(EXAMPLE): $(SRC)
-       faustine -d $(SRC) -t $(SAMPLES) --oformat csv
+all: $(CSVOUT)
+
+$(CSVOUT): $(SRC)
+       faustine -d $(SRC) -t $(SAMPLES) --oformat $(FORMAT) --obasename $(BASENAME)
 
 clean::
        rm -f gmon.out output*
index 4a495a4..c6d2ec9 100644 (file)
@@ -1,7 +1,13 @@
-all: clean sin
+SRC = sin.dsp
 
-sin: sin.dsp
-       faustine -d $<
+BASENAME = output
+FORMAT = wav
+WAVOUT = $(BASENAME)1.$(FORMAT)
+
+all: $(WAVOUT)
+
+$(WAVOUT): $(SRC)
+       faustine -d $< --obasename $(BASENAME) --oformat $(FORMAT)
 
 clean::
-       rm -f gmon.out output*
+       rm -f gmon.out $(BASENAME)*