minor tweak to FFT
This commit is contained in:
parent
d911bc4d0d
commit
e8b6830f53
2 changed files with 11 additions and 4 deletions
|
@ -103,6 +103,13 @@ struct kiss_fft_state{
|
|||
do{ (c).r = S_MUL( (c).r , s ) ;\
|
||||
(c).i = S_MUL( (c).i , s ) ; }while(0)
|
||||
|
||||
# define DIVSCALAR(x,k) \
|
||||
(x) = S_MUL( x, (TWID_MAX-((k)>>1))/(k)+1 )
|
||||
|
||||
# define C_FIXDIV(c,div) \
|
||||
do { DIVSCALAR( (c).r , div); \
|
||||
DIVSCALAR( (c).i , div); }while (0)
|
||||
|
||||
#else /* MIXED_PRECISION */
|
||||
# define sround4( x ) (kiss_fft_scalar)( ( (x) + ((SAMPPROD)1<<(FRACBITS-1)) ) >> (FRACBITS+2) )
|
||||
|
||||
|
@ -123,8 +130,6 @@ struct kiss_fft_state{
|
|||
do{ (c).r = sround( smul( (c).r , s ) ) ;\
|
||||
(c).i = sround( smul( (c).i , s ) ) ; }while(0)
|
||||
|
||||
#endif /* !MIXED_PRECISION */
|
||||
|
||||
# define DIVSCALAR(x,k) \
|
||||
(x) = sround( smul( x, SAMP_MAX/k ) )
|
||||
|
||||
|
@ -132,6 +137,8 @@ struct kiss_fft_state{
|
|||
do { DIVSCALAR( (c).r , div); \
|
||||
DIVSCALAR( (c).i , div); }while (0)
|
||||
|
||||
#endif /* !MIXED_PRECISION */
|
||||
|
||||
|
||||
|
||||
#define L1 32767
|
||||
|
|
|
@ -66,8 +66,8 @@ void test1d(int nfft,int isinverse)
|
|||
|
||||
#ifdef DOUBLE_PRECISION
|
||||
for (k=0;k<nfft;++k) {
|
||||
in[k].r *= 65536;
|
||||
in[k].i *= 65536;
|
||||
in[k].r *= 32768;
|
||||
in[k].i *= 32768;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue