make_lpc 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. #####################################################-*-mode:shell-script-*-
  3. ### ##
  4. ### Alan W Black and Kevin Lenzo ##
  5. ### Copyright (c) 1998 ##
  6. ### All Rights Reserved. ##
  7. ### ##
  8. ### Permission to use, copy, modify, and licence this software and its ##
  9. ### documentation for any purpose, is hereby granted without fee, ##
  10. ### subject to the following conditions: ##
  11. ### 1. The code must retain the above copyright notice, this list of ##
  12. ### conditions and the following disclaimer. ##
  13. ### 2. Any modifications must be clearly marked as such. ##
  14. ### 3. Original authors' names are not deleted. ##
  15. ### ##
  16. ### THE AUTHORS OF THIS WORK DISCLAIM ALL WARRANTIES WITH REGARD TO ##
  17. ### THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ##
  18. ### AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY ##
  19. ### SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ##
  20. ### WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ##
  21. ### AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ##
  22. ### ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ##
  23. ### THIS SOFTWARE. ##
  24. ### ##
  25. ### This file is part "Building Voices in the Festival Speech ##
  26. ### Synthesis System" by Alan W Black and Kevin Lenzo written at ##
  27. ### Robotics Institute, Carnegie Mellon University, fall 98 ##
  28. ############################################################################
  29. ### ##
  30. ### Generate LPC coefficients and residual for diphones (or otherwise) ##
  31. ### ##
  32. ############################################################################
  33. if [ ! "$ESTDIR" ]
  34. then
  35. echo "environment variable ESTDIR is unset"
  36. echo "set it to your local speech tools directory e.g."
  37. echo ' bash$ export ESTDIR=/home/awb/projects/speech_tools/'
  38. echo or
  39. echo ' csh% setenv ESTDIR /home/awb/projects/speech_tools/'
  40. exit 1
  41. fi
  42. for i in $*
  43. do
  44. fname=`basename $i .wav`
  45. echo $i
  46. # Potential normalise the power (a hack)
  47. $ESTDIR/bin/ch_wave -scaleN 0.5 $i -o /tmp/tmp$$.wav
  48. # or if you want to resample, now is the time (can be combine with above)
  49. #$ESTDIR/bin/ch_wave -F 11025 $i -o /tmp/tmp$$.wav
  50. # Or use as is
  51. #cat $i >/tmp/tmp$$.wav
  52. $ESTDIR/bin/sig2fv /tmp/tmp$$.wav -o lpc/$fname.lpc -otype est_binary -lpc_order 16 -coefs "lpc" -pm pm/$fname.pm -preemph 0.95 -factor 3 -window_type hamming
  53. $ESTDIR/bin/sigfilter /tmp/tmp$$.wav -o lpc/$fname.res -otype nist -lpcfilter lpc/$fname.lpc -inv_filter
  54. rm /tmp/tmp$$.wav
  55. done