comparison util/classes/@audio/unbuffer.m @ 166:1495bdfa13e9 danieleb

Updated grassmanian function (restored old computation of the dictionary) and added functions to the audio class
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Mon, 19 Sep 2011 14:53:23 +0100
parents
children
comparison
equal deleted inserted replaced
162:88578ec2f94a 166:1495bdfa13e9
1 function s = unbuffer(obj)
2
3 %% Check inputs and Defaults
4 if ~isprop(obj,'bufferOperator') || isempty(obj.bufferOperator)
5 error('You must buffer a signal before unbuffer it, come on!');
6 end
7
8 switch lower(obj.bufferOperator.method)
9 %Unbuffer using overlap-add method
10 case 'standard'
11 w = obj.bufferOperator.window(obj.bufferOperator.wLength);
12 S = diag(1./w)*obj.S;
13 %Non overlapping case
14 if obj.bufferOperator.overlap == 0
15 s = S(:);
16 %Overlapping case
17 else
18 Stemp = S(1:obj.bufferOperator.wLength-obj.bufferOperator.overlap,1:end);
19 s = [Stemp(:); S(obj.bufferOperator.wLength-obj.bufferOperator.overlap+1:end,end)];
20 end
21 %Unbuffer using inverse lot with identity local transform
22 case 'lot'
23 s = ilot(obj.S(:),obj.bufferOperator.wLength,'id',...
24 obj.bufferOperator.overlap,obj.bufferOperator.window);
25 otherwise
26 error('Please specify a valid buffer method');
27 end