/lib/Aubt/aubt_getRWaves.m

http://siento.googlecode.com/ · MATLAB · 32 lines · 10 code · 3 blank · 19 comment · 2 complexity · a261e993b44721ae4bfd2aab4f572e57 MD5 · raw file

  1. function data_ = aubt_getRWaves (data, hz)
  2. % Expects an ecg-signal as input and looks for
  3. % its r-waves. The output is a pulse signal
  4. % with 1 indicating a r-wave and 0 otherwise.
  5. %
  6. % For detailed information about the detection of the r-wave
  7. % please see 'aubt_detecR'.
  8. %
  9. % data_ = aubt_getRWaves (data, hz)
  10. %
  11. % input:
  12. % data: an ecg-signal
  13. % hz: sample rate
  14. % wtyp: name of the wavelet function (default = 'haar')
  15. % order: order of the decomposition (default = 1)
  16. %
  17. % output:
  18. % data_: a pulse signal
  19. %
  20. % 2005, Johannes Wagner <go.joe@gmx.de>
  21. if nargin < 3 | isempty (wtyp)
  22. wtyp = 'haar';
  23. end
  24. if nargin < 4 | isempty (order)
  25. order = 1;
  26. end
  27. r = aubt_detecR (data, hz, wtyp, order);
  28. data_ = zeros (length (data), 1);
  29. data_(r) = 1;