Fedora Linux Support Community & Resources Center
  #1  
Old 7th June 2012, 08:26 AM
KitchiRUs Offline
Registered User
 
Join Date: Dec 2011
Location: India
Posts: 82
linuxfirefox
Fourier Transforming in C

Hi,

This may not be the ideal place to post this, but what the heck.

I was wondering about Fourier Transform algorithms for C.
I tried writing a code to do a straight forward DFT (Discrete Fourier Transform), not the FFT algorithm. But I'm not entirely sure if it's worked out right.

Has anyone tried it/know what the DFT of a sin wave should look like?
Reply With Quote
  #2  
Old 7th June 2012, 03:09 PM
Wilker Offline
Registered User
 
Join Date: Oct 2011
Posts: 6
linuxepiphany
Re: Fourier Transforming in C

you are probably right...this may not be the ideal place for this...
might sound a stupid question, but have you tried a numerical methods book? i mean, is very probable they have this topic there. maybe with examples or an elementar case.
would be good if you could test an elementar case (firstly done analitically) and then check how good is your result, calculated numerically.
i have never done the FT algorhitm
Reply With Quote
  #4  
Old 7th June 2012, 05:15 PM
weitjong's Avatar
weitjong Online
Registered User
 
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736
macossafari
Re: Fourier Transforming in C

I have done both the FFT and FHT (Fast Hartley Transform) implementation years ago when I was still a university student. I was using Turbo Pascal from Borland back then. If I still remember how it works correctly then you should get two vertical lines if you evaluate from -pi to +pi, both lines at equidistant to each side of zero. But don't hold me to it .
__________________
YaoWT - Leave no window unbroken ^_^
Reply With Quote
  #5  
Old 7th June 2012, 05:31 PM
KitchiRUs Offline
Registered User
 
Join Date: Dec 2011
Location: India
Posts: 82
linuxfirefox
Re: Fourier Transforming in C

@ mmix - Thanks! That second link is exactly what I was looking for.
I'd attempted to use the complex number function in C, and I was failing miserably. This guy seems to have done it without that. I still have to run that code to check, though.

@WeitJong - Yeah... I worked it out to be two spikes equidistant from the origin. But I was only getting positive values from my code. So I started doubting my math instead of my code. :P

Thanks for your help!
Reply With Quote
Reply

Tags
algorithm, fft, fourier, transforming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Current GMT-time: 14:44 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat