C++ help

Technical discussion relating to drugcrew.com & the forums
Bookmark and Share

C++ help

Postby [DRuG]Silky on Tue Sep 20, 2011 1:44 pm

hey guys so i have a C++ programing paper in uni, and i was wondering if anyone can help me since most of you are programing masters :)

so its mainly to do with calculation based programs i.e making a formula to answer a problem

what i have to do is:
Any periodic waveform can be written as the sum of a series of sine and cosine signals. This series is known as the Fourier Series of the waveform. It is usually an infinite series. The frequencies of the sine and cosine signals are integer multiples (known as harmonics) of the frequency of the waveform. The Fourier series of a square waveform with an amplitude of 10 is (the attached file)

The value of theta is from 0 to 2 radians (0 to 360 degrees) over one cycle of the periodic waveform. This waveform has a value of 10 for theta = 0 to 180 degrees and
an amplitude of -10 for theta = 180 to 360 degrees.
In the computer we can only use a finite number of terms in the formula, so if we sum for N terms from n =0 to n = N-1 (inclusive) we get a result that is approximately a square waveform. The larger the value of N, the better the approximation.

im trying to Write a program to calculate this Fourier Series sum for a value of N input by the program user. The value of should go from 0 to 360 degrees (inclusive) in 6 degree steps.

so yea im having trouble writing this program

if anyone is good and this stuff can u help me out, this is first year stuff so yea haha

User avatar

[DRuG] member
[DRuG] member
[LF] member
[CJS] member
Posts: 34
Joined: Sat Jan 03, 2009 4:23 pm

Return to Technical support

Who is online

Users browsing this forum: No registered users and 1 guest