"R.G. Stockwell" <noemail@please.com> wrote in message
news:ARtXa.15$%h.12100@news.uswest.net...
>
...> That would work nicely with my policy of making all variable names from
> different
> lengths of the underline character, eg
> IDL> __ = 8*4
> IDL> _____ = __^2
>
> IDL> help, _____ , __
> _____ INT = 1024
> __ INT = 32
>
Weeeheee fun. Check out this S-Transform code (save as s_trans_lines.pro):
IDL> .run s_transf_lines
Cheers,
bob
; The S transform function
; written by bob stockwell
FUNCTION ________________, _, ___
__ = 2
if ___ ne 0.0 then ____ = _/(__*!dPI*___)
_____ = dblarr(_)
______ = dindgen(_)
_______ = (______ - _/__)^__/(__*____[0]^__)
________ = where(_______ lt 25)
_____(________) = exp(-_______(________))
_____ = shift(_____,-_/__)
return, dcomplex(_____,0)
end
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
; the S Transform function
FUNCTION s_trans_lines, _, __
sz = size(_)
___ = n_elements(_)
____ = ___/2
_____ = dcomplexarr(___)
______ = dcomplexarr(___)
_______ = fft(_,-1)
________ = 0
_________ = ____
__________ = 1
___________ = floor((_________ - ________ )/__________)+1
if n_elements(__) eq 1 then begin
__ = dblarr(___________)+__
endif
if n_elements(__) ne ___________ then begin
__ = dblarr(___________)+__(0)
endif
_________________ = where(__ eq 0, __________________)
if __________________ gt 0 then begin
Message,strcompress('Invalid __ Array. __ has a value of zero!')
endif
____________ = dcomplexarr(___,___________)
_______ = shift(_______,-________)
if ________ eq 0 then begin
______ = dblarr(___)
______(0) = 1
____________(*,0) = fft(_______*______,1)
endif else begin
_____________ = double(________)
______________ = __(0) * ___/_____________
______ = ________________(___,______________)
_____ = _______ * ______
____________(*,0) = fft(_____,1)
endelse
for _______________ = 1d,___________-1 do begin
_____________ = float(________) + _______________*__________
______________ = __(_______________) * ___/_____________
______ = ________________(___,______________)
_______ = shift(_______,-__________)
_____ = _______ * ______
____________(*,_______________) = fft(_____,1)
endfor
return, ____________
end ; end of function
;*****************************************************
; MAIN LEVEL EXAMPLE CODE BELOW
;*****************************************************
randm =randomn(seed,74)
ts = complex(randm,randomn(seed,74)+3*sin(findgen(74)))+1
ts = fltarr(74)
ti = 2*!dpi*12./74*findgen(74)+0.7
ts = 10*cos(ti)+randomn(Seed,74)
ts(22) = 12
factor = (findgen(38)+1)/38*4
a = s_trans_lines(ts,factor)
!P.multi=[0,1,2]
plot,ts,xtitle='Time'
oplot,imaginary(ts),linestyle=1
contour,abs(a),/fill,nlevels=14,xtitle='Time',ytitle='Freque ncy (pos)'
end
|