KlattSlope.praat 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # KlattSlope.praat
  2. # Paul Boersma, 25 November 2010
  3. # This script tests whether a sound created with the Klatt synthesizer
  4. # is similar to a sound created with "To Sound (phonation)".
  5. openPhase = 0.7
  6. collisionPhase = 0.03;hertzToErb(300)/35;0.03
  7. power = 3.0
  8. f1 = 250
  9. b1 = 100
  10. f2 = 3200
  11. b2 = 100
  12. duration = 0.8
  13. f0start = 150
  14. f0end = 110
  15. ;bandwidthFormula$ = "100"
  16. bandwidthFormula$ = "(formant-0.5)*1000/10"
  17. numberOfFormants = 20
  18. pitchTier = Create PitchTier... a 0 duration
  19. Add point... 0 f0start
  20. Add point... duration f0end
  21. pulses = To PointProcess
  22. sound = To Sound (phonation)... 44100 1.0 0.05 openPhase collisionPhase power power+1.0
  23. ;sound = To Sound (pulse train)... 44100 1.0 0.05 2000
  24. Filter with one formant (in-line)... f1 b1
  25. Filter with one formant (in-line)... f2 b2
  26. for formant from 3 to numberOfFormants
  27. Filter with one formant (in-line)... (formant-0.5)*1000 'bandwidthFormula$'
  28. endfor
  29. spectrum = To Spectrum... yes
  30. slope1 = Get band density difference... 0 1000 2000 4000
  31. echo 'slope1:6' dB
  32. removeObject: pitchTier, pulses, sound, spectrum
  33. klatt = Create KlattGrid... a 0 duration numberOfFormants 0 0 0 0 0 0
  34. Add voicing amplitude point... 0 90.0
  35. Add pitch point... 0 f0start
  36. Add pitch point... duration f0end
  37. Add power1 point... 0 power
  38. Add power2 point... 0 power+1.0
  39. Add open phase point... 0 openPhase
  40. Add collision phase point... 0 collisionPhase
  41. Add oral formant frequency point... 1 0 f1
  42. Add oral formant bandwidth point... 1 0 b1
  43. Add oral formant frequency point... 2 0 f2
  44. Add oral formant bandwidth point... 2 0 b2
  45. for formant from 3 to numberOfFormants
  46. Add oral formant frequency point... formant 0 (formant-0.5)*1000
  47. Add oral formant bandwidth point... formant 0 'bandwidthFormula$'
  48. endfor
  49. ;To Sound (special)... 0 0 44100 yes yes yes yes yes yes "Powers in tiers" yes yes yes Cascade 1 numberOfFormants 1 1 0 0 0 0 0 0 0 0 0 0 0 0 yes
  50. To Sound
  51. To Spectrum... yes
  52. slope2 = Get band density difference... 0 1000 2000 4000
  53. printline 'slope2:6' dB
  54. removeObject: klatt, "Sound a", "Spectrum a"