Closed Thread
Results 1 to 7 of 7

Fourier Analys

  1. #1
    Ed_Berez
    Guest

    Fourier Analys

    Hi,
    I need more than 4096 values in the input range of the Fourier Analysis.
    Please, help.

  2. #2
    Steve Dalton
    Guest

    Re: Fourier Analys

    Could you provide more details?

    Where is the Fourier Analysis being done (workbook, VBA, other) and by what
    (3rd party add-in, your own code, other)?

    Regards

    Steve Dalton


    "Ed_Berez" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > I need more than 4096 values in the input range of the Fourier Analysis.
    > Please, help.




  3. #3
    Ed_Berez
    Guest

    Re: Fourier Analys

    Hi, Steve.

    I use Fourier Analysis from Data Analysis tool pack (Tools>>Data
    Analysis>>Fourier Analysis). The maximum number of values in the input range
    is 4096. (The number of input range values must be an even power of 2).

    Regards.

    "Steve Dalton" wrote:

    > Could you provide more details?
    >
    > Where is the Fourier Analysis being done (workbook, VBA, other) and by what
    > (3rd party add-in, your own code, other)?
    >
    > Regards
    >
    > Steve Dalton
    >
    >
    > "Ed_Berez" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > > I need more than 4096 values in the input range of the Fourier Analysis.
    > > Please, help.

    >
    >
    >


  4. #4
    Myrna Larson
    Guest

    Re: Fourier Analys

    In that case, you can't modify the limitations. YOu would have to write your
    own function or use a 3rd party add-in.

    On Sun, 13 Feb 2005 12:09:07 -0800, "Ed_Berez"
    <[email protected]> wrote:

    >Hi, Steve.
    >
    >I use Fourier Analysis from Data Analysis tool pack (Tools>>Data
    >Analysis>>Fourier Analysis). The maximum number of values in the input range
    >is 4096. (The number of input range values must be an even power of 2).
    >
    >Regards.
    >
    >"Steve Dalton" wrote:
    >
    >> Could you provide more details?
    >>
    >> Where is the Fourier Analysis being done (workbook, VBA, other) and by what
    >> (3rd party add-in, your own code, other)?
    >>
    >> Regards
    >>
    >> Steve Dalton
    >>
    >>
    >> "Ed_Berez" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Hi,
    >> > I need more than 4096 values in the input range of the Fourier Analysis.
    >> > Please, help.

    >>
    >>
    >>



  5. #5
    Ed_Berez
    Guest

    Re: Fourier Analys

    Could you please advise me any 3rd party add-in to solve my problem?


    "Myrna Larson" wrote:

    > In that case, you can't modify the limitations. YOu would have to write your
    > own function or use a 3rd party add-in.
    >
    > On Sun, 13 Feb 2005 12:09:07 -0800, "Ed_Berez"
    > <[email protected]> wrote:
    >
    > >Hi, Steve.
    > >
    > >I use Fourier Analysis from Data Analysis tool pack (Tools>>Data
    > >Analysis>>Fourier Analysis). The maximum number of values in the input range
    > >is 4096. (The number of input range values must be an even power of 2).
    > >
    > >Regards.
    > >
    > >"Steve Dalton" wrote:
    > >
    > >> Could you provide more details?
    > >>
    > >> Where is the Fourier Analysis being done (workbook, VBA, other) and by what
    > >> (3rd party add-in, your own code, other)?
    > >>
    > >> Regards
    > >>
    > >> Steve Dalton
    > >>
    > >>
    > >> "Ed_Berez" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Hi,
    > >> > I need more than 4096 values in the input range of the Fourier Analysis.
    > >> > Please, help.
    > >>
    > >>
    > >>

    >
    >


  6. #6
    Registered User
    Join Date
    06-24-2014
    Location
    Vancouver, WA
    MS-Off Ver
    2013
    Posts
    1

    Re: Fourier Analys

    I can give you some C Code that you can modify into VBA code and make you're own FFT. I may give this a try myself and when (if?) I get it working I can post it. Here is the FFT, also required is a BitReverse function and another one which calculates the number of samples required which are also enclosed.

    void fft_double (
    unsigned NumSamples,
    double *RealIn,
    double *RealOut,
    double *ImagOut )


    {
    unsigned NumBits; /* Number of bits needed to store indices */
    unsigned i, j, k, n;
    unsigned BlockSize, BlockEnd;
    double angle_numerator = 2.0 * PI;
    double tr, ti; /* temp real, temp imaginary */
    double delta_angle;
    double sm2;
    double sm1;
    double cm2;
    double cm1;
    double w;
    double ar[3], ai[3];
    double *RealTmp = new double[NumSamples];
    double *ImagTmp = new double[NumSamples];


    if ( !IsPowerOfTwo(NumSamples) )
    {
    fprintf (
    stderr,
    "Error in fft(): NumSamples=%u is not power of two\n",
    NumSamples );

    return;
    }

    //CHECKPOINTER ( RealIn );


    NumBits = NumberOfBitsNeeded ( NumSamples );

    /*
    ** Do simultaneous data copy and bit-reversal ordering into outputs...
    */

    for ( i=0; i < NumSamples; i++ )
    {
    j = ReverseBits ( i, NumBits );
    RealTmp[j] = RealIn[i];
    ImagTmp[j] = 0.0;
    }

    /*
    ** Do the FFT itself...
    */

    BlockEnd = 1;

    for ( BlockSize = 2; BlockSize <= NumSamples; BlockSize <<= 1 )
    {
    delta_angle = angle_numerator / (double)BlockSize;
    sm2 = sin ( -2 * delta_angle );
    sm1 = sin ( -delta_angle );
    cm2 = cos ( -2 * delta_angle );
    cm1 = cos ( -delta_angle );
    w = 2 * cm1;

    for ( i=0; i < NumSamples; i += BlockSize )
    {
    ar[2] = cm2;
    ar[1] = cm1;

    ai[2] = sm2;
    ai[1] = sm1;

    for ( j=i, n=0; n < BlockEnd; j++, n++ )
    {
    ar[0] = w*ar[1] - ar[2]; ar[2] = ar[1]; ar[1] = ar[0];
    ai[0] = w*ai[1] - ai[2]; ai[2] = ai[1]; ai[1] = ai[0];

    k = j + BlockEnd;
    tr = ar[0]*RealTmp[k] - ai[0]*ImagTmp[k];
    ti = ar[0]*ImagTmp[k] + ai[0]*RealTmp[k];

    RealTmp[k] = RealTmp[j] - tr;
    ImagTmp[k] = ImagTmp[j] - ti;

    RealTmp[j] += tr;
    ImagTmp[j] += ti;
    }
    }

    BlockEnd = BlockSize;
    }

    // added to remove requirement to pass full size real and image arrays to FFT
    // and to rescale to the right value

    double denom = (double)(NumSamples)/2.0;
    for(i=0; i<j; i++)
    {
    RealOut[i] = RealTmp[i]/denom;
    ImagOut[i] = ImagTmp[i]/denom;
    }

    RealOut[NumSamples/2] = RealTmp[NumSamples/2]/(denom*2);
    ImagOut[NumSamples/2] = ImagTmp[NumSamples/2]/(denom*2);


    delete RealTmp;
    delete ImagTmp;
    }


    unsigned ReverseBits ( unsigned index, unsigned NumBits )
    {
    unsigned i, rev;

    for ( i=rev=0; i < NumBits; i++ )
    {
    rev = (rev << 1) | (index & 1);
    index >>= 1;
    }

    return rev;
    }


    unsigned NumberOfBitsNeeded ( unsigned PowerOfTwo )
    {
    unsigned i;

    if ( PowerOfTwo < 2 )
    {
    fprintf (
    stderr,
    ">>> Error in fftmisc.c: argument %d to NumberOfBitsNeeded is too small.\n",
    PowerOfTwo );

    return(1);
    }

    for ( i=0; ; i++ )
    {
    if ( PowerOfTwo & (1 << i) )
    return i;
    }
    }

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Fourier Analys

    Dan Bullard, it is very unlikely that he is still looking for the solution nine years later. In addition, the OP was cross-posted without a link. As for your post, please take the time to review our rules. There aren't many, and they are all important.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    Given the multitude of transgressions here I'm closing this zombie thread.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1