discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] User Generated Signals


From: Syed Faisal Shah
Subject: Re: [Discuss-gnuradio] User Generated Signals
Date: Sat, 7 Apr 2007 17:03:03 -0500

Jonathan,

I am new to GNU radio as well but have been using the gr_sig_source_c class. This class generates a complex quadrature sinusoid with cosine(x) as real part and sine(x) as imaginary part. Doing some code hacking in gnuradio-core/src/lib/general/gr_sig_source_c.cc, you can see that irrespective of the input argument SIN_WAVE or COS_WAVE the program always calls 'sincos' method of class gr_fxpt_nco. Now, 'sincos' is defined as follows:

output[i]   = gr_complex(
gr_fxpt::cos (d_phase) * ampl, gr_fxpt::sin (d_phase) * ampl);

So, this is how you get cos in the real part and sin in the imaginary part. One word of caution here, the file gr_sig_source_c.cc is machine generated meaning it is generated by gr_sig_souce_x.t file. In case you would like to modify, do not modify .cc file rather change .t file.

I hope it will be helpful.

Regards

Faisal

> Also: why is the waveform of gr.sig_source_c(SIN_WAVE, offset = 0) a cosine wave? I got this by using gr.file_sink, and looking at the odd=real values. file_sink output = "REAL IMAG REAL IMAG .... "
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]