mirror of https://github.com/drowe67/phasenn.git
add phase0 model to compare
parent
712b1d5198
commit
aa2087ebdd
22
synth.sh
22
synth.sh
|
@ -5,25 +5,31 @@
|
||||||
|
|
||||||
PATH=$PATH:~/codec2/build_linux/src:~/codec2/build_linux/misc
|
PATH=$PATH:~/codec2/build_linux/src:~/codec2/build_linux/misc
|
||||||
|
|
||||||
if [ "$#" -ne 4 ]; then
|
if [ "$#" -lt 2 ]; then
|
||||||
echo "usage: ./synth.sh rawFile nn.h5 startSecs lengthSecs"
|
echo "usage: ./synth.sh rawFile nn.h5 [startSecs lengthSecs]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
speech=$1
|
speech=$1
|
||||||
nn=$2
|
nn=$2
|
||||||
st=$3
|
|
||||||
len=$4
|
|
||||||
x=$(basename $speech)
|
x=$(basename $speech)
|
||||||
base="${x%.*}"
|
base="${x%.*}"
|
||||||
out_model=out.model
|
out_model=out.model
|
||||||
seg=$(mktemp)'.sw'
|
seg=$(mktemp)'.sw'
|
||||||
echo $seg
|
echo $seg
|
||||||
|
if [ "$#" -lt 4 ]; then
|
||||||
|
sox -t .sw -r 8000 -c 1 $speech -t .sw $seg
|
||||||
|
else
|
||||||
|
st=$3
|
||||||
|
len=$4
|
||||||
|
sox -t .sw -r 8000 -c 1 $speech -t .sw - trim $st $len > $seg
|
||||||
|
fi
|
||||||
|
|
||||||
sox -t .sw -r 8000 -c 1 $speech -t .sw - trim $st $len > $seg
|
|
||||||
c2sim $seg --modelout - | est_n0 -r > $base'_nolinear.model'
|
c2sim $seg --modelout - | est_n0 -r > $base'_nolinear.model'
|
||||||
./phasenn_out.py $base'_nolinear.model' $nn $base'_out.model'
|
./phasenn_out.py $base'_nolinear.model' $nn $base'_out.model'
|
||||||
c2sim $seg --modelout - | est_n0 -a $base'_out.model' > $base'_comb.model'
|
c2sim $seg --modelout - | est_n0 -a $base'_out.model' > $base'_comb.model'
|
||||||
c2sim $seg --modelin $base'_comb.model' -o $base'_outnn.sw'
|
c2sim $seg --modelin $base'_comb.model' --postfilter -o $base'_outnn.sw'
|
||||||
|
|
||||||
# orig speech - sinusoidal orig phases - sinusoidal phaseNN
|
# orig speech - sinusoidal orig phases - sinusoidal phase0 - sinusoidal phaseNN
|
||||||
c2sim $seg -o $base'_out.sw'
|
c2sim $seg -o $base'_out.sw'
|
||||||
sox $seg $base'_out.sw' $base'_outnn.sw' $base'_all.sw'
|
c2sim $seg --phase0 --postfilter -o $base'_outp0.sw'
|
||||||
|
sox $seg $base'_out.sw' $base'_outp0.sw' $base'_outnn.sw' $base'_all.sw'
|
||||||
|
|
Loading…
Reference in New Issue