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

2010-06-13 Thread Sammour
Well, I think I used io_signature correctly. And, as I am using gr_sync_block, I dont need to worry about forecast, set_output_multiple or gr_sync_decimator. (I hope this understanding is correct?!) I have read the " how to write a block" and followed what's in there, but if you guide me to bette

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

2010-06-12 Thread Eric Blossom
On Sat, Jun 12, 2010 at 03:40:21PM -0700, Sammour wrote: > > Thanks for everyone, I sorted the problem out. I needed to increment "out" > after memcpy and then return noutput_items/(N*N). > > Cheers, > Sam OK. Glad you (think) you solved your problem. Given that your block was asked to compute

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

2010-06-12 Thread Sammour
4.000e+00 >4.000e+00 >4.000e+00 >4.000e+00 >0.0000000e+00 >0.000e+00 >0.000e+00 >0.000e+00 >0.000e+00 >0.000e+00 > > I hope the situation is now clearer. > > Cheers, > Sam >

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

2010-06-09 Thread Samy Sammour
gr_complex *) output_items[0]; gr_complex out_vector [N*N]; const gr_complex *in[N]; for (unsigned int i = 0; i To: samy-1...@live.com; g...@toad.com > Subject: Re: [Discuss-gnuradio] complex vector output of a block > Date: Wed, 9 Jun 2010 16:49:15 -0700 > From: g...@toad

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

2010-06-09 Thread Sammour
Tom, I only need a single sample from each stream to generate the vector ( there is a method of doing this in signal processing) and I am inherting from gr_sync_block as the block is 1:1. I am also returning noutput_items and didn't use consume_each() of course. Thanks anyway. Still thinking :)

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

2010-06-09 Thread Tom Rondeau
On Wed, Jun 9, 2010 at 5:37 PM, Sammour 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

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

2010-06-09 Thread Sammour
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 (

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

2010-06-09 Thread Eric Blossom
On Wed, Jun 09, 2010 at 03:40:07AM -0700, Sammour wrote: > > Dear all, > > I'm writing a block that outputs a vector of complex number inheriting from > gr_sync_block. In my code I wrote: > gr_complex *out =(gr_complex *) output_items[0]; > gr_complex out_vector [N*N]; > > where out_

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

2010-06-09 Thread Sammour
Thanks again Martin. I believe the problem is not in the algorithm as I actually tested it and can print the output of it on the screen as you suggested (I mean "out" in my original post). Everything excellent at this stage. However, the problem is that the block in GRC doesn't generate output.

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

2010-06-09 Thread Martin Braun
On Wed, Jun 09, 2010 at 06:06:01AM -0700, Sammour wrote: > Thanks for replying. N is designed to be 2:12. > The block uses a number of inputs (N) to update a matrix that I am sending > to the output as a vector that will be reshaped in the next block when it > is used. Do you think that my progra

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

2010-06-09 Thread Sammour
To isolate the problem, I removed all the complex code and wrote the following in work() to generate a vector of random numbers: gr_complex *out =(gr_complex *) output_items[0]; unsigned int index = 0; for (unsigned int m =1; m<=4; m++) { *(out+inde

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

2010-06-09 Thread Sammour
Dear Martin, Thanks for replying. N is designed to be 2:12. The block uses a number of inputs (N) to update a matrix that I am sending to the output as a vector that will be reshaped in the next block when it is used. Do you think that my programme takes much time to execute? Cheers, Sam --

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

2010-06-09 Thread Martin Braun
On Wed, Jun 09, 2010 at 03:40:07AM -0700, Sammour wrote: > Dear all, > > I'm writing a block that outputs a vector of complex number inheriting from > gr_sync_block. In my code I wrote: > gr_complex *out =(gr_complex *) output_items[0]; > gr_complex out_vector [N*N]; > > where out_vec

[Discuss-gnuradio] complex vector output of a block

2010-06-09 Thread Sammour
Dear all, I'm writing a block that outputs a vector of complex number inheriting from gr_sync_block. In my code I wrote: gr_complex *out =(gr_complex *) output_items[0]; gr_complex out_vector [N*N]; where out_vector is the array where the actual output values are stored. I copied