On Feb 1, 2008 10:48 AM, George N. [email protected] wrote:
Let me step all the way back and just try to be a little clearer with
what I’m trying to do.
I’m trying to simulate the frequency offset added by the crystal
oscillator in the USRP. 64MHz*20ppm/1e6=1280Hz max, +/- ?
So, I’m trying to add this frequency offset to a modulated GMSK signal.
I believe the proper solution, which Brian suggested to me, is too
upconvert and then downconvert to add the frequency offset.
Sorry, bad advice - an easier way to do this would just do a complex
mult against your frequency offset signal.
But, is it possible to just use gr_rotator to apply the frequency offset
instead by setting the phase equal to offset/sampling_rate2pi ? If
I’m simulating the USRP at 1Msps with 2 samples per symbol, I think I
would set it to 1280Hz/500KHz2pi.
http://gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/lib/filter/gr_rotator.h
But, I’m not entirely sure this is accomplishing what I want to.
Try this:
lfsr = gr.lfsr_32k_source_s( )
mod = gmsk_mod( self, 2 )
offset = gr.sig_source_c( 500e3, gr.GR_COS_WAVE, 100, 1.0, 0+0j
)
mixer = gr.multiply_cc( )
s_to_f = gr.short_to_float( )
f_to_char = gr.float_to_char( )
self.connect( lfsr, s_to_f )
self.connect( s_to_f, f_to_char )
self.connect( f_to_char, mod.head )
self.connect( mod.tail, (mixer,0) )
self.connect( offset, (mixer,1))
self.connect( mixer, self.cscope )
This connects an LFSR up to the modulator input, but you get the idea.
You have a phasor being your offset slowly rotating your signal at a
rate of 100Hz.
I believe this will model the frequency offsets properly.
Brian