-
Notifications
You must be signed in to change notification settings - Fork 36
/
band_filterer.praat
57 lines (44 loc) · 1.36 KB
/
band_filterer.praat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Band-Filterer
# Will Styler - 2017
#
# This Praat script will create band-filtered stimuli for prosodic studies
form Normalize Amplitude in sound files
comment Sound file extension:
optionmenu file_type: 2
option .aiff
option .wav
endform
directory$ = chooseDirectory$ ("Choose the directory containing sound files and textgrids")
directory$ = "'directory$'" + "/"
Create Strings as file list... list 'directory$'*'file_type$'
number_files = Get number of strings
for ifile to number_files
select Strings list
sound$ = Get string... ifile
Read from file... 'directory$''sound$'
objectname$ = selected$ ("Sound")
# Bandpass at 400 Hz
select Sound 'objectname$'
Filter (pass Hann band): 0, 400, 50
Scale intensity... 70
Write to WAV file... 'directory$''objectname$'_bp400.wav
Remove
# Gammatone filtered, after Holman (2016), Vicenik & Sundara (2013)
select Sound 'objectname$'
Filter (gammatone): 200, 150
Scale intensity... 70
Write to WAV file... 'directory$''objectname$'_gamma_200_150.wav
Remove
select Sound 'objectname$'
Filter (gammatone): 250, 150
Scale intensity... 70
Write to WAV file... 'directory$''objectname$'_gamma_250_150.wav
Remove
select Sound 'objectname$'
Filter (gammatone): 350, 150
Scale intensity... 70
Write to WAV file... 'directory$''objectname$'_gamma_350_150.wav
Remove
endfor
select Strings list
Remove