Share via

complex signal

fdss fssd 1 Reputation point
2022-01-02T19:09:21.913+00:00

hello i would like to ask how to generate the complex signal f(t)=exp^(jomegat), j=sqrt(-1), in C++. thanks very much.

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,296 Reputation points Microsoft External Staff
    2022-01-03T02:18:50.087+00:00

    Hi @fdss fssd ,

    I suggest you read this official document, which contains functions, operators and classes. The content of the document is more comprehensive.

    I wrote a sample for your reference, hope it helps.

    #include <iostream>  
    #include <complex>  
    using namespace std;  
    complex <double>  f(double t)  
    {  
      
         complex <double>j = sqrt(-1);   
         complex <double>i = exp (j * 1.0 * t);  
         return i;  
          
    }  
    int main()  
    {  
          
    }  
    

    Best regards,

    Elya


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.