view signals/@sigresample/sigresample.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
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