From 018b0df9c93cb8907f34d028f16a9000f876f66a Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jmvalin@jmvalin.ca>
Date: Tue, 6 Sep 2011 08:03:38 -0400
Subject: [PATCH] Rotation wip

---
 doc/build_draft.sh            |  3 ++-
 doc/draft-ietf-codec-opus.xml | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/doc/build_draft.sh b/doc/build_draft.sh
index 276ef5abc..cbf14a42e 100755
--- a/doc/build_draft.sh
+++ b/doc/build_draft.sh
@@ -45,5 +45,6 @@ echo '</artwork>' >> opus_compare_escaped.c
 echo '</figure>' >> opus_compare_escaped.c
 
 echo running xml2rfc
+xml2rfc draft-ietf-codec-opus.xml draft-ietf-codec-opus.html &
 xml2rfc draft-ietf-codec-opus.xml
-xml2rfc draft-ietf-codec-opus.xml draft-ietf-codec-opus.html
+wait
diff --git a/doc/draft-ietf-codec-opus.xml b/doc/draft-ietf-codec-opus.xml
index bcb81a32f..f56bf5f16 100644
--- a/doc/draft-ietf-codec-opus.xml
+++ b/doc/draft-ietf-codec-opus.xml
@@ -4291,16 +4291,27 @@ the value of the "spread" parameter in the bit-stream.
 The rotation angle is then calculated as
 <figure align="center">
 <artwork align="center"><![CDATA[
-        pi *  g_r^2
-theta = -----------
+                 2
+        pi *  g_r
+theta = ----------
             4
 ]]></artwork>
 </figure>
+A 2-D rotation R(i,j) between points x_i and x_j is defined as:
+<figure align="center">
+<artwork align="center"><![CDATA[
+x_i' =  cos(theta)*x_i + sin(theta)*x_j
+x_j' = -sin(theta)*x_i + cos(theta)*x_j
+]]></artwork>
+</figure>
 
+An N-D rotation is then achieved by applying a series of 2-D rotations back and forth, in the
+following order: R(x_1, x_2), R(x_2, x_3), ..., R(x_N-2, X_N-1), R(x_N-1, X_N),
+R(x_N-2, X_N-1), ..., R(x_1, x_2).
 </t>
 
 <t>
- If the decoded vector represents more
+If the decoded vector represents more
 than one time block, then the following process is applied separately on each time block.
 </t>
 </section>
-- 
GitLab