comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Who's up for breaking IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
obfuscated code: was Re: Who's up for breaking IDL? [message #36014 is a reply to message #35824] Mon, 04 August 2003 08:08 Go to previous messageGo to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Who's up for breaking IDL?
Next Topic: Importing data to iTool Data manager from the command line

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Dec 01 13:29:39 PST 2025

Total time taken to generate the page: 0.00283 seconds