## 5 RDFT Algorithm for \(N=5\)
\begin{bmatrix}y_{0}\\ y_{1}\\ y_{2}\\ y_{2}\\ y_{1}\end{bmatrix} \mathbf{b}_{5}= \begin{bmatrix}b_{0}\\ b_{1}\\ b_{2}\\ b_{3}\\ b_{4}\end{bmatrix} = \begin{bmatrix}0\\ -y_{4}\\ -y_{3}\\ y_{3}\\ y_{4}\end{bmatrix}  \tag{41}\]  
The algorithm of the RDFT for \(N=5\), presented in Figure 3, can be described by the following matrix-vector procedure, in which the matrix \(\mathbf{R}_{5}\) has been factorized:  
\[\mathbf{y}_{5}=\mathbf{C}_{5\times 6}\bar{\mathbf{C}}_{6}\mathbf{D}_{6}\bar{ \mathbf{A}}_{6}\bar{\mathbf{A}}_{6\times 5}\  
Since \(\phi_{6}=2\pi/6\) then \(\cos 2\phi_{6}=-\cos\phi_{6}\), \(\cos 3\phi_{6}=-1\), \(\cos 4\phi_{6}=-\cos\phi_{6}\), \(\cos 5\phi_{6}=\cos\phi_{6}\), \(\cos 6\phi_{6}=1\), \(\cos 8\phi_{6}=-\cos\phi_{6}\), \(\cos 9\phi_{6}=-1\), \(\cos 10\phi_{6}=-\cos\phi_{6}\), \(\cos 12\phi_{6}=1\), \(\cos 15\phi_{6}=-1\) and \(\sin 4\phi_{6}=-\sin\phi_{6}\), \(\sin 5\phi_{6}=-\sin\phi_{6}\), \(\sin 8\phi_{6}=\sin\phi_{6}\), \(\sin 10\phi_{6}=-\sin\phi_{6}\), \(\sin 12\phi_{6}=0\), \(\sin 15\phi_{6}=0\), \(\sin 16\phi_{6}=-\sin\phi_{6}\), \(\sin 20\phi_{6}=\sin\phi_{6}\), \(\sin 25\phi_{6}=\sin\phi_{6}\), so the \(\mathbf{R}_{6}\) matrix will take the form  
\[\mathbf{R}_{6}= \begin{bmatrix}1&1&1&1&1\\ 1&\cos\phi_{6}&-\cos\phi_{6}&-1&-\cos\phi_{6}&\cos\phi_{6}\\ 1&-\cos\phi_{6}&-\cos\phi_{6}&1&-\cos\phi_{6}&-\cos\phi_{6}\\ 1&-1&1&-1&1&-1\\ 0&\sin\phi_{6}&-\sin\phi_{6}&0&\sin\phi_{6}&-\sin\phi_{6}\\ 0&\sin\phi_{6}&\sin\phi_{6}&0&-\sin\phi_{6}&-\sin\phi_{6}\end{bmatrix}  \tag{47}\]  
When we calculate the product of this matrix by the input vector \(\mathbf{x}_{6}\) we obtain  
\[ \begin{bmatrix}y_{0}\\ y_{1}\\ y_{2}\\ y_{3}\\ y_{4}\\ y_{5}\end{bmatrix} = \begin{bmatrix}(x_{0}+x_{3})+(x_{1}+x_{5})+(x_{2}+x_{4})\\ (x_{0}-x_{3})+\cos\phi_{6}[(x_{1}+x_{5})-(x_{2}+x_{4})]\\ (x_{0}+x_{3})+\cos\phi_{6}[-(x_{1}+x_{5})-(x_{2}+x_{4})]\\ (x_{0}-x_{3})-(x_{1}+x_{5})+(x_{2}+x_{4})\\ \sin\phi_{6}[(x_{1}-x_{5})-(x_{2}-x_{4})]\\ \sin\phi_{6}[(x_{1}-x_{5})+(x_{2}-x_{4})]\end{bmatrix} =\]  
\[= \begin{bmatrix}(x_{0}+x_{3})+(x_{1}+x_{5})+(x_{2}+x_{4})\\ ((\cos\phi_{6}+1)[(x_{1}+x_{5})-(x_{2}+x_{4})]+[(x_{0}-x_{3})-(x_{1}+x_{5})+( x_{2}+x_{4})]\\ (-\cos\phi_{6}-1)[(x_{1}+x_{5})+(x_{2}+x_{4})]+[(x_{0}+x_{3})+(x_{1}+x_{5})+( x_{2}+x_{4})]\\ (x_{0}-x_{3})-(x_{1}+x_{5})+(x_{2}+x_{4})\\ -\sin\phi_{6}[(x_{2}-x_{4})-(x_{1}-x_{5})]\\ \sin\phi_{6}[(x_{2}-x_{4})+(x_{1}-x_{5})]\end{bmatrix}  \tag{48}\]  
Figure 4 shows a data-flow diagram corresponding to the calculation of the output vector, where \(d_{1}=-\cos\phi_{6}-1\), \(d_{2}=\cos\phi_{6}+1\), \(d_{4}=-\sin\phi_{6}\), and \(d_{5}=\sin\phi_{6}\). When the vector \(\mathbf{z}_{6}=\mathbf{a}_{6}+i\mathbf{b}_{6}\) of complex coefficients of DFT for the real input vector \(\mathbf{x}_{6}\) is needed, it can be easily obtained from the output vector \(\mathbf{y}_{6}\) of RDFT, according to (15)  
\[\mathbf{a}_{6}= \begin{bmatrix}a_{0}\\ a_{1}\\ a_{2}\\ a_{3}\\ a_{4}\\ a_{5}\end{bmatrix} = \begin{bmatrix}y_{0}\\ y_{1}\\ y_{2}\\ y_{3}\\ y_{2}\\ y_{1}\end{bmatrix} \ \mathbf{b}_{6}= \begin{bmatrix}b_{0}\\ b_{1}\\ b_{2}\\ b_{3}\\ b_{4}\\ b_{5}\end{bmatrix} = \begin{bmatrix}0\\ -y_{5}\\ -y_{4}\\ 0\\ y_{4}\\ y_{5}\end{bmatrix}  \tag{49}\]  
Figure 4: Data flow diagram of the RDFT algorithm for \(N=6\). The algorithm of the RDFT for \(N=6\), presented in Figure 4, can be described by the following matrix-vector procedure, in which the matrix \(\mathbf{R}_{6}\) has been factorized:  
\[\mathbf{y}_{6}=\mathbf{C}_{6}\mathbf{D}_{6}\mathbf{\tilde{A}}_{6}\mathbf{ \overline{A}}_{6}\mathbf{\tilde{A}}_{6}\mathbf{\tilde{A}}_{6}\mathbf{x}_{6} \tag{50}\]  
where  
\[\mathbf{\tilde{A}}_{6}= \begin{bmatrix}1&0&0&1&0&0\\ 0&1&0&0&0&1\\ 0&0&1&0&1&0\\ 1&0&0&-1&0&0\\ 0&0&1&0&-1&0\\ 0&1&0&0&0&-1\end{bmatrix} \quad\mathbf{\overline{A}}_{6}= \begin{bmatrix}1&0&0&0&0&0 \\ 0&1&1&0&0&0\\ 0&1&-1&0&0&0\\ 0&0&0&1&0&0\\ 0&0&0&0&1&-1\\ \end{bmatrix}  \tag{51}\]  
\[\mathbf{\tilde{A}}_{6}=