view signals/@sigresample/sigresample.m @ 42:ae596261e75f

Various fixes and development to audio handling
author samer
date Tue, 02 Dec 2014 14:51:13 +0000
parents 289445d368a7
children
line wrap: on
line source
classdef sigresample < signal
	properties (GetAccess=private, SetAccess=immutable)
		fs
		source
		opts
	end
	methods
		function s=sigresample(fs,sig1,varargin)
			if fs==rate(sig1), sig2=sig1;
			else
				opts=prefs('bs',1024,varargin{:});
				s.source=sig1;
				s.fs=fs;
				s.opts=opts;
			end
		end

		function s=tostring(sig)
			s=sprintf('resample(%g,%s)',sig.rate,tostring(sig.source));
		end

		function c=channels(s), c=channels(s.source); end
		function r=rate(s), r=s.fs; end
	end
end