diff ilot.m @ 5:084000643ad1

changed names
author danieleb@code.soundsoftware.ac.uk
date Thu, 16 Jun 2011 13:33:43 +0100
parents e23a23349e31
children e2a029a70df3
line wrap: on
line diff
--- a/ilot.m	Thu Jun 16 13:16:29 2011 +0100
+++ b/ilot.m	Thu Jun 16 13:33:43 2011 +0100
@@ -81,13 +81,18 @@
 nWindows  = length(wLength);
 sigLength = sum(wLength);
 x         = zeros(sigLength,1);
+p = 1;
 
 % first frame
 g = lappedwindow(wLength(1),tailLength,tailFunc,'first');
 h = invOrthoFun(y(1:wLength(1))); % folded ilot
 C = 1:wLength(1)-tailLength;      % central interval
 Om = wLength(1)-tailLength+(1:tailLength);  %overlapping interval (end)
-hp = invOrthoFun(y(wLength(1)+(1:wLength(2)))); % next folded ilot
+if strcmpi(orthoBasis,'mdct') && p==nWindows-1 % if mdct use idct I
+    hp = idcti(y(sum(wLength(1:end-1))+(1:wLength(end))),'I');
+else
+    hp = invOrthoFun(y(sum(wLength(1:end-1))+(1:wLength(end))));
+end
 x(C) = h(C);
 % unfold
 x(Om) = g(Om).*h(Om) + g(end:-1:end-tailLength+1).*hp(tailLength:-1:1);
@@ -127,5 +132,5 @@
 C  = sum(wLength(1:end-1))+(tailLength+1:wLength(end));
 % unfold
 x(Op) = g(tailLength+(1:tailLength)).*h(1:tailLength) - ...
-        g(tailLength:-1:1).*hm(end:-1:end-tailLength+1);
+    g(tailLength:-1:1).*hm(end:-1:end-tailLength+1);
 x(C) = h(tailLength+1:end);