Science Forums
User Name
Password
Science Social Network
home    members    help/rules    who is online    contact   

Go Back   Science Forums > Physical Sciences Forums > Computer Science
Become a science forums sponsor today
Reply
 
LinkBack Thread Tools
Old 05-22-2008   #1 (permalink)
pigeon_soup's Avatar
Thinking


 



FFT and DFT in C++

Why hello there!

Three days ago I started relearning C++ at work as a large section of my work will entail interfacing with PCs via I/O cards, mostly preforming signal analysis. I have got all the basic commands down I belive, such as for loops, ifs, and am comfident with most of the operators.

My boss has decided that as I am fairly competent i should learn "to do somthing useful." he wants me to first produce a sine wave then draw this using Timage. this was fairly simple and i got it completed in about an hour. Next i need to preform a Fast Fourier Transform on the sine wave and draw the output from this using Timage. Once i have got that completed he wants me to draw a cosine wave using Timage, then preform a Discrete Fourier Transform on the cosine wave and draw the output again with Timage.

I tried some existing code that another member of the team at work has used but I cant get it to work. My boss said that the manner in which i produced the sine wave is wrong, the code I used is:

for(int i=0;i<points;i++)
{
sinearray[i]= sin(Pi/180*i);
}


is there a better way to generate a sine wave? i am using Borland Turbo C++ and so have to work in radians. any help with any of the above tasks would be greatly apreciated.

many thanks pigeon
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -8. The time now is 02:51 PM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. Copyright © 2000-2008 Hypography
Part of the Hypography - Science for Everyone Network