| 1 |
# test_Sound_to_Spectrum_resampled.praat |
| 2 |
# djmw 20220408 |
| 3 |
|
| 4 |
appendInfoLine: "test_Sound_to_Spectrum_resampled.praat" |
| 5 |
|
| 6 |
tone = Create Sound as pure tone: "3000", 1, 0, 0.02531645569620253, 44100, 3000, 0.2, 0.01, 0.01 |
| 7 |
dft = To Spectrum: "no" |
| 8 |
cog_dft = Get centre of gravity: 2.0 |
| 9 |
selectObject: tone |
| 10 |
resampled = To Spectrum (resampled): 30 |
| 11 |
cog_resampled = Get centre of gravity: 2.0 |
| 12 |
assert abs (cog_dft - cog_resampled) / cog_dft < 1e-6 |
| 13 |
removeObject: tone, dft, resampled |
| 14 |
|
| 15 |
appendInfoLine: "test_Sound_to_Spectrum_resampled.praat OK" |