Einzelnen Beitrag anzeigen

TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.060 Beiträge
 
Delphi 10.4 Sydney
 
#35

AW: Goertzel Algorithmus (Frequenz + Phase)

  Alt 23. Aug 2011, 21:26
http://www.scilab.org/products/scilab/download

Runterladen -> Installieren -> Öffnen
Im Menü auf 'Applications' klicken -> SciNotes

im Editorfenster folgendes eingeben:

Code:
clc
clf()

f1 = 50
f2 = 100
a1 = 3
a2 = 4
sample_rate = 1000

t = 0: 1/sample_rate : 1/8 * %pi

N = size(t,'*')
f = sample_rate * (0:(N/4))/N
n = size(f,'*')

w1 = 2 * %pi * f1
w2 = 2 * %pi * f2

y1 = a1 * sin(w1*t)
y2 = a2 * sin(w2*t)
y3 = y2 + y1

spekt = fft(y3)

ispekt = ifft(spekt)

subplot(311)
plot(t,y3);

subplot(312)
plot(f,abs(spekt(1:n)))

subplot(313)
plot(ispekt)
Abspeicheren -> auf den Play Button drücken -> Fertig!
  Mit Zitat antworten Zitat