sscal1d,dscal1d(3F) sscal1d,dscal1d(3F)
sscal1d, dscal1d - scales a 1D real sequence.
Fortran :
subroutine sscal1d( n, alpha, array, inc)
integer n, inc
real alpha, array(0:(n-1)*inc)
subroutine dscal1d( sign, n, p, array, inc, lda)
integer n, inc
real*8 alpha, array(0:(n-1)*inc)
C :
#include <fft.h>
int sscal1d ( int n, float alpha, float *array, int inc);
int dscal1d ( int n, double alpha, double *array, int inc);
sscal1d and dscal1d scale a 1D real sequence of N samples.
The Fourier Transforms are not normalized so the succession DirectInverse
transform scales the input data by a factor equal to the size of
the transform. sscal1d or dscal1d may be used to scale back the result.
N Integer, the number of samples in each sequence.
Unchanged on exit.
P Integer, the number of sequences. Unchanged on exit.
Alpha scaling floating point value.
ARRAY Array containing the samples of the sequence to be scaled (in
place).
INC Integer, increment between two consecutive elements of a sequence.
Unchanged on exit.
LDA Integer, leading dimension: increment between the first samples of
two consecutive sequences. Unchanged on exit.
Example of Calling Sequence
Given a 1024 real values sequence. We successively apply a Direct
Fourier Transform, an Inverse Fourier Trasnform and finally scale back
the result by a factor 1/N (1/1024.)-
This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
operator and the final sequence should be equal (with round-off
precision) to the initial sequence.
Elements of each sequence are stored with increment (stride) 1.
Fortran
real array(0:1024-1), coeff(1024+15)
Page 1
sscal1d,dscal1d(3F) sscal1d,dscal1d(3F)
call scfft1dui( 1024, coeff)
call scfft1du( -1, 1024, array, 1, coeff)
call scfft1du( 1, 1024, array, 1, coeff)
call sscal1d( 1024, (1./real(1024)), array,1)
C
#include <fft.h>
float array[1024], *coeff;
coeff = scfft1dui( 1024, NULL);
scfft1du( -1, 1024, array, 1, coeff);
csfft1du( 1, 1024, array, 1, coeff);
sscal1d( 1024, 1./(float)1024, array, 1);
NOTE_1 : The Direct and Inverse transforms should use opposite signs -
Which one is used (+1 or -1) for Direct transform is just a matter of
convention
NOTE_2 : The Fourier Transforms are not normalized so the succession
Direct-Inverse transform scales the input data by a factor equal to the
size of the transform.
fft, scfft1dui, dzfft1dui, scfft1du, dzfft1du, csfft1du, zdfft1du,
sprod1du, dprod1du
PPPPaaaaggggeeee 2222 [ Back ]
|