PDA

View Full Version : complex exponential


mitkid9
07-06-04, 11:59 AM
Hi
I need to form an nxn matrix each element of which is a complex exponential
like

e ^ (-j*2*pi*i)
where pi=3.1
i= a variable and j is the complex thing...like e^j2= cos(2)+jsin(2)

I cant implement this complex part....can some one help///
The code I have written is below for reference

#include <iostream.h>
#include <cmath>// or math.h


int i,k;
int N=64;
double pi= 3.14;
double matrix[64][64]={0};

void main()
{
for (i=0; i<N; i++)
for (k=0; k<N; k++)
{
matrix[i][k]=exp (-j*2*pi*i*k/N);
}
}

Thankyou