English
Source / code snippets

Digitales Frequenzfilter: The Görtzel-Algorithmus

 

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 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/01/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

597 Views

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie