Skip to content

Problem while using fft funtion in the analyticClass #101

@Pipe-Runner

Description

@Pipe-Runner

The fft funtion from the analyticClass of PSL has a fundamental issue that leads to type error

def fft(self, ya, si):
        ns = len(ya)
        if ns % 2 == 1:  # odd values of np give exceptions
            ns -= 1  # make it even
            ya = ya[:-1]
        v = np.array(ya)
        tr = abs(np.fft.fft(v)) / ns
        frq = np.fft.fftfreq(ns, si)
        x = frq.reshape(2, ns / 2)
        y = tr.reshape(2, ns / 2)
return x[0], y[0]

The 3rd last and 2nd last line of the code should be

        x = frq.reshape(2, ns // 2)
        y = tr.reshape(2, ns // 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy