Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (25 sloc) 778 Bytes
% Definition Konstanten
nu0 = 200;
dt = 1/(44.1e3);
% Definition der Funktion und Inputparameter für DFT
f = @(t) sin(2*pi*nu0*t) + 0.5*sin(2*pi*4*nu0*t)+...
0.8*cos(2*pi*2*nu0*t) + 0.4*cos(2*pi*12*nu0*t);
ti = 0:dt:0.005;
fi = f(ti);
[kp Ak Bk] = DFT(ti, fi);
% Plot des Power Spektrums und der Funktion
n = floor(length(fi)/2);
T = ti(2*n)-ti(1);
nui = kp/T;
pow = 1/4*(Ak.^2+Bk.^2)/n;
figure(1)
plot(ti, fi, ti, fi, 'bo'), legend('Kontinuierliches Signal ', 'Gesampletes Signal')
figure(2)
plot(nui, pow), xlim([0 3000]), xlabel('Frequenz [Hz]'), ylabel('Power')
% Plot der Koeffizienten
figure(3)
stem(nui, Ak, 'bo'), xlabel('Frequenz [Hz]'), ylabel('A_k')
xlim([0 3000])
figure(4)
stem(nui, Bk, 'bo'), xlabel('Frequenz [Hz]'), ylabel('B_k')
xlim([0 3000])
You can’t perform that action at this time.