Detecting and Quantifying T-Wave Alternans: The PhysioNet/Computing in Cardiology Challenge 2008 1.0.0
(536 bytes)
function lombtest
p = 1;
close all hidden
len = 128;
x = [];
t = [];
y=zeros(1,len);
for i = 1:len
y(i) = (-1)^i * 10;
if (rand < p)
t(length(t) + 1) = i;
x(length(x) + 1) = (-1)^i * 10;
end;
end;
disp(['пропущенных точек ' num2str(128 - length(t))]);
fs = 250;
freq = [0:1:floor(fs / 2)]/fs;
[amp prob] = lomb(t, x, freq);
plot(freq, amp);
hold on;
ampPSD = PSD(y);
slen = length(ampPSD);
plot([0:slen-1] / len, ampPSD(1:slen), 'r');
set(gca, 'XLim', [0, 0.6])