shared-snippets/matlab/unitutils/wavecut.m

23 lines
677 B
Mathematica
Raw Normal View History

2024-08-29 13:01:31 +02:00
%
% -----------------
% Copyright © 2022 ACK Cyfronet AGH, Poland.
% -----------------
%
2024-08-28 17:22:21 +02:00
function [wc]=wavecut(wf,startp,endp)
2024-08-29 13:11:12 +02:00
% WAVECUT Extracts a segment of a waveform
%
% [WC] = WAVECUT(WF, STARTP, ENDP) extracts a segment of the waveform WF
% starting at position STARTP and ending at position ENDP. The input
% waveform WF is assumed to be a vector. STARTP and ENDP should be
% numeric values indicating the start and end positions of the desired
% segment.
%
% Example:
% wf = sin(0:0.01:2*pi);
% segment = wavecut(wf, 50, 150);
% plot(segment);
%
% See also: other functions that process waveforms.
2024-08-28 17:22:21 +02:00
wc=wf(round(startp):round(endp));
end