Request for Question Clarification by
theta-ga
on
06 Feb 2003 12:34 PST
Hi noggywoggy-ga,
It would help if you could specify what problems/unexpected results
you see when you run this code.
The most obvious error in the line you specified is the
semicolon(;) after the for loop :
for(i=0; i<freq_num; i++);
You would want to remove this semicolon so that the statements in
the block following this loop are executed multiple times. Line 161
becomes :
for(i=0; i<freq_num; i++)
Also, you have not declared the variables imp1, imp2 and ratio
anywhere, although you use them from line 164 onwards. They seem to be
of the complex type, so add the line ;
complex imp1,imp2,ratio;
somewhere before line 161.
Also, you refer to imp1's members as imp1.real and imp1.imag, while in
the complex structure definition, you have named the members r and i.
You will have to change that.
Also, the constant PI used on line 128 has not been defined.
Add the line:
#define PI 3.142
after the #include statements in the file.
Another error is in the declaration of the variable omega. You declare
omega on line 76 as a simple double, yet from line 167 onwards, you
use it as an array.
Make up your mind, and declare omega correctly.
Your program did not compile on my VC++ because of the aforementioned
errors. Fix them and your program should start compiling. Then go on
to fixing any logical errors you may find.
Hope this helps.
If the above is what you were looking for, tell me and I will post
this as an answer.
Best of luck with the code! ;-)
(Hope this was fast enough for you)
Regards,
Theta-ga