Ingeniero

Páginas: 2 (313 palabras) Publicado: 26 de noviembre de 2012
%# load ecg: simulate noisy ECG
Fs=500;
x = repmat(ecg(Fs), 1, 8);
x = x + randn(1,length(x)).*0.18;

%# plotnoisy signal
figure
subplot(911), plot(x), set(gca, 'YLim', [-1 1], 'xtick',[])
title('noisy')

%# sgolay filterframe = 15;
degree = 0;
y = sgolayfilt(x, degree, frame);
subplot(912), plot(y), set(gca, 'YLim', [-1 1], 'xtick',[])title('sgolayfilt')

%# smooth
window = 30;
%#y = smooth(x, window, 'moving');
%#y = smooth(x, window/length(x),'sgolay', 2);
y = smooth(x, window/length(x), 'rloess');
subplot(913), plot(y), set(gca, 'YLim', [-1 1], 'xtick',[])
title('smooth')%# moving average filter
window = 15;
h = ones(window,1)/window;
y = filter(h, 1, x);
subplot(914), plot(y), set(gca,'YLim', [-1 1], 'xtick',[])
title('moving average')

%# moving weighted window
window = 7;
h =gausswin(2*window+1)./window;
y = zeros(size(x));
for i=1:length(x)
for j=-window:window;
if j>-i && j<(length(x)-i+1)%#y(i) = y(i) + x(i+j) * (1-(j/window)^2)/window;
y(i) = y(i) + x(i+j) * h(j+window+1);
end
end
endsubplot(915), plot( y ), set(gca, 'YLim', [-1 1], 'xtick',[])
title('weighted window')

%# gaussian
window = 7;...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS