ct6502 / wavelets Goto Github PK
View Code? Open in Web Editor NEWTorrence & Compo Wavelet Analysis Software
License: MIT License
Torrence & Compo Wavelet Analysis Software
License: MIT License
I suggest adding the topics wavelet
, wavelets
in the About section.
Dear Chris,
I think I may have stumbled over a minor bug in the python
function waveletFunctions.py: If you run the code on a time series of uneven
length (e.g. len(x)=101
), it returns "ValueError: operands could not be
broadcast together with shapes (101,) (100,)" as the Fourier transform f
and the daughter have different sizes. You may check this via
import numpy as np
from waveletFunctions import wavelet
x = np.random.randn(101)
dt = 1.0
w = wavelet ( x, dt )
The problem is in the construction of the wave vector k. Here, the last
entry of the kplus
vector is always omitted (kplus[0:-1]
). However, in
case of uneven length of the time series, the Fourier transform returns
no value for the Nyquist frequency and therefore the last entry of wave
vector kplus should be used as well. I found that the following lines
replacing lines 115-119 solve this problem:
#....construct wavenumber array used in transform [Eqn(5)]
kplus = np.arange(1, n/2+1)
kplus = (kplus * 2 * np.pi / (n * dt))
kminus = (-(kplus[0:(n-1)/2])[::-1])
k = np.concatenate(([0.], kplus, kminus))
Here, I simply replaced kplus[0:-1]
by kplus[0:(n-1)/2]
. The np.fix
function is actually not needed as dividing by integer automatically
takes care of rounding down.
Best regards,
Mitch
Hello, thank you very much for your contribution to enable me to use Python for wavelet analysis. I have a question that I would like to ask, and I wonder if you are comfortable answering it.
In your example data, the time granularity is seasonal, i.e. 0.25 years, and it is continuous full year data. Now I have a time series with a daily granularity, but only observations are available from 1 February to 30 November each year. There are two ways I can think of to do wavelet analysis on such data.
Dear Developers,
Thank you for your code! I have been using it for chemistry applications, it was great!
I have been using your code by customizing it for my purpose in the past using the fortran release. Since now g77 compiler has been discontinued, I would like to use gfortran to compile it. I think there might be issues with the cfftpack.f and chisqr.f libraries.
Is there any updated version that can be compiled with gfortran or some suggestion to compile the code with new compilers?
Thank you very much in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.