Git Product home page Git Product logo

Comments (4)

grlee77 avatar grlee77 commented on July 17, 2024

I am +1 on @aaren's TransformResult.array method. I am not sure having a class is of much utility for a simple 1D DWT, but I guess if we go that route for the 2D or nD functions it may make sense to just have all functions return a TransformResult for consistency.

@ThomasA
I also have utility functions to convert to and from the array format, but mine is currently configured for the coefficients as returned by the wavedecn function proposed in PR #52 . I have not made those functions part of a PR yet because they are likely not robust to all wavelets / array sizes as is, but I have used it for 2D and 3D with 'haar' and some of the other 'db*' wavelets successfully.

from pywt.

rgommers avatar rgommers commented on July 17, 2024
  • Transform that is approximate in the first dimension, detail in the second
  • Transform that is at the first level approximate in the first dimension, detail in the second, then at the second level detail at the first dimension and detail in the second

I'm not quite sure that I see the problem with these examples. If you know that that's how your transform behaves, you can create the proper output class to put the approximation coefficients for both levels in an approx attribute right?

from pywt.

kwohlfahrt avatar kwohlfahrt commented on July 17, 2024

I don't see how an approx attribute will work for the multidimensional case. To specify the transform, it needs to know whether it is approximate or detail in every dimension, since each dimension is independent. Then that needs to happen at every level. So if I have the transform of a 2D signal, does an approx attribute refer to something that's approximate in the first dimension, the second, both, or any of them?

from pywt.

grlee77 avatar grlee77 commented on July 17, 2024

I think the TransformResult object should also have a copy of the original shape prior to the transformation. This way problems like the example below could be automatically fixed by truncation to the original shape.

example of current behaviour:

a = np.arange(7)
cA, cD = pywt.dwt(a, 'haar')
a_roundtrip = pywt.idwt(cA, cD, 'haar')

output:
a_roundtrip = array([ 0. 1. 2. 3. 4. 5. 6. 6.]) (duplicate last element)

from pywt.

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.