Giter Site home page Giter Site logo

egg's Introduction

EGG: tools for electroglottographic analysis

This repository hosts scripts for analysis of the electroglottographic signal, and data samples.

1) a gallery of signals exemplifying different types of glottalization (work in progress)

See this folder. This strand of work is linked to the project of devising new scripts for the detection and characterization of various phonetic subtypes of glottalization.

2) peakdet_inter: a tool for semi-automatic analysis of electroglottographic signals

peakdet is a script for analyzing electroglottographic signals based on the detection of positive and negative peaks on the derivative of the EGG signal.

Average curve of fundamental frequency for the High, Mid and Low tone of the Naxi language

An earlier version of peakdet is hosted

The version available in the present repository has an interface for visual verification of the results token by token. This script is now called peakdet_inter to distinguish it from the core function, peakdet. The version proposed here has:

  • an improved front-end (but you can still choose to view the results with the same colour theme as in version 1.0 if you prefer)
  • an improved back-end: improvements to the main analysis algorithms.

Praat users are advised to try out James Kirby's praatdet or Cédric Gendrot's oq1praat.

3) a script for visualizing average curves for sets of tokens: aver

See this folder.

About the language

Currently the scripts are in Matlab. They work on Matlab 5 and later versions. The current version of peakdet_inter uses the function audioread to open WAV files (electroglottographic signals are handled like audio signals); this function was introduced in R2012b. If you use an earlier version of Matlab, simply revert to the older function: wavread.

For a complete overhaul in future, adopting Julia would seem the way to go, for three main reasons:

  • Julia is open source, and "when students are trained on open source software, they learn skills that are not hostage to a particular company or product, and can stay with them through their professional careers" (Viral Shah, from an interview with Analytics India Magazine).
  • Among open source languages, Julia is legible, and thus much better than Perl (typical 'write-only' language) or Python. It is also 'cleaner' than R.
  • Julia handles Unicode (which is absolutely essential for linguists, phoneticians...) whereas Matlab does not. If you would be interested in adopting Julia, please let us know (for instance by opening an Issue) and we will consider re-programming peakdet_inter in this language.

egg's People

Contributors

alexis-michaud avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

egg's Issues

Display detection of glottal opening peaks: a support for verification of Oq

The glottal opening peaks which estimated by different methods should be indicated in figure 3 (DEGG signal). It would be easier and faster for user to decide which method is the most reliable, and which opening peaks are detected wrongly (hence, they could be suppress).
Under each opening peak is detected by one method, a marker should be located there, corresponding to that method (an orange square for detection by maxima on smooth DEGG signal, for example).

Warning and automatically resume for step of Oq suppression

After suppressing some final cycles which normally don't possess precise opening peaks, because it is not displayed in figures of EGG and DEGG signal (only in figure of f0 and Oq), I often forget and try to exclude those cycles's Oq values. As a result, it crashes and stops the loop. Therefore, a warning and automatically resume for this step would be better for user.

Re-run the loop for the current token

Sometimes, I run into some mistakes that I would like to re-run the loop at the beginning (or at the current step) for the current token. For instance, by mistake I suppress a wrong opening peak. So far there is no other solution that I have to stop the loop and resume it. It isn't conviennient for users and they might make a big mistake when resume Peakdet (as my experience). It will be better if in each verification step (f0 & Oq) there is one more choice for running back the current token if the user doesn't satisfy with what they has just done.

Merge closing result in detection of spurious cycles

Here is a case where the speaker's voice is hoarse (he clears his throat immediately afterwards)

AExtremlyLongCycle_M14_3502_EGG
AExtremlyLongCycle_M14_3502_DEGG
In this case, PeakDet detected erroneously a spurious cycle. In fact, the 16th cycle is a part of an extremly long glottal cycle with triple closing peaks, which last from 16th cycle to 17th cycle.
As a result, it leads to an unreasonale curve of f0 values with two spurious values.
AExtremlyLongCycle_M14_3502_F0 Oq
In order to deal with cases like this, Peakdet should implement a solution to merge spurious cycles.

Source: Muong data, speaker M14, token 3501, syllable /kiɛŋ4/ 'wing'
Audio file: https://www.dropbox.com/s/eo7lawj9c8be160/AExtremlyLongCycle_M14_3502_Audio.wav?dl=0

Dealing with erroneous detection because of hill-peak pattern of opening phase

The folowing figures show signals of a glottalized tone
Method_PeakDet_OP_Hill-Peak_ErroneousDetection_M11_1001_EGG
Method_PeakDet_OP_Hill-Peak_ErroneousDetection_M11_1001_DEGG
Method_PeakDet_OP_Hill-Peak_ErroneousDetection_M11_1001_f0Oq

f0 and Oq values are extremely low because of discrete long glottal cycles. However cycles 6 and 7 are detected with unreasonable values of Oq.
Considering DEGG signal, there are two small peaks appear late in the cycles, after the hill pattern occur right from the beginning. Although these peaks are not really salient, it's more reasonable to believe they are real opening peaks. If they are detected instead of those hill patterns, we have a perfect continuous Oq curve.
Method_PeakDet_OP_Hill-Peak_ErroneousDetection_M11_1001_DEGG_Cycles6-7

Therefore, I suggest here peakdet should have a function such as manual detection opening peak to deal with this case. We can use DEGG figure to locate the position of the real peaks and indicate vectors for peakdet recalculate these cycles.

(source: syllable /rɔ4/ 'banana flower', speaker M11)
(link of audio file: https://www.dropbox.com/s/dz4ultzixkv2698/Method_PeakDet_OP_Hill-Peak_ErroneousDetection_M11_1001_sound.wav?dl=0)

Handling multiple closing peaks: displaying a command to change the method

Like the opening peaks, the closing peak can be imprecise and there are various different types which shouldn't be treated by the same method. Therefore, in the part that peakdet asks for user's verification of f0 (besides resetting the threshold, or suppressing the initial or final cycles), the choice of selecting other method to handle multiple peaks shoud be offered here.
User can type >>0 for 'selecting the highest among the peaks'; >>1 for 'selecting the first peak', etc.
The f0 and oq values after that will be re-caculated according to the new method which is more suitable.

Dealing with 'hill pattern' glottal cycles inside a fully voiced rhyme

image
Peakdet can't detect the five glottal cycles in the middle of a rhyme where the intensity of voicing decreases abruptly, as in the above figure. The five small cycles are all contained inside the 7th detected cycle. This leads to a spurious f0 value, as if there were no succession of glottis openings and closures in the whole interval.
The reason is that as can be seen on the DEGG signal, there are no precise peaks for these small cycles. The oscillations take place between two clear closing peaks. They have a 'hill pattern', like the one found at soft offset of voicing (see issue #1 ).
Method_PeakDet_PetitPeaks_M14_1541_DEGG
As a consequence, the f0 curve is unreasonable with a spurious f0 value which is extremely low (under 30 Hz) whereas all other values are above 120 Hz. If one only looked at the results of peakdet, without referring to the audio, EGG and DEGG signals, this could easily be mistaken for a case of glottalization.
Method_PeakDet_PetitPeaks_M14_1541_f0Oq

How to deal with this? Here is a suggestion for a solution.

It is not a signal error (artefact): in view of the audio, it seems clear that something really happens in the larynx such as a change of phonation mechanism (from m1 to m2: 'chest voice' to 'head voice'), maybe also with some movement of the whole larynx. Although there are no precise peaks for both closing and opening, the electroglottograph still captures this phenomenon: four small oscillations, which probably correspond to five glottal cycles.
Therefore, PeakDet should implement a solution to add cycles where necessary. The user will do it roughly by looking at the signal.

PS Here is a link to the signals for this example: https://www.dropbox.com/s/yctplk9u9yrzq33/Method_PeakDet_PetitPeaks_M14_1541_audio.wav?dl=0

Label soft offset vs hard offset of voicing

Peaket only analyzes the EGG signal until the last detected glottis closure instant. It would be useful to have information about what happens after this closure: is it held (=hard offset: adduction continues) or released (=soft offset: vocal fold abduction). Here is an example of soft offset
softoffset

and an example of hard offset
hardoffset

This is not always trivial. Soft offset usually follows soft phonation (with high Oq) and hard offset follows pressed/glottalized voicing, but there are cases like this, where a hard offset occurs after soft phonation:
hardoffsetaftersoftphonation

Oq calculation: Apply different methods for distinct portions?

For the verification of f0, we can setting different thresholds for several distinct portions.
Regarding Oq calculation, the opening peaks can be also very diverse in one token.
Is that possible if PeakDet has a setting to change the method for a particular portion? And should we do it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.