discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Re: [Discuss-gnuradio] Information regarding the code


From: shweta vishwakarma
Subject: Re: Re: [Discuss-gnuradio] Information regarding the code
Date: 15 Jun 2005 12:10:09 -0000

Hi,
Thanks a lot Ramakrishnan.
Sorry for not providing the code details. I am referring to the Weavers method SSB modulator code which is used on the USRP.Plzz refer this code below and plzz give me some solutions for the queries:

1. How to set the sampling rates for both AF and RF frequencies?
2. What are the factors on which the sampling rate depends in USRP?
3. Is this sampling rate is standard always or we can change according to our requirement?
4. How can we set the Target_freq?
5. How can we calculate the Transmitting and Receiving frequencies?
6. Is there any way to find out the RF out freq for a given input whether audio/vidio?
7. Can we change the IF bandwidth?
8. If we are taking an audio sampling rate of 8-48 KHz then wat are the things to be initialized? What are the frequencies to be set for single /multiple channels?
9. Why is the usrp_duc assigned the value 3.6 MHZ?
10. What is usrp.sink_c(0, usrp_interp) ? What it does? How to set its parameters? What are the dependencies of this function?
11. What is sink.set_tx_freq(0, usrp_duc)What it does? How he is setting the value to 3600 MHz? Is this standard or arbitary?What is the minimum and maximum range of the freq.?
12. What is sink.tx_freq(0) ? What it does? What is the freq range that we have to sent? What are the parameters to be passed?
13.  What is sink.sat_channels(1) ? What it does? Can we set 2 or more channels at a time? Any dependencies on this? What are the dependent channels on this if we are using 2 or more channels?
14. What is sink.set_mux(0x98) ? What it does? How can we set the  multiplexer? How can we decide this value? How can we set the mux for Tx and Rx for 2 channels?


<<<<Weavers method SSB Modulator>>>>

#!/usr/bin/env python
#
#                    Weaver SSB generation
#
#              af_loc                      rf_loc
#                |                          |
# [audio]=[f2c]--(x)-----[lpf1c]---[lpf2c]---(x)--[c2f]=(+)--- ssb out
#              af_mixc                    rf_mixc
#
#


from gnuradio import gr
from gnuradio import usrp
from gnuradio import audio
import sys

def build_graph ():

    usrp_interp = 80
    usrp_duc = 3600e3
    sink = usrp.sink_c (0, usrp_interp)
    print "requesting: ", usrp_duc, "hz"
    sink.set_tx_freq(0, usrp_duc)
# use usrp.tx_freq(0) to get actual freq, and use that
# to set rf_LO
    actual_freq = sink.tx_freq(0)
    print "got ", actual_freq, "hz"
    sink.set_nchannels(1)
    sink.set_mux(0x98)


    target_freq = 3615e3

    offset_freq = target_freq - actual_freq
    print "Offset freq:", offset_freq

    af_LO = 1.8e3
    # set s = 1 for LSB, s = -1 for USB
    s = 1
    rf_LO = s * ( offset_freq - ( s * af_LO ))
    print "rf_LO: ", rf_LO

    af_sample_rate = 32000
    rf_sample_rate = 1600000
    fir_interp = rf_sample_rate / af_sample_rate
    print "fir_interp: ", fir_interp

    fg = gr.flow_graph ()
   
# transmit an audio file:
#    audio_file = gr.file_source (gr.sizeof_short, "x-1_b32.sw",1)
#    audio_conv = gr.short_to_float()
#    src = ""> #    fg.connect(audio_file, audio_conv)
#    fg.connect(audio_conv, src)

# microphone/line-in source:
    src_mic = audio.source(af_sample_rate)
    src = "">     fg.connect (src_mic, src)

# two-tone test:
#    src1 = gr.sig_source_f (af_sample_rate,gr.GR_SIN_WAVE,1400,1,0)
#    src = "" (af_sample_rate,gr.GR_SIN_WAVE,440,1,0)
#    src = ""> #    fg.connect (src1, (src, 0))
#    fg.connect (src2, (src, 1))

    f2c = gr.float_to_complex()

    af_loc = gr.sig_source_c (af_sample_rate,gr.GR_COS_WAVE,af_LO,1,0)

    af_mixc = gr.multiply_cc ()

    lpf1_taps = gr.firdes.low_pass ( \
          1.0, af_sample_rate, 1.8e3, 600, gr.firdes.WIN_HAMMING)
    lpf1c = gr.fir_filter_ccf (1, lpf1_taps)

    lpf2_taps = gr.firdes.low_pass ( \
          1.0, rf_sample_rate, 5e3, 10e3, gr.firdes.WIN_HAMMING)
    lpf2c = gr.interp_fir_filter_ccf (fir_interp, lpf2_taps)

    rf_loc = gr.sig_source_c (rf_sample_rate,gr.GR_COS_WAVE,rf_LO,2,0)

    rf_mixc = gr.multiply_cc ()

    c2f = gr.complex_to_float()

    sum = gr.add_ff ()
    scale = gr.multiply_const_ff(40 * 500)
    hilbert = gr.hilbert_fc(197)

#    out = gr.file_sink (gr.sizeof_short, "ssb_mod")

    fg.connect (src, (f2c, 0))
    fg.connect (src, (f2c, 1))
    fg.connect (f2c, (af_mixc, 0))
    fg.connect (af_loc, (af_mixc, 1))
    fg.connect (af_mixc, lpf1c)
    fg.connect (lpf1c, lpf2c)
    fg.connect (lpf2c, (rf_mixc, 0))
    fg.connect (rf_loc, (rf_mixc, 1))
    fg.connect (rf_mixc, c2f)
    fg.connect ((c2f, 0), (sum, 0))
    fg.connect ((c2f, 1), (sum, 1))

    fg.connect (sum, scale)
    fg.connect (scale, hilbert)
    fg.connect (hilbert, sink)

    return fg

def main ():

    fg = build_graph ()

    fg.start ()     
    raw_input ('Press Enter to quit: ')
    fg.stop ()

if __name__ == '__main__':
    main ()






regards

Shweta
 


On Mon, 13 Jun 2005 Ramakrishnan Muthukrishnan wrote :
>Hi,
>
>Which code are you refering to? Please do provide more details on the
>code. Otherwise it is too difficult to understand what you are
>refering to and what you are currently reading. That's the reason, why
>you didn't get any replies to your original email.
>
>Thanks
>Ramakrishnan
>
>On 13 Jun 2005 05:23:59 -0000, shweta  vishwakarma
><address@hidden> wrote:
> >
> >
> >  Hi,
> >  Please let me know the following queries related to SSB implementation
> > code:
> >  >
> >  > 1. How to set the sampling rates for both AF and RF frequencies?
> >  > 2. What are the factors on which the sampling rate depends in USRP?
> >  > 3. Is this sampling rate is standard always or we can change according
> >  > to our requirement?
> >  > 4. How can we set the Target_freq?
> >    5. How can we calculate the Transmitting and Receiving frequencies?
> >  >
> >  > Thanks & Regards,
> >  > Shweta
> >
> >
> >
> >
> > _______________________________________________
> > Discuss-gnuradio mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> >
> >
> >
>
>
>--
>  73 - Ramakrishnan, VU3RDD




reply via email to

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