CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: FFT related

  1. #1
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    FFT related

    I just want to know that does any one of you experts have used FFT analysis in their programming.

    I have to do FFT analysis using: one dimensional real data i.e. float.
    No. of points is 4096

    I have tried on of the implementation taken from NET named as FFTReal. I have to compare the outputr result with output from mathematical programming language out put

    Ultimate aim is to display Power Spectrum of the signal on time basis.

    Any help and suggestion are highly welcomed and i am looking after.

    Sandeep Arya
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  2. #2
    Join Date
    Jun 2004
    Posts
    102

    Re: FFT related

    Sorry, it is not clear (for me at least) what exactly is your problem?

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: FFT related

    Me neither...
    ... What exactly is your question?
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  4. #4
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: FFT related

    SOryy for not attaching the file.

    Well here is the image file which shows the difference between the FFT function result obtained from mathematical programming lang DAOS and with RealFFT alogo

    I hope the fig. illustrates the problem faced.
    Attached Images Attached Images
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  5. #5
    Join Date
    Nov 2000
    Location
    Munich, Germany
    Posts
    161

    Re: FFT related

    Actually, both look the same to me - can anyone else see a problem (except perhaps scaling, but that's a minor issue)?
    The Saviour of the World is a Penguin and Linus Torvalds is his Prophet.

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: FFT related

    I still don't get the problem...
    Both graphs look the same to me...
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  7. #7
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: FFT related

    There are 4096 pts in your fft. Visually it looks like the ratio of the amplitudes is approximately 4096*4096. I've similar scaling differences when I compared power spectra from MATLAB and MTS software. Each FFT routine seems to differ by a multiplicative constant.
    Matlab defines the DFT as

    X(k) =sum x(n)*exp(-j*2*pi*(k-1)*(n-1)/N) , 1 <= k <= N.


    another book I have defines the DFT as

    X(k) =(sum x(n)*exp(-j*2*pi*(k-1)*(n-1)/N)) / T , 1 <= k <= N.


    where T is the sampling interval
    Last edited by Tom Frohman; September 15th, 2004 at 02:44 PM.
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  8. #8
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: FFT related

    Thanks Tom, MarcG, ReorX

    for putting effort to reply back

    Well the problem is clearly visible in the figure which i am enumerating as following:
    1.0 Y axis values:
    In fft calculation from my routine i am getting values in power of 10pow+3 with magnitude of max value upto 7000 , while for other routine from DAOS values are in the range of 10pow-1 and value of max value about 4*10-3

    This is remarkable difference

    2.0 On the X axis, it can be viewed that point of max in my routine calculation occurs at position 16th while with DAOS it comes to be about 4.

    So these are main reason of my problem.

    I had even tried the code from Numerical Reciepe in C, but it too provides similar outputs as FFTReal routine, which i am using.

    Kindly provide your kind inputs.

    Thanking You

    Sandeep Arya
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured