0

I have a specgram plotted via the matplotlib library. Everything looks great with it. However, I found myself wanting to overlay formant points on top of the specgram, the same as can be done in Praat (in the spectrogram, under Formant [menu] -> Show Formants).

Looking around at the documentation, I see no information about formants. Searching online, here and elsewhere, I am not seeing anything promising. I doubt I am the first to desire this functionality, so I am hoping someone can point me in the right direction or provide an example.

To give you a quick idea of what I am referring to, here is a Praat spectrogram without formants plotted: No formants in Praat

and here is a spectrogram with the formants plotted: Formants in Praat

whatisit
  • 219
  • 3
  • 12
  • Matplotlib is a general plotting library in contrast to Praat which is specialized for phonetics. If you want to overlay formant points you can do so with a scatter plot. However, you will have to obtain these points by either computing them yourself or finding a Python library that does it for you. – MB-F Feb 14 '17 at 10:22
  • In case someone is wondering like me what a formant would be, I just read the [wikipedia article](https://en.wikipedia.org/wiki/Formant) about it: "[...] in phonetics, formant can mean either a resonance or the spectral maximum that the resonance produces." – ImportanceOfBeingErnest Feb 14 '17 at 16:52
  • @kazemakase Yes, I thought there was a possibility this might be required, although I was hoping some functionality existed already. I don't mind doing it, but I'm also not entirely sure how to get formants points from the audio data. I'll look around today for it, but if anyone can point me in the right direction, that would be awesome! – whatisit Feb 14 '17 at 23:04
  • @whatisit I doubt you will be lucky enough to find somebody who can point you in the right direction, here. This is a programmer's forum and as the previous comment has shown, formants are not general knowledge for the people mainly using this site :) There is a [Signal Processing Stack Exchange site](http://dsp.stackexchange.com/) where you might be more lucky. – MB-F Feb 15 '17 at 07:02
  • @kazemakase thank you for the suggestion. Sorry for such a delay. I actually ended up finding something that was largely pre-written which makes use of Praat's SendPraat methods to interface with the Praat executable. I needed to rewrite a bunch of portions of it (didn't work in Python 3.5, plus seemed to not work properly with certain Praat file encodings), and I'm not entirely sure how to include everything here for an answer (several .py files, some are fairly long). Anyway, I'll try to piece together the minimum code required and include it here shortly. – whatisit Mar 06 '17 at 05:15
  • @whatisit good to hear you found a solution! – MB-F Mar 06 '17 at 07:34

0 Answers0