Dypsa Algorithm

Dypsa Algorithm is a common algorithm used in speech signal processing using Matlab. Its part of the Voicebox toolbox that’s available online for free. You can download it here!. Download the Zip file or click here to download the zip file anyway. The Zip file contains a whole lot of other Algorithms along with dypsa. Install the toolbox by setting the path to it or if you don’t know how to do that just paste all the codes or dypsa.m file alone(if you are going to use dypsa alone) in the current working directory. That should do the trick

What Dypsa does.

Basically what Dypsa does is, It extracts the Glottal Closure Instants(GCI) and the Glottal Opening Instants(GOI) form the speech signal that you provide it. So you would get two matrices one corresponding to the GCI and one corresponding to the GOI if you run a wav file through dypsa algorithm. These matrices will contain the locations, or the sample numbers, of the places of the glottal closure and opening instants. I will provide you a small piece of code incase you need an example of how to use it.

Glottal Closure and Opening Instants.

So what are these instants. Every time you produce a sound (a voiced sound), your glottis flaps. There is an instant where it is closed and there is an instant where it is open. If you take into account one of these instants, either the closure or the opening instants, you will get an idea of the pitch of the speaker. The distance between two successive samples is the Pitch Period, and the from this you can find out the pitch contour (which I don’t want to confuse you with, here).

How these instants can be related to pitch?, is a good question, which again I do not want to post here in the same blog.


Although Dypsa algorithm can find out the GCI and the GOI of the speech signal. It also gives us some values at the unvoiced portion of the speech too. This particular point about dypsa should be noted. Because for a lot of applications it would be a negative aspect.


clear all;
close all;
[input,Fs] = wavread(‘tapestry’);
[gci, goi] = dypsa(input, Fs);
impulseC(gci) = 1;
impulseO(goi)= 1;
subplot(3,1,1),plot(input((6500:8500),1)),title(‘Voiced Segment of thee Input signal’),axis(‘tight’);
subplot(3,1,2),plot(impulseCT((6500:8500),1),’r’),title(‘Impulse Signal, based on GCI’),axis(‘tight’);
subplot(3,1,3),plot(impulseOT((6500:8500),1),’b’),title(‘Impulse Signal, based on GOI’),axis(‘tight’);

What I’ve done here is that, I’ve read the wave file and stored it in input and ive given it to dypsa which will give me the gci and goi in line 4. Since dypsa only gives the locations of the gci and goi I’ve converted it to impulses so that you can see it when you plot it.

In order to read a wavefile, put the wave file in your working directory.

Doubts are welcome.

Thanks for reading.



3 thoughts on “Dypsa Algorithm

    • Just replying from my phone here without any verification of what I’m going to comment. But the distance between the gci or goi is the pitch period, measured in samples. If you want it in seconds. Just divide it by the sampling rate of your wave signal. Usually they talk about pitch in terms of frequency. Then it’s 1 over the pitch period that you just measured.

  1. How to compare the reference GCI with estimated GCI.
    By using following parameters.
    IDR: Identification rate.
    MR: Missing Rate
    FA: False alarm rate etc.

    Can you give an idea how to compare the both it will be helpful for me. I read somewhere they use term like “Histograms of the GCI timing error” what is this?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s