Source

stockwelltransform / examples / synthetic.py

Full commit
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 03 19:19:16 2011

@author: Chris Lee-Messer
"""
import numpy as np
import stockwell.smt as smt
Fs = 100
t = np.linspace(0,1.0,num=10*Fs)

twopi = 2*3.1415

# create a list of different sin waves at different frequencies
ss = [np.sin(twopi*f*t) for f in [1,2,5,10,20]]
y = np.zeros(len(t),dtype='float64')

for s in ss:  y+= s

sy = smt.st(y)
rsy = abs(sy)
sy10 = smt.st(y,0,100)
rsy10 = abs(sy10)


K=4
N=len(t)
tapers = smt.calc_tapers(K,N)
mty = smt.mtst(K, tapers, y, 0,70)

# dsplay with
# figure(); imshow(mty); axis('auto')