question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Confusion about how to use LPC, and the Numerical Error it gives

See original GitHub issue

Describe the bug I don’t understand what the Numerical error, input ill-conditioned?" error means in the LPC function, and I also find the documentation a bit confusing, as it doesn’t really specify how I can use the LPC function.

To Reproduce

import numpy as np
import librosa

y = np.sin(np.arange(100) * 0.1) * 0.1

y_hat = librosa.lpc(y, 16) # throws said error here

Software versions*

>>> import platform; print(platform.platform())
Windows-10-10.0.19041-SP0
>>> import sys; print("Python", sys.version)
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.17.0
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.4.1
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.7.1
>>> 
>>> librosa.show_versions()
INSTALLED VERSIONS
------------------
python: 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]

librosa: 0.7.1

audioread: 2.1.8
numpy: 1.17.0
scipy: 1.4.1
sklearn: 0.22
joblib: 0.14.1
decorator: 4.4.1
six: 1.12.0
soundfile: 0.10.3
resampy: 0.2.2
numba: 0.46.0

numpydoc: None
sphinx: None
sphinx_rtd_theme: None
sphinxcontrib.versioning: None
sphinx-gallery: None
pytest: None
pytest-mpl: None
pytest-cov: None
matplotlib: 3.1.2
presets: None

Additional context I’m trying to use LPC to resynthesize speech from a given audio sample, however I struggle to understand how I should do this and how I have to use LPC in general. From what I understand from here: https://www.fon.hum.uva.nl/rob/VocalTractExamples/ It’s possible to use LPC to get the filter coefficients for source-filter synthesis, which is what I’m tying to do.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:26 (19 by maintainers)

github_iconTop GitHub Comments

3reactions
ajweisscommented, Feb 2, 2021

Incidentally, it’s long been on my todo list to put together an example notebook that demos source filter separation and synthesis by analysis using LPC, maybe it’s time to pick that back up…

2reactions
ajweisscommented, Oct 19, 2021

In terms of analysis, I have a branch (https://github.com/ajweiss/librosa/tree/lpcspec) that implements both a short time LPC transform (windowed LPC coeffs) and also a function that then takes those coefficients and computes their spectrum. It hasn’t been touched in quite a while, but is a pretty good start (I think) on the analysis side of things. What were you thinking in terms of analysis? I’ve been thinking about dusting this off for quite some time.

I’d also be interested in collaborating on examples. In general I was considering LPC spectral analysis and perhaps a basic compression demo… What did you have in mind?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linear Predictive Coding in Python
Linear Predictive Coding (LPC) is a method for estimating the coefficients of a Source-Filter model (post) from a given data. The input consists ......
Read more >
Linear Predictive Coding is All-Pole Resonance Modeling
Linear predictive coding (LPC) is a widely used technique in audio signal processing, especially in speech signal processing. It has found particular use...
Read more >
Intermediate LPC - Chapter 3: Complex Data Types
An array is a powerful complex data type of LPC which allows you to access multiple values through a single variable. For instance,...
Read more >
Intermediate LPC manual - Department of Computer Science
Some operators and functions will even give errors if you use them with the wrong data types. For example, "a"+"b" is handled much...
Read more >
manual UM10375, aplic. note AN11229 confusing - NXP Community
Next, the minimum number of bytes to be copied to flash is 256: in case of lesser ... they would use mxli's option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found