Re: reading of complex values



Medris wrote:
Hi,

I would like to ask this simple question, how can I get the complex value
in DSP. when I read the sumation of complex value i got only real value.
Any help.
Example:

x[i].re=2;
x[i].im=3;
I got x2[i]=5 not 2+3i

so how can I get the complex value.

As others have pointed out, you're trying to get superficial information, but you're not supplying the deeper information that one needs to answer your question.

What language? If it's C++, you're loading x (which is presumably of type complex), but you're querying x2 (which is of entirely unknown type). If it's something else, then how does x2 relate to x?

Even better questions to answer would be:

* How is x[i] stored?
* What is it's internal structure?
* Is x of an intrinsic type, or is a library type? (note: in C++
the complex type is a library class defined in the 'math' header
file; in Scilab (and Matlab, I think) all numbers are stored as
matrices of complex -- real scalars are just a special case).
* What does the compiler (or interpreter, or compiler+library) do
with 'x ='; what do they do when you attempt to print x?

If you answer these questions, then you should have no trouble answering your questions, and all related ones, on your own.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html
.



Relevant Pages

  • Re: Sample data log code for DSP?
    ... One often needs multiple tries to get the right answer -- one of the things one learns from newsgroups is how ambiguous any written language really is. ... Most manufacturers put all that sort of data up on their sites, so if Richard's suggestion hasn't lead you to it a good swing through the mfgr. ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.dsp)
  • Re: PLD suggestions for classroom use
    ... As the class size has outgrown my Spartan boards and I feel that a ... modern FPGA is overkill for the simple circuits they are building, ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.arch.fpga)
  • Re: error detection rate with crc-16 CCITT
    ... dynamically determine the fastest baud rate we can use by checking the ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.arch.embedded)
  • Re: West African AIDS sufferer accuses Dominique Strauss-Kahn of rape!
    ... A woman who doesn't fight hard enough is complicit in her own rape? ... So, he's been accused of rape, he's a reasonable to extreme flight risk, and the DA is asking for no bail. ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (rec.crafts.metalworking)
  • Re: Coherent sampling with IF Freq
    ... to the spacing between the tones in the signal? ... The IF is usually decided by the system designer, although there are popular ones that make it easy to get parts. ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.dsp)