Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d1857042 authored by hhakim's avatar hhakim
Browse files

Fix pyfaust.dft and matfaust.dft doc.

parent a1f9d480
No related branches found
No related tags found
No related merge requests found
%========================================================================================== %==========================================================================================
%> @brief Constructs a Faust F implementing the Discrete Fourier Transform (DFT) order n. %> @brief Constructs a Faust F implementing the Discrete Fourier Transform (DFT) of order n.
%> %>
%> The factorization algorithm used is Cooley-Tukey (FFT). %> The factorization algorithm used is Cooley-Tukey (FFT).
%> %>
%> The factorization corresponds to the butterfly structure of the Cooley-Tukey %> The factorization corresponds to the butterfly structure of the Cooley-Tukey
%> FFT algorithm. The resulting Faust is complex and has (log2(n)+1) sparse %> FFT algorithm. The resulting Faust is complex and has (log2(n)+1) sparse
%> factors whose the log2(n) first has 2 nonzeros per row and per column. The %> factors. The log2(n) first has 2 nonzeros per row and per column. The
%> last factor is a bit-reversal permutation matrix. %> last factor is a bit-reversal permutation matrix.
%> %>
%> @b Usage %> @b Usage
......
...@@ -3256,12 +3256,12 @@ def wht(n, normed=True, dev="cpu", dtype='double'): ...@@ -3256,12 +3256,12 @@ def wht(n, normed=True, dev="cpu", dtype='double'):
def dft(n, normed=True, dev='cpu', diag_opt=False): def dft(n, normed=True, dev='cpu', diag_opt=False):
""" """
Constructs a Faust F implementing the Discrete Fourier Transform (DFT) order n. Constructs a Faust F implementing the Discrete Fourier Transform (DFT) of order n.
The factorization corresponds to the butterfly structure of the The factorization corresponds to the butterfly structure of the
Cooley-Tukey FFT algorithm. Cooley-Tukey FFT algorithm.
The resulting Faust is complex and has (log2(n)+1) sparse factors The resulting Faust is complex and has (log2(n)+1) sparse factors.
whose the log2(n) first has 2 nonzeros per row and per column. The log2(n) first has 2 nonzeros per row and per column.
The last factor is a bit-reversal permutation matrix. The last factor is a bit-reversal permutation matrix.
Args: Args:
...@@ -3296,8 +3296,7 @@ def dft(n, normed=True, dev='cpu', diag_opt=False): ...@@ -3296,8 +3296,7 @@ def dft(n, normed=True, dev='cpu', diag_opt=False):
>>> dft(1024, normed=True) # is equiv. to next call >>> dft(1024, normed=True) # is equiv. to next call
>>> dft(1024, normed=False).normalize() # which is less optimized though >>> dft(1024, normed=False).normalize() # which is less optimized though
<b>See also:</b> pyfaust.tools.bitrev, pyfaust.wht, pyfaust.dct, <b>See also:</b> pyfaust.tools.bitrev, pyfaust.wht, pyfaust.dct, pyfaust.dst, scipy.fft.fft, pyfaust.fact.butterfly, pyfaust.rand_butterfly.
pyfaust.dst, scipy.fft.fft, pyfaust.fact.butterfly, pyfaust.rand_butterfly.
""" """
log2n = np.floor(np.log2(n)) log2n = np.floor(np.log2(n))
if(n > 2**log2n): raise ValueError("n must be a power of 2.") if(n > 2**log2n): raise ValueError("n must be a power of 2.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment