You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`.
174
174
Contains initialization calculations which must not be destroyed between calls of subroutine `zfftf` or `zfftb`.
A `real` work array which must be dimensioned at least `2n+15` in the program that calls `dfftf`. The `wsave` array must be initialized by calling subroutine `dffti(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 `dfftf` and `dfftb`.
469
469
Contains initialization calculations which must not be destroyed between calls of subroutine `dfftf` or `dfftb`.
A work array which must be dimensioned at least `3*n+15`.
609
+
The same work array can be used for both `dzfftf` and `dzfftb` as long as n remains unchanged.
610
+
Different `wsave` arrays are required for different values of `n`.
611
+
612
+
##### Warning
613
+
614
+
The contents of `wsave` must not be changed between calls of `dzfftf` or `dzfftb`.
615
+
616
+
#### Example
617
+
618
+
```fortran
619
+
program demo_dzffti
620
+
use fftpack, only: dzffti
621
+
real(kind=8) :: x(4) = [1, 2, 3, 4]
622
+
real(kind=8) :: w(3*4 + 15)
623
+
call dzffti(4, w) !! Initializes the array `w` which is used in both `dzfftf` and `dzfftb`.
624
+
end program demo_dzffti
625
+
```
626
+
627
+
### `dzfftf`
628
+
629
+
#### Description
630
+
631
+
Computes the fourier coefficients of a `real` perodic sequence (fourier analysis).
632
+
The transform is defined below at output parameters `azero`, `a` and `b`.
633
+
`dzfftf` is a simplified but **slower version** of `dfftf`.
634
+
635
+
#### Status
636
+
637
+
Experimental
638
+
639
+
#### Class
640
+
641
+
Pure function.
642
+
643
+
#### Syntax
644
+
645
+
`call [[fftpack(module):dzfftf(interface)]](n, r, azero, a, b, wsave)`
646
+
647
+
#### Arguments
648
+
649
+
`n`: Shall be an `integer` scalar.
650
+
This argument is `intent(in)`.
651
+
The length of the array `r` to be transformed.
652
+
The method is most efficient when `n` is the product of small primes.
653
+
654
+
`r`: Shall be a `real` and rank-1 array.
655
+
This argument is `intent(in)`.
656
+
A `real` array of length `n` which contains the sequence to be transformed. `r` is not destroyed.
657
+
658
+
`azero`: Shall be a `real` scalar.
659
+
This argument is `intent(out)`.
660
+
The sum from `i=1` to `i=n` of `r(i)/n`.
661
+
662
+
`a`, `b`: Shall be a `real` and rank-1 array.
663
+
This argument is `intent(out)`.
664
+
```
665
+
for n even b(n/2)=0. and a(n/2) is the sum from i=1 to i=n of (-1)**(i-1)*r(i)/n
666
+
667
+
for n even define kmax=n/2-1
668
+
for n odd define kmax=(n-1)/2
669
+
670
+
then for k=1,...,kmax
671
+
672
+
a(k) equals the sum from i=1 to i=n of
673
+
674
+
2./n*r(i)*cos(k*(i-1)*2*pi/n)
675
+
676
+
b(k) equals the sum from i=1 to i=n of
677
+
678
+
2./n*r(i)*sin(k*(i-1)*2*pi/n)
679
+
```
680
+
681
+
`wsave`: Shall be a `real` and rank-1 array.
682
+
This argument is `intent(in)`.
683
+
A work array which must be dimensioned at least `3*n+15`.
684
+
In the program that calls `dzfftf`. The `wsave` array must be initialized by calling subroutine `dzffti(n,wsave)` and a different `wsave` array must be used for each different value of `n`.
685
+
This initialization does not have to be repeated so long as `n` remains unchanged thus subsequent transforms can be obtained faster than the first.
686
+
The same `wsave` array can be used by `dzfftf` and `dzfftb`.
Computes a `real` perodic sequence from its fourier coefficients (fourier synthesis).
706
+
The transform is defined below at output parameter `r`.
707
+
`dzfftb` is a simplified but **slower version** of `dfftb`.
708
+
709
+
#### Status
710
+
711
+
Experimental
712
+
713
+
#### Class
714
+
715
+
Pure function.
716
+
717
+
#### Syntax
718
+
719
+
`call [[fftpack(module):dzfftb(interface)]](n, r, azero, a, b, wsave)`
720
+
721
+
#### Arguments
722
+
723
+
`n`: Shall be an `integer` scalar.
724
+
This argument is `intent(in)`.
725
+
The length of the output array `r`.
726
+
The method is most efficient when `n` is the product of small primes.
727
+
728
+
`r`: Shall be a `real` and rank-1 array.
729
+
This argument is `intent(out)`.
730
+
```
731
+
if n is even define kmax=n/2
732
+
if n is odd define kmax=(n-1)/2
733
+
734
+
then for i=1,...,n
735
+
736
+
r(i)=azero plus the sum from k=1 to k=kmax of
737
+
738
+
a(k)*cos(k*(i-1)*2*pi/n)+b(k)*sin(k*(i-1)*2*pi/n)
739
+
```
740
+
Complex notation:
741
+
```
742
+
for j=1,...,n
743
+
744
+
r(j) equals the sum from k=-kmax to k=kmax of
745
+
746
+
c(k)*exp(i*k*(j-1)*2*pi/n)
747
+
748
+
where
749
+
750
+
c(k) = .5*cmplx(a(k),-b(k)) for k=1,...,kmax
751
+
752
+
c(-k) = conjg(c(k))
753
+
754
+
c(0) = azero
755
+
756
+
and i=sqrt(-1)
757
+
```
758
+
Amplitude - phase notation:
759
+
```
760
+
for i=1,...,n
761
+
762
+
r(i) equals azero plus the sum from k=1 to k=kmax of
763
+
764
+
alpha(k)*cos(k*(i-1)*2*pi/n+beta(k))
765
+
766
+
where
767
+
768
+
alpha(k) = sqrt(a(k)*a(k)+b(k)*b(k))
769
+
770
+
cos(beta(k))=a(k)/alpha(k)
771
+
772
+
sin(beta(k))=-b(k)/alpha(k)
773
+
```
774
+
775
+
`azero`: Shall be a `real` scalar.
776
+
This argument is `intent(in)`.
777
+
The constant fourier coefficient.
778
+
779
+
`a`, `b`: Shall be a `real` and rank-1 array.
780
+
This argument is `intent(in)`.
781
+
Arrays which contain the remaining fourier coefficients these arrays are not destroyed.
782
+
The length of these arrays depends on whether `n` is even or odd.
783
+
```
784
+
if n is even n/2 locations are required
785
+
if n is odd (n-1)/2 locations are required
786
+
```
787
+
788
+
`wsave`: Shall be a `real` and rank-1 array.
789
+
This argument is `intent(in)`.
790
+
A work array which must be dimensioned at least `3*n+15`.
791
+
In the program that calls `dzfftf`. The `wsave` array must be initialized by calling subroutine `dzffti(n,wsave)` and a different `wsave` array must be used for each different value of `n`.
792
+
This initialization does not have to be repeated so long as `n` remains unchanged thus subsequent transforms can be obtained faster than the first.
793
+
The same `wsave` array can be used by `dzfftf` and `dzfftb`.
0 commit comments