[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 1 KB, 354x50, fft.png [View same] [iqdb] [saucenao] [google]
5416788 No.5416788[DELETED]  [Reply] [Original]

Hey /sci/, I am unsure what to do about the imaginary unit in the power for the Euler's number. For reference, I am calculating the Fast Fourier Transform (the DFT formula is shown there) via a computer program so I will have an imaginary unit expressed somehow in a class called Complex. The Complex class resembles the complex numbers used in the sequence of elements. However, I am unsure what to do about the imaginary unit that is outside of the Complex class (as in, the Euler's number is that - it is not a complex number... or will I have to make the result of the Euler's number ^ power a complex number? ...but then, what would I put down for the imaginary unit inside the Complex class?)

Sorry if I seem to be rambling here, I am not very good with imaginary units.

>> No.5416799

what's the relation between euler's number and complex numbers?

>> No.5416802

>>>/ramanujansums/

>> No.5416805

>>5416802
>ramanujansums

I will need some explanation as to how that helps me understand how to handle the imaginary unit in the Euler part of both the Fast Fourier Transform and the Ramanujan's Sum you mention.

>> No.5416810

Use the sum definition of e^x.

e^x := sum from k=0 to oo (x^k)/(k!)

>> No.5416819

>>5416810

But how do I handle the imaginary unit as it will be part of x in e^x? That's my question. Or am I missing something here...

>> No.5416821

>>5416819
Have you ever even studied complex variables/analysis?

>> No.5416827

>>5416821

No. This is the first time I've ever had to handle an imaginary unit in a computer program before.

>> No.5416832

>>5416827
Well, this identity might be useful:

<span class="math"> e^{ix} = \cos x + i \sin x [/spoiler]

Have fun!

>> No.5416838

>>5416827
You use "sum from k=0 to oo (x^k)/(k!)".
Since you use a program you should choose a big number like 100 and then write a program like:
while (k < 100) {
sum = sum + (x^k / factorial(k));
k = k + 1;
}

Then x^k is just x*x*...*x or i*i*...*i in the case of x=i.

>> No.5416843

>>5416827
you're not coding this in java are you?

>> No.5416846

>>5416843

Course requirement.

>> No.5416853

>>5416846
get a gun and shoot your professor.


Also reported for HW

>> No.5416859

>>5416853

Homework? Sorry, but you're wrong. You don't know anything about what I am working on and the class does not deal with imaginary units. FFT is just one of many problem domains and I was selected to work on it. Hence my coming here to better understand how to handle imaginary units.

>> No.5416864

>>5416853
>>5416859

In addition, only close-minded idiots hate on Java. But I would understand if you hated some wannabe "programmer" for learning only Java and no other languages (and they'd fail in the working world anyway).

>> No.5416871

>>5416832

See, that's my problem. I've never really known what an imaginary unit really is, how to use it, how to handle it, and how to express it. So when you say 'i' in there, I just shut down. I literally don't know what to do about it. Sure, the identity helps, but I need more information on how to actually implement that identity. What do I do with the i? What number would it be?

>> No.5416878

>>5416859
>hurr durr my FFT is so advanced

Shut up and do your obvious homework alone, undergrad pleb.

>> No.5416886

>>5416878

It isn't. I understand FFT just fine and would have no problems implementing it. It isn't even *the* homework, the homework is to apply a certain technique to the formula... this is how FFT falls under one of many other problem domains. Other problem domains could be facial recognition, tree searching, etc, anything on a mathematical but repetitive level. But I am here to learn more about how to deal with the imaginary units. No other problem domain discussed uses imaginary units hence it was not discussed in class.

If you aren't going to helpful then please stop posting. Thanks.

>> No.5416888

>>5416871
You need to define a new type Complex that is a pair of two real numbers (double in Java?) - the "real part" and the "imaginary part".
Then you need to define addition and multiplication for variables of the type Complex.
For example:
Complex Complex_Add (Complex a, Complex b) {
double z;
z.real := a.real + b.real;
z.imaginary := a.imaginary + b.imaginary;
return z;
}
(I can't into Java.)
i is simply a complex number with real part 0 and imaginary part 1.

To see multiplication and why these definitions make sense go to Wikipedia.
Basically the point is that i^2 = -1 so every polynmial has roots (e.g. x^2 + 1).

>> No.5416894

>>5416888
>i is simply a complex number with real part 0 and imaginary part 1.

That helps shed some light. Thanks very much for this post!

>> No.5416895

>>5416886
Why do you not know complex numbers? That's high school math.

>> No.5416898

>>5416895

My issue wasn't complex numbers. I'm fine with the complex numbers part of the formula (the Xn stuff). Euler's number ^ power isn't a complex number afaik.

>> No.5416900

>>5416871
Just think it an element of an group, the easiest way of working with them would be with modulus and arguments. Then |e^z| = e^|z|, arg(e^z)=tan(arg(z))

>> No.5416902

>>5416898
>Euler's number ^ power isn't a complex number afaik.

most retarded post of the day

>> No.5416908

>>5416902

From wiki:
>A complex number is a number that can be put in the form a + bi.

>The number e is an important mathematical constant, approximately equal to 2.71828, that is the base of the natural logarithm.[1] It is the limit of (1 + 1/n)n as n approaches infinity, an expression that arises in the study of compound interest, and can also be calculated as the sum of the infinite series[2]

No imaginary unit in Euler's number, no complex number.

>> No.5416910

>>5416894
was that sarcasm? That's an elementary school explanation

>> No.5416912

>>5416910

Show me where anyone would have learned that to express an imaginary unit inside a computer program would be to create a Complex class with real part = 0 and imaginary part = 1?

> you cant

>> No.5416914
File: 14 KB, 343x383, 1326168505838.png [View same] [iqdb] [saucenao] [google]
5416914

>>5416910
What do you expect? He's a CS major

>> No.5416916

>>5416908
Are you seriously saying the reals are not embedded in the complex numbers?

>> No.5416918

>>5416914

I may be a CS major but I would never call myself a computer scientists after my degree. Why are so many people buttmad about CS majors anyway? Plenty of programming jobs out there.

>> No.5416920

>>5416908
>1^2 is not a real number, because there is no 2 in 1.

>> No.5416925 [DELETED] 

>>5416912
I want to say you're trolling but you sound serious

>>5416908
http://en.wikipedia.org/wiki/Exponential_function#Formal_definition
>Series of complex numbers not converging to a complex number
Read some Rudin and educate yourself of math