Skip to content

Commit b470644

Browse files
committed
Few fix work for complex sequences FFT.
1 parent ef304e4 commit b470644

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

doc/specs/fftpack.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,12 @@ end program demo_zffti
5959

6060
### Description
6161

62-
Computes the forward complex discrete fourier
63-
transform (the fourier analysis).
64-
Equivalently, `zfftf` computes
65-
the fourier coefficients of a complex periodic sequence.
66-
the transform is defined below at output parameter `c`.
62+
Computes the forward complex discrete fourier transform (the fourier analysis).
63+
Equivalently, `zfftf` computes the fourier coefficients of a complex periodic sequence.
64+
The transform is defined below at output parameter `c`.
6765

68-
The transform is not normalized. to obtain a normalized transform
69-
the output must be divided by `n`. otherwise a call of `zfftf`
66+
The transform is not normalized. To obtain a normalized transform
67+
the output must be divided by `n`. Otherwise a call of `zfftf`
7068
followed by a call of `zfftb` will multiply the sequence by `n`.
7169

7270
The array `wsave` which is used by subroutine `zfftf` must be
@@ -105,7 +103,10 @@ for j=1,...,n
105103

106104
`wsave`: Shall be a `real` array.
107105
This argument is `intent(inout)`.
108-
A `real` work array which must be dimensioned at least `4n+15` in the program that calls `zfftf`. The wsave array must be initialized by calling subroutine `zffti(n,wsave)` and a different wsave array must be used for each different value of `n`. This initialization does not have to be repeated so long as `n` remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by `zfftf` and `zfftb`.
106+
A `real` work array which must be dimensioned at least `4n+15` in the program that calls `zfftf`.
107+
The wsave array must be initialized by calling subroutine `zffti(n,wsave)` and a different `wsave` array must be used for each different value of `n`.
108+
This initialization does not have to be repeated so long as `n` remains unchanged thus subsequent transforms can be obtained faster than the first.
109+
The same `wsave` array can be used by `zfftf` and `zfftb`.
109110
Contains initialization calculations which must not be destroyed between calls of subroutine `zfftf` or `zfftb`.
110111

111112
#### Warning
@@ -176,7 +177,7 @@ for j=1,...,n
176177

177178
`wsave`: Shall be a `real` array.
178179
This argument is `intent(inout)`.
179-
A `real` work array which must be dimensioned at least `4n+15` in the program that calls `zfftf`. The wsave array must be initialized by calling subroutine `zffti(n,wsave)` and a different wsave array must be used for each different value of `n`. This initialization does not have to be repeated so long as `n` remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by `zfftf` and `zfftb`.
180+
A `real` work array which must be dimensioned at least `4n+15` in the program that calls `zfftf`. The `wsave` array must be initialized by calling subroutine `zffti(n,wsave)` and a different `wsave` array must be used for each different value of `n`. This initialization does not have to be repeated so long as `n` remains unchanged thus subsequent transforms can be obtained faster than the first. The same `wsave` array can be used by `zfftf` and `zfftb`.
180181
Contains initialization calculations which must not be destroyed between calls of subroutine `zfftf` or `zfftb`.
181182

182183
#### Warning
@@ -201,8 +202,7 @@ end program demo_zfftb
201202

202203
### Description
203204

204-
Computes the forward complex discrete fourier
205-
transform (the fourier analysis).
205+
Computes the forward complex discrete fourier transform (the fourier analysis).
206206

207207
### Status
208208

@@ -214,7 +214,7 @@ Pure function.
214214

215215
### Snytax
216216

217-
`call [[fftpack(module):fft(interface)]](x [, n])`
217+
`result = [[fftpack(module):fft(interface)]](x [, n])`
218218

219219
### Argument
220220

@@ -231,6 +231,12 @@ if `n <= size(x)`, the first `n` elements of `x` will be included in the calcula
231231

232232
if `n > size(x)`, the all elements of `x` and `n-size(x)` elements filled with zeros will be included in the calculation.
233233

234+
### Return value
235+
236+
`fft(x)` returns the Discrete Fourier Transform (DFT) of `x` using the Fast Fourier Transform (FFT) algorithm.
237+
238+
`fft(x, n)` returns `n` point DFT of `x` using the FFT algorithm.
239+
234240
### Example
235241

236242
```fortran
@@ -260,7 +266,7 @@ Pure function.
260266

261267
### Snytax
262268

263-
`call [[fftpack(module):ifft(interface)]](x [, n])`
269+
`result = [[fftpack(module):ifft(interface)]](x [, n])`
264270

265271
### Argument
266272

@@ -277,6 +283,12 @@ if `n <= size(x)`, the first `n` elements of `x` will be included in the calcula
277283

278284
if `n > size(x)`, the all elements of `x` and `n-size(x)` elements filled with zeros will be included in the calculation.
279285

286+
### Return value
287+
288+
`ifft(x)` returns the inverse Discrete Fourier transform of `x` using the Fast Fourier Transform algorithm..
289+
290+
`ifft(x, n)` returns `n` point inverse DFT of `x` using the FFT algorithm.
291+
280292
### Example
281293

282294
```fortran

src/fftpack_fft.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pure module function fft_cdp(x, n) result(result)
88
integer, intent(in), optional :: n
99
complex(kind=dp), allocatable :: result(:)
1010

11-
integer :: lenseq, lensav, lenwrk
11+
integer :: lenseq, lensav, i
1212
real(kind=dp), allocatable :: wsave(:)
1313

1414
if (present(n)) then

src/fftpack_ifft.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pure module function ifft_cdp(x, n) result(result)
88
integer, intent(in), optional :: n
99
complex(kind=dp), allocatable :: result(:)
1010

11-
integer :: lenseq, lensav, lenwrk
11+
integer :: lenseq, lensav, i
1212
real(kind=dp), allocatable :: wsave(:)
1313

1414
if (present(n)) then

0 commit comments

Comments
 (0)