FFT and DFT in C++

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-22-2008
Thinking

Join Date: Feb 2007
Location: Milton Keynes
Posts: 14
pigeon_soup is an unknown quantity at this point
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

» Current Poll
Do you read popular science books?
Yes, a few each year - 60.00%
6 Votes
Yes, but very rarely - 10.00%
1 Vote
Yes, most of the time - 20.00%
2 Votes
No - 10.00%
1 Vote
Total Votes: 10
You may not vote on this poll.

All times are GMT -8. The time now is 09:58 PM.


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