Commit e8b6830f authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

minor tweak to FFT

parent d911bc4d
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment