discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] complex vector output of a block


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] complex vector output of a block
Date: Wed, 9 Jun 2010 18:01:03 -0400

On Wed, Jun 9, 2010 at 5:37 PM, Sammour <address@hidden> wrote:
>
> HI Eric,
>
> Thanks for replying. My block has N=2:12 complex input streams and one
> complex vector output stream of length N^2 (represents a reshaped NxN
> matrix). The block basically is meant to calculate the covariance matrix
> using a MATLAB library.
>
> The signatures are:
> input: gr_make_io_signature (2, 2, sizeof(gr_complex));
> output: gr_make_io_signature (1, 1,N*N*sizeof(gr_complex));
>
> However, the last thing I reached now is that I can get the output into a
> file sink but when displaying the content, I see the N^2 elements followed
> by a huge number of zeros then N^2 elements and then zeros. For example if N
> = 2 input streams, the output vector will appear like:
> a
> b
> c
> d
> 0
> 0
> 0
> ....
> e
> f
> g
> h
> 0
> 0
> 0... and so on.
>
> A remark I noticed is that difference between "a" and "e" is always around
> 4096. What confuses me is how to get rid of the zeros and extract only the
> numbers of interest when connecting this block to the next block. Any hint?
>
> Best regards,
>
> Sam
> --
> View this message in context: 
> http://old.nabble.com/complex-vector-output-of-a-block-tp28828557p28836135.html
> Sent from the GnuRadio mailing list archive at Nabble.com.

You're almost certainly not returning the correct number of items or
telling the schedule the correct number you are consuming. From my
very quick thinking about this (i.e., I'm probably wrong), you need N
inputs from each input stream to produce and N*N vector output stream.
They way you set up the io_signatures, you are telling the scheduler
that each output item is N*N complex floats long. Therefore, this acts
as a N-to-1 decimation block. Are you inheriting from
gr_sync_decimator or gr_sync_block? It should be the former with N as
the decimation rate. Then, when you return the number of items you've
created (the number of NxN matrices), you've taken care of your cases.

Tom



reply via email to

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