Code Monkey home page Code Monkey logo

Comments (2)

jcvasquezc avatar jcvasquezc commented on July 22, 2024

Hi @ASR2020Guru

You are right on the fact that a zero padding is not the right way to combine those features

There are two reasons why you are getting different lengths for the phonation and fbank features

  1. Phonation features are only computed for speech segments where there is F0 values, i.e., only for voiced segments

Check the code in

for l in range(nF):
as follows, which only add feature vectors when f0!=0

for l in range(nF):
    data_frame=data_audio[int(l*size_stepS):int(l*size_stepS+size_frameS)]
    energy=10*logEnergy(data_frame)
    if F0[l]!=0:
        Amp.append(np.max(np.abs(data_frame)))
        logE.append(energy)
        if lnz>=12: 
            amp_arr=np.asarray([Amp[j] for j in range(lnz-12, lnz)])
            #print(amp_arr)
            apq.append(APQ(amp_arr))
        if lnz>=6: # TODO:
            f0arr=np.asarray([F0nz[j] for j in range(lnz-6, lnz)])
            ppq.append(PPQ(1/f0arr))
        lnz=lnz+1

In case you want to combine the features you should add an else: statement and add zero values to variables Amp, logE, apq, and ppq

  1. In addition, you should consider that apq is only computed after the 12th frame because it is a log-term perturbation with respect to the 11th previous frames, thus they have to padd 11 zeros at the beginning for this feature.

  2. The same ocurrs for ppq, but in this case with the first five frames

If you add these padds at the beginning for apq and ppq you should remove this line where it considers only those frames after the 12th, in orderto properly merge apq and ppq with the rest of the features

feat_mat=np.vstack((DF0[11:], DDF0[10:], Jitter[12:], Shimmer[12:], apq, ppq[6:], logE[12:])).T

If you have further questions, let me know and I can help you

from disvoice.

ASR2020Guru avatar ASR2020Guru commented on July 22, 2024

Hi @jcvasquezc ,

Thanks for your quick and helpful reply.

Now I managed to combine these features correctly.

I will let you know if I have any further questions.

Cheers

from disvoice.

Related Issues (20)

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.