LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can you segment a sound signal according to its pitch periods?

hello
 
i have found the pitch periods of a small speech signal by segmenting that sound into several constant length segments. what i want to do now is to segment again that signal according to the pitch periods i have already acquired.the output array displays voiced and unvoiced segments. 0(zero) is for unvoiced and numbered ones represent the voiced ones (pitch period). what i need to do is to segment again the sound file in the following way....unvoiced segments should be kept the same (keep their original length) ...the rest of the signal should be segmented according to the pitch periods and then to apply a windowing function of double the length for each segment .
 
how do i do that?can somebody help me on this please?i am lost
any pointers will be much appreciated
 
regards
madgreek
 
p.s i have attached my vi with the sound file.any questions you might have please feel free to ask me
Download All
0 Kudos
Message 1 of 17
(3,470 Views)

Hi Madgeek,

So it sounds like an involved process.  Can you break down the steps so that we can work out what you want the end solution to look like (sometimes breaking it down solves the problem).  Also, are you trying to do voice recognition.  If you are I would look into using the short-time fourier transform.

Brian K.
Message 2 of 17
(3,428 Views)
Hello Brian
 
The overall target for my code is to be able to do time and pitch scaling to the sound signal using the TD-PSOLA. What TD-PSOLA does is simply segmenting the input signal into pitch synchronized segments, crossfading them with each other and then changing the distance of these segments for pitch scaling or repeating/subtracting segments for time scaling.Each segment should represent a pitch period of the signal for voiced sections while for unvoiced they are set to a constant size (i.e. 512 samples).
 
What i have done up to now is to calculate the pitch periods of the signal for the voiced sections and averaged them so i dont have that many different segment sizes.
 
1) What i want to do now, is to be able to segment my signal again according to the periods i found because up to now i was using a standard size segment though out the signal.As you can see, in my output array called mean estimated periods, 0 (zero) represents unvoiced segments (since they dont have any periodicity), which i wont do any scaling to them, meaning that i will use them the way they are into my scaled signal (i.e. if the standard segment size in the beginning was 512 samples they will remain the same, just "transfer" them into the scaled signal). The rest of the elements in the mean estimated periods array represent the pitch period of the signal....these i want to use to segment my signal accordingly....(i.e. if a pitch period in a segmnt is 8 msecs long, i want the signal to be segmented at that size, instead of being segmented at 25 msecs which was the standard length up to now)
 
I dont know if i have confused you even more which i probably did Smiley Happy but please feel free to give me your comments or any questions you might have.Any help would be much appreciated
 
Kind regards
Madgreek
 
0 Kudos
Message 3 of 17
(3,424 Views)

Hi Madgeek,

I am definitly a fan of how you commented your code.  I am still a little confused about what we are trying to accomplish (you are obviously the expert when it comes to your own application).

You have data (your sound file), and you import it into your program (now it is an array).  You want to segment the data into a special way.  By segment do you break it up into multiple arrays?  You perform a special analysis so now you have what indexes or lengths of the array you want to break up.  If I am correct then good, if not can correct me?

Breaking the problem down will lead to my succcess of what your trying to do.

Brian K.
0 Kudos
Message 4 of 17
(3,412 Views)

Hello Brian

 

Yes I have my data that I import into my program. For that data I found its pitch periods which are in the array labeled mean estimated periods. Basically what this array shows is the voiced and unvoiced segments of my original data (zero for the unvoiced and the numbered ones represent the pitch period in that specific segment….NOTE…all these segments in the array are of the same size…either 384 or 448 or 512 samples long depending how you choose to run it)

 

What I want to do is…whatever segments in the mean estimated array are showed as zeroes, I want them to pass with no alteration to them to the “new signal” lets say while the rest of this “new signal” should be segmented according to the pitch periods I found.

 

I will try to give you an example with numbers if it will make it easier for you….

lets say the mean estimated array gives the values 0, 0, 0, 0,  .8, .8, .8, .8 ,.0, 0, which are in msecs, for 10 segments which represents my original data. Each segment is 20 msecs long.I want to segment again my original data and get something like this (see attachment)

 

i dont know if i made it any easier for you Brian Smiley Happy but i am really sorry that you have to bear with me.

 

kind regards

madgreek

 

 

 

0 Kudos
Message 5 of 17
(3,408 Views)

Hi Madgeek

I would make a 2D array that characterizes your segmentation.  The index would be the segment (i.e. index 0 would be segment 1 index 3 would be segment 4 and so on), the first column would be the starting position of the segment (i.e. 0, 20, 40...80, 88) and the 2nd column would be the length of the segment (i.e. 20, 20, 20,....8, 8,...).  The bonus to the 2D array is that your data does not have to be dynamically broken up.  Instead it is more like a lookup table.

You then can relate length to your Fs (sampling rate I assume) to pitch period. 

This either helped or no relation to what you are trying to do 🙂

Brian K.
0 Kudos
Message 6 of 17
(3,387 Views)
hey Brian
 
thanks for your help and time but i am looking for something different (dynamic break up) since my approach would not be always the same size. thanks though
 
regards
madgreek
0 Kudos
Message 7 of 17
(3,384 Views)
Hey Brian
 
is it possible to give me an example code for what you are talking about?
0 Kudos
Message 8 of 17
(3,376 Views)
Do you have the signal processing toolkit?? Can you point us to some websites or pdf files that descrbie what you need to accomplish??
0 Kudos
Message 9 of 17
(3,363 Views)
Hello
 
yes i have the signal processing toolkit.
                                2: http://www.etro.vub.ac.be/Research/DSSP/Publications/books/Klein_1995.pdf pages 540-546
 
the point where i am at with my code is that i was able to estimate the pitch periods of the signal. what i want to do now is to segment the signal again according to the pitch periods for voiced sections and to a standard size for the unvoiced.
 
regards
madgreek
0 Kudos
Message 10 of 17
(3,360 Views)