1 function [y1]=
rs(y1,T,f2)
2 % [y2] =
rs(y1, T) resamples y1 to the target sampling rate y2
using T
3 % [y2] =
rs(y1, f1, f2) resamples y1 with f1 to the target sampling rate f2
5 % RS does not require overlap data.
7 % see also: SOPEN, SREAD, SCLOSE, MAT2SEL, SAVE2TXT, SAVE2BKR
12 % $Id:
rs.m 2202 2009-10-27 12:06:45Z schloegl $
13 % Copyright (C) 1997-2004 by Alois Schloegl
15 % This is part of the BIOSIG-toolbox http:
17 % This library is free software; you can redistribute it and/or
18 % modify it under the terms of the GNU Library General Public
19 % License as published by the Free Software Foundation; either
20 % Version 2 of the License, or (at your option) any later version.
22 % This library is distributed in the hope that it will be useful,
23 % but WITHOUT ANY WARRANTY; without even the implied warranty of
24 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 % Library General Public License
for more details.
27 % You should have received a copy of the GNU Library General Public
28 % License along with
this library;
if not, write to the
29 % Free Software Foundation, Inc., 59 Temple Place - Suite 330,
30 % Boston, MA 02111-1307, USA.
40 y2=zeros(yr*f2/f1,yc);
42 y2(k+1,:)=sum(y1(k*D+(1:D),:),1)/D;
46 y1=y1(ceil((1:size(y1,1)*f2/f1)/f2*f1),:);
56 y2=zeros(yr*f2/f1,yc);
58 y2(k*f2+(1:f2),:)=T
'*y1(k*f1+(1:f1),:);