discuss-gnuradio
[Top][All Lists]
Advanced

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

OOT module output vector with different length from input vector itemsiz


From: Grace Yeung
Subject: OOT module output vector with different length from input vector itemsize mismatch
Date: Thu, 10 Aug 2023 12:44:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi,

I have an OOT module that takes in vectors of length A and outputs vectors of length C using the following:

Constructor:

my_module_impl::my_module_impl (int A, int C, ...)
    : gr::sync_block("my_module",
                     gr::io_signature::make(1, 1, A*sizeof(gr_complex)),
                     gr::io_signature::make(1, 1, C*sizeof(gr_complex)))
   

Work function:

    int my_module_impl::work(int noutput_items,
                                  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
    {
      const gr_complex* in = (const gr_complex*) input_items[0];
      gr_complex* out = (gr_complex*) output_items[0];
      int i;
     
      for (i = 0; i < noutput_items; i++) {

           ...
       
        memcpy(out, my_output, C*sizeof(gr_complex)); 
        in += A;
        out += C;
      }
     
      return(noutput_items);
...

At run time, I get a

ValueError: itemsize mismatch: my_module0:0 using 524264, vector_to_stream0:0 using 294912

where the first number 524264 is not what I am expecting it to be which should be the same as the second number. Specifically, A=65536 (524264=8*(A-3)) and C=36864 (294912=8C).

Am I doing everything correctly? Thanks!

Grace
-- 
Grace K. Yeung, MS
NorthWest Research Associates
301 Webster Street
Monterey, CA 93940
grace@nwra.com
https://www.nwra.com

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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