discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Question regarding multiple flow graphs in tx_vo


From: Milo Wong
Subject: Re: [Discuss-gnuradio] Question regarding multiple flow graphs in tx_voice.py
Date: Mon, 24 Aug 2009 14:07:13 -0700

Dear Johnathan,

Not figured out yet. I read over the code again and I found the packages are sent in this way:(The notes are added by myself)

def main():
        ......
        packet = tb.audio_rx.get_encoded_voice_packet()  ####  packet: my_top_block -> audio_rx -> get_encoded_voice_packet() -> gr.msg_queue().delete_head().  refer to gr.msg_queue().delete_head().... #####
        s = packet.to_string()    ##### convert to string to send diiferent from the type of int 16bits in OFDM example)
        send_pkt(s)   #### send the package
......

Why packages are generated from gr.msg_queue(), not "packet_sink" which is the end of "audio_rx"? The packages going to be sent should be the encoded GSM symbol, right? Below is the description of function "get_encoded_voice_packet" which I am not quite understand, could you please help me? Thank you for your help.

class audio_rx(gr.hier_block2):
        def __init__(self, audio_input_dev):
        ........
        self.packets_from_encoder = gr.msg_queue()     ####  why gr.msg_queue() ????
        ........

        def get_encoded_voice_packet(self):
                return self.packets_from_encoder.delete_head()   ####  ????


Thank you,

Milo




On Mon, Aug 24, 2009 at 11:33 AM, Johnathan Corgan <address@hidden> wrote:
Did you ever get this figured out?

On Thu, Aug 20, 2009 at 11:00, Milo Wong<address@hidden> wrote:
> Hi all,
>
> I am working on tx_voice.py and I got something I don't quite understand:
> As I know that audio_rx samples from audio source and applies GSM encoding
> with 33bit packages outputs, but there's no connection between txpath and
> audio_rx. How could 33bits packages be sent to the transmit path? What's the
> purpose of using multiple flow graphs here? Below is the code FYI.
>
> ------------------------------Part of
> tx_voice.py-----------------------------------------------
> class audio_rx(gr.hier_block2):                      ### get voice samples
> from audio source input
>     def __init__(self, audio_input_dev):
>     gr.hier_block2.__init__(self, "audio_rx",
>                 gr.io_signature(0, 0, 0), # Input signature
>                 gr.io_signature(0, 0, 0)) # Output signature
>         sample_rate = 8000  ###Change to 44100 next time
>         src = "" audio_input_dev) ### samples from
> audio source
>         ............
>         self.connect(src, src_scale, f2s, voice_coder, packet_sink)
>
>     def get_encoded_voice_packet(self):
>         return self.packets_from_encoder.delete_head()
>
>
> class my_top_block(gr.top_block):
>
>     def __init__(self, modulator_class, options):
>         gr.top_block.__init__(self)
>         self.txpath = usrp_transmit_path.usrp_transmit_path(modulator_class,
> options)
>         self.audio_rx = audio_rx(options.audio_input)
>     self.connect(self.txpath)                   ###########No connection
> ###########
>     self.connect(self.audio_rx)                #############   Here!
> ###########
>
> .......................
> ---------------------------------------------------------------------------------------------------------
>
> Thanks for all the help,
>
> Sincerely,
>
> Yuan
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>


reply via email to

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