| |
|
|
p.specht
| In Mikroprozessoren go digitale filter uses - in example to recognition the Tonwahl-Doppeltöne modener Telefonanlagen. in the Profan-Interpretermodus are there naturally only least Frequencies detektierbar, z.B. hereinafter 4-5 Hertz, everybody can through pressing the left Mouse button simulate can. The thing reacted then sometime time. Compiliert becomes The thing already sooner interestingly: One Drummer could so his Rhytmusgefühl train!
Window Title "Goertzel-Algorithmus, Realtime-Version"
' (D)2011 P. woodpecker, Demoware, usage on alleinige menace the Anwenders.
AppendMenuBar 10,"Linke Mouse button with ca. 5 Hz pressing. end with ESC"
Font 2:Randomize:Cls rnd(8^8)
Var p2!=6.2831853071795864769252867665590
Declare x!,x1!,x2!,s!,LM%,end%,pwr!
Var SampleFreq!=100'Hz (> 2*FrequOfInterest!)
Var FreqOfInterest!=5'Hz
var cps!=FreqOfInterest!/SampleFreq!
Var c!=2*cos(p2!*cps!)
User Messages $201,$202
SetTimer 1000/SampleFreq!
locate 5,2:Print " | "
REPEAT
WhileLoop 40
WaitInput
if (%key=2) OR (%key=27):end%=1:BREAK :Endif
If %umessage=$201
ifnot LM%=1:LM%=1:endif
ElseIf %umessage=$202
ifnot LM%=2:LM%=2:endif
EndIf
if lm%=1
'print "+";
x!= 0.5
s!=x!+c!*x1!-x2!
x2!=x1!
x1!=s!
elseif lm%=2
'print "_";
x!=-0.5
s!=x!+c!*x1!-x2!
x2!=x1!
x1!=s!
endif
Endwhile
pwr!=int(x2!*x2!+x1!*x1!-c!*x1!*x2!)
s!=0:x!=0:x1!=0:x2!=0
locate 6,2:print left$(mkstr$("#",pwr!/3)+mkstr$(" ",60-pwr!/3),60)
case pwr!>100:beep
case end%:Break
UNTIL end%
User Messages 0
beep
KillTimer
End
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/01/21 ▲ |
|
|
|