semestralka a praca na nej
This commit is contained in:
@@ -9,13 +9,24 @@ data = int16(str2double(nums));
|
|||||||
|
|
||||||
X = DFT_priama(double(data))
|
X = DFT_priama(double(data))
|
||||||
n = length(X)
|
n = length(X)
|
||||||
freq = (0:n-1)/n
|
Fs = 200;
|
||||||
|
freq = (0:n-1)*Fs/n
|
||||||
|
|
||||||
figure;
|
figure;
|
||||||
plot(double(data));
|
plot(double(data));
|
||||||
figure;
|
figure;
|
||||||
plot(freq, X)
|
plot(freq, X)
|
||||||
figure;
|
figure;
|
||||||
|
x = double(data);
|
||||||
|
x = x - mean(x);
|
||||||
|
plot(x); % centrovane data
|
||||||
|
figure;
|
||||||
plot(freq, abs(X))
|
plot(freq, abs(X))
|
||||||
figure;
|
figure;
|
||||||
plot(freq, angle(X))
|
plot(freq, angle(X))
|
||||||
|
|
||||||
|
magX = abs(X);
|
||||||
|
[pks, locs] = findpeaks(magX, 'NPeaks', 6, 'SortStr', 'descend');
|
||||||
|
|
||||||
|
f0 = freq(locs);
|
||||||
|
disp(f0);
|
||||||
|
|||||||
Reference in New Issue
Block a user