1 Jun 2008 17:41
[Rd] suggested addition to fft man page
Hiroyuki Kawakatsu <hkawakat <at> gmail.com>
2008-06-01 15:41:31 GMT
2008-06-01 15:41:31 GMT
Hi,
May I request that the formula for fft() be included in the man page?
This is the second time I had to check what fft() does... In fact,
fft.Rd has
%%
%% Here, we should really have a nice \deqn{}{} giving the definition
%% of the DFT !
%%
Below is a suggested snippet (not necessarily "nice") to be added to
fft.Rd; please feel free to improve it.
%%---begin{hiroyuki}
\code{y <- fft(z)} returns
\deqn{y[h] = \sum_{k=1}^n z[k] \exp(-2\pi i (k-1)(h-1)/n)}{%
y[h] = sum_{k=1}^{n} z[k]*exp(-2*pi*1i*(k-1)*(h-1)/n)}
for \eqn{h = 1,\ldots,n}{h = 1, ..., n} where n = \code{length(y)}. If
\code{inverse} is \code{TRUE}, \eqn{\exp(-2\pi\ldots)}{exp(-2*pi...)}
is replaced with \eqn{\exp(2\pi\ldots)}{exp(2*pi...)}.
%%---end{hiroyuki}
Thanks for your consideration,
h.
p.s. fft.c was not "readable" so i used the following code to check the formula:
# to check fft formula
fft_slow <- function(z, inverse=FALSE) {
n <- length(z)
kdx <- seq(0, n-1)
sgn <- ifelse(inverse, 1, -1)
(Continue reading)
RSS Feed