discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Storing A/D samples in memory.........


From: Martin Dvh
Subject: Re: [Discuss-gnuradio] Storing A/D samples in memory.........
Date: Thu, 19 Jul 2007 23:25:31 +0200
User-agent: Icedove 1.5.0.12 (X11/20070607)

Kshitij Kumar Singh wrote:
> As a part of some research work on cooperative communications in wireless
> networks, I had decided to use
> the USRP as one the of my implementation platforms. I used the tutorials by
> D. Shen as a reference. There are, however , some  specific problems I need
> help with :
> ---------------------------------------------------------------------------------------
> 
>  I need to store the received signal A/D samples (before all the
> post-demod  processing stuff takes place) in memory and to correlate them
> with similar samples stored somewhere else in memory. Once this initial
> processing is done, I can move on to the demod part. The sample
> storage/correlation  part is where I am
> getting stuck time and again.  Is  there some specific block I am  going to
> need or do I need to write my own signal processing block from scratch?
>                  I tried looking in the mailing list archives but couldn't
> find  anything similar. Kindly point to any suitable reference on this
> topic
> I may have overlooked.

You will probably want to write your own block.
If you have to correlate over a small range sjust use a direct implementation.
If you want to corrlate over a large range you probably want to use FFT for that

I have been working with the gr-radar code a while back.
This uses offline samples (stored to disk) and processes it in a standalone 
application.
(Not using gnuradio flowgraph)

You can find some correlation examples in the gr-radar code in svn.
I don't remember if the standard code used FFt or not.

I have much more complicated experimental code (using special case overlap-add 
FFTS) If you need that.

(I would advice to first understand the standard code)

I also have been doing correlation realtime using standard blocks and gnuradio 
flowgraphs.

Below will give you an idea.

        src0=some complex source
        src1=some second complex source to correlate with
        dst_float=gr.file_sink(gr_size_of_float*fft_size,filename)
        dst_complex=gr.file_sink(gr_size_of_complex*fft_size,filename)

        s2p0 = gr.serial_to_parallel(gr.sizeof_gr_complex, fft_size) #make the 
data blockbased
        fft0 = gr.fft_vcc(fft_size, True, True)                      #take the 
fft of a block of data to go to freq domain
        s2p1 = gr.serial_to_parallel(gr.sizeof_gr_complex, fft_size) #make the 
data block_based
        fft1 = gr.fft_vcc(fft_size, True, True)                      #go to 
freq domain
        conj1=gr.conjugate_cc()                                      #take the 
conjugate to do correlation
                                                                     #if you 
leave out this step you will do concolution

        mult=gr.multiply_cc()                                        #correlate 
in the freq domain
        ifft=gr.fft_vcc(fft_size, False, True)                       #convert 
back to the time domain using inverse FFT
        c2mag = gr.complex_to_mag(fft_size)                          #take the 
magnitude of the complex values

        fg.connect(src0,s2p,fft0)                                    #make the 
data blockbased
        fg.connect(src1,s2p,fft1)                                    #make the 
data blockbased
        fg.connect(fft1,conj1)                                       #take the 
conjugate to do correlation
                                                                     #if you 
leave out this step you will do concolution

        fg.connect(fft0,(mult,0))                                    #correlate 
in the freq domain
        fg.connect(conj1,(mult,1))                                   #correlate 
in the freq domain
        fg.connect(mult,ifft)                                        #convert 
back to the time domain using inverse FFT
        fg.connect(mult,c2mag)                                       #take the 
magnitude of the complex values

        fg.connect(mult,dst_complex) #every output element is an block_array 
(size=fft_size) of complex correlation values
        fg.connect(c2mag,dst_float)  #every output element is an block_array 
(size=fft_size) of float correlation magnitude values



I hope this helps,
Martin

> ---------------------------------
> 
> Sincerely,
> Kshitij
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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]