The code herein involves four general steps (1) saving a WAV file (or intensity file) and textGrid as text, (2) using regular expressions to strip away the metadata, (3) plotting the data using R's default plotting functions (4) taking an ungodly amount of time to align the textGrid data. This code will also deconstruct a Praat textGrid file and time align any annotations therein to the wave form or intensity curve. If you're interested in normalisation etc., feel free to contact me. The code provided in the appendix of this paper details how to normalise two wave forms and superimpose them for analysis using different colours. This method was originally developed for a paper I co-authored with Martin Kohlberger (currently in-press) to analyse nasality data. This tutorial/ guide/ code (or whatever you want to call it) details how to export sound data from Praat and plot it using R. Plot_ly(z = ~iDensity4) %>% add_surface() IDensity4=data.matrix(iDensit圓, rownames.force=NA) IDensity=kde2d(Vdata$F1, Vdata$F2, lims=c(range(Vdata$F1),range(Vdata$F2))) Then the data needs to be converted to a 'matrix'. It needs to be converted to a data frame to remove the first two unwanted columns. #Creates a density matrix from the vowel data. Vdata=read.table("%DIRECTORY%/Vowels.txt", header=T) I figure since I've already posted two vowel plotting tutorials, a third isn't necessary. There's only 7 lines of code and the MASS and PLOTLY libraries really do all the work. I'm not going to waste your time with a tutorial on this one. Interactive 3D density plots for vowel visualisation with the PLOTLY and MASS libraries
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |