Git Product home page Git Product logo

Comments (1)

YannickJadoul avatar YannickJadoul commented on July 17, 2024

Yes, but there's indeed no API reference for this, because there is no Python API, yet.

Until I add this (or someone else does; help welcome ;-) ), you can go through parselmouth.praat.call:

>>> import parselmouth
>>> s = parselmouth.Sound("the_north_wind_and_the_sun.wav")
>>> lpc = parselmouth.praat.call(s, "To LPC (autocorrelation)", 16, 0.025, 0.005, 50.0)
>>> lpc
<parselmouth.Data object at 0x7f4f3f5d3c00>
>>> lpc.class_name
'LPC'
>>> print(lpc)
Object type: LPC
Object name: untitled
Date: Thu Nov 22 11:38:48 2018

Time domain: 0 to 1.283265306122449 (s).
Prediction order: 16
Number of frames: 247
Time step: 0.005 (s).
First frame at: 0.026632653061224473 (s).

As you can see, the Python type of lpc is parselmouth.Data (so it does not have a lot of methods), but the actual underlying Praat type is "LPC", which means you can use it in further calls to parselmouth.praat.call until you get a more useful object or the values you're interested in. For example, you could:

>>> parselmouth.praat.call(lpc, "Get number of coefficients", 1)
16

Or to get all raw values (consult the Praat documentation to see what these actually mean!), you could:

>>> lpc_matrix = parselmouth.praat.call(lpc, "Down to Matrix (lpc)")
>>> lpc_matrix
<parselmouth.Matrix object at 0x7f4f3f5eac00>
>>> lpc_matrix.values
array([[ 0.12599566,  0.12089129,  0.1061873 , ..., -1.19781365,
        -1.14358651, -1.1659433 ],
       [ 0.51795006,  0.46722564,  0.51150008, ...,  1.14546318,
         1.09264874,  1.14384542],
       [-0.01884895,  0.02674646,  0.04591352, ..., -1.38964444,
        -1.42701829, -1.50292197],
       ...,
       [-0.01957717, -0.00318544, -0.09061003, ...,  0.46313035,
         0.41949584,  0.54231048],
       [-0.06745527, -0.0395186 , -0.03539812, ..., -0.2470586 ,
        -0.23618874, -0.33601743],
       [-0.01429427,  0.00990911, -0.02896412, ...,  0.05589769,
         0.06509704,  0.10742232]])
>>> lpc_matrix.values.shape
(16, 247)

I'll have a look how much work it would be to port LPC to the Python API, and see if I can maybe find some time within the next few months, so you can leave this issue open for now.

from parselmouth.

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.