discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] information regarding the code


From: Ravichandran_Shivakumar
Subject: [Discuss-gnuradio] information regarding the code
Date: Thu, 9 Jun 2005 09:16:47 +0530

Hi folks,
        I went through this SSB implementation code and I have certain doubts….
I need to what is USRP_INTERP and why he has taken it as 80 and also USRP_DUC
I also would like to know whether we can implement MIMO(Multiple i/p and multiple o/p)
What is FIR_INTERP and how exactly it is calculated??
And also the lpf1_taps which is present and also about the function gr.firdes.low_pass
 
Pl can anyone help me in this regard as this would help my ongoing project…
 
#!/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

Ravi chandran

 

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated..


reply via email to

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