Mercurial > hg > ishara
diff signals/@signal/signal.m @ 3:3f77126f7b5f
First major revision of sequence library, now using classdef form, STILL A BIT BROKEN!
author | samer |
---|---|
date | Wed, 09 Jan 2013 22:22:21 +0000 |
parents | 289445d368a7 |
children | 62e31e7980e6 |
line wrap: on
line diff
--- a/signals/@signal/signal.m Sat Dec 22 16:17:51 2012 +0000 +++ b/signals/@signal/signal.m Wed Jan 09 22:22:21 2013 +0000 @@ -25,15 +25,17 @@ % } classdef signal - properties (GetAccess=private, SetAccess=immutable) + methods (Abstract) + c=channels(s) + u=construct(s) + r=rate(s) end + methods function s=signal, end function s=and(s1,s2), s=sigcat(s1,s2); end function y=cache(x), y=reclock(rate(x),sigarray(gather(x))); end - function c=channels(s), error('number of channels undefined'); end - function s=construct(sig), error('Cannot construct base signal class'); end function display(a) disp(sprintf(' %s :: signal(%s,%s)',tostring(a),fmt(channels(a)),fmt(rate(a)))); function s=fmt(x), if isnan(x), s='_'; else s=num2str(x); end; end @@ -42,7 +44,6 @@ function y=map(f,x), y=sigmap(f,x); end function s=mpower(a,b), s=resample(b,a); end function s=or(s1,s2), s=sigbinop(@vertcat,s1,s2,@plus); end - function r=rate(s), error('sampling rate undefined'); end function s2=reclock(r,s1), s2=sigreclock(r,s1); end function y=drop(n,x), y=sigdrop(n,x); end function y=take(n,x), y=sigtake(n,x); end