Forum: GNU Radio forecast and set history function for haar decomposition

38cce7c8e6ff3ff19c3b82fcbfe07338?d=identicon&s=25 Bharat Mukkala (Guest)
on 2013-10-23 08:12
(Received via mailing list)
I am creating a new gnu radio block for decomposing the signal using
haar
wavelet decompostion and includes the option of number of levels of
decompostion.
In order to write the code, how should i set the set_history or forecast
function because in order to produce output the input signal should be
processed as a whole rather than in chunks.



--
View this message in context:
http://gnuradio.4.n7.nabble.com/forecast-and-set-h...
Sent from the GnuRadio mailing list archive at Nabble.com.
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-10-23 10:07
(Received via mailing list)
On Tue, Oct 22, 2013 at 11:10:54PM -0700, Bharat Mukkala wrote:
> I am creating a new gnu radio block for decomposing the signal using haar
> wavelet decompostion and includes the option of number of levels of
> decompostion.
> In order to write the code, how should i set the set_history or forecast
> function because in order to produce output the input signal should be
> processed as a whole rather than in chunks.

This seems to be a case of set_output_multiple() rather than forecast()
(the i/o ratio is still a constant, right?).

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
38cce7c8e6ff3ff19c3b82fcbfe07338?d=identicon&s=25 Bharat Mukkala (Guest)
on 2013-10-23 12:24
(Received via mailing list)
the i/o ratio is 1 since the number of input items is same the number of
output items, but while processing we use the whole signal but not a
single
element while calculating the output elements, i have doubt in figuring
out
how to tell that to gnuradio,my idea is that, can i set_output_multiple
to
ninput_items_required and then do processing.
thank you



--
View this message in context:
http://gnuradio.4.n7.nabble.com/forecast-and-set-h...
Sent from the GnuRadio mailing list archive at Nabble.com.
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-10-23 13:48
(Received via mailing list)
On Wed, Oct 23, 2013 at 03:23:36AM -0700, Bharat Mukkala wrote:
> the i/o ratio is 1 since the number of input items is same the number of
> output items, but while processing we use the whole signal but not a single
> element while calculating the output elements, i have doubt in figuring out
> how to tell that to gnuradio,my idea is that, can i set_output_multiple to
> ninput_items_required and then do processing.
> thank you

You can only set_output_multiple before work starts, usually in the
constructor. So you set_output_multiple such that you can process the
entire signal at once, and make your block a gr::sync_block.

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
C539637020fd56193dd6daec746c4a84?d=identicon&s=25 Tom Rondeau (Guest)
on 2013-10-23 15:51
(Received via mailing list)
On Wed, Oct 23, 2013 at 7:47 AM, Martin Braun (CEL)
<martin.braun@kit.edu> wrote:
> entire signal at once, and make your block a gr::sync_block.
>
> MB

Bharat,

Have you looked at the wavelet_ff block in gr-wavelet? It might do
what you want already or is at least close.

Also, since a wavelet is very much like a decimating fir filter, I'm
not sure output_multiple is the right thing to do. I think setting the
history for the length of the wavelet coefficients should be adequate.
Check out my overview of the scheduler for some details on what
history does:

http://www.trondeau.com/blog/2013/9/15/explaining-...

Tom
38cce7c8e6ff3ff19c3b82fcbfe07338?d=identicon&s=25 Bharat Mukkala (Guest)
on 2013-10-23 19:34
(Received via mailing list)
its true that setting the history to length of coefficients work, but
when we
go for more than 1 level of decomposition, the output from previous
level
will be used , so how can is use the output again ?
i have another doubt , if we set the size of each element in the input
signature to be 4*sizeof(float) and size of each output element to be
4*sizeof(float)  in a gr::sync_block, then in the work function , how
each
element will be handled, (is it like 4 input items of size float), also
please tell me how to use them.
thank you




--
View this message in context:
http://gnuradio.4.n7.nabble.com/forecast-and-set-h...
Sent from the GnuRadio mailing list archive at Nabble.com.
C539637020fd56193dd6daec746c4a84?d=identicon&s=25 Tom Rondeau (Guest)
on 2013-10-24 16:16
(Received via mailing list)
On Wed, Oct 23, 2013 at 1:33 PM, Bharat Mukkala
<bharatmukkala@yahoo.co.in> wrote:
> its true that setting the history to length of coefficients work, but when we
> go for more than 1 level of decomposition, the output from previous level
> will be used , so how can is use the output again ?

Seems to me like you'll need to keep that state inside the object.

> i have another doubt , if we set the size of each element in the input
> signature to be 4*sizeof(float) and size of each output element to be
> 4*sizeof(float)  in a gr::sync_block, then in the work function , how each
> element will be handled, (is it like 4 input items of size float), also
> please tell me how to use them.
> thank you

Look at some of the other blocks where a vector length is specified.
gr-blocks/lib/float_to_short_impl.cc might be a good one to look at.
The vlen used here means that each item is of size vlen times the size
of a float (on the input stream). If vlen=4, each item is composed of
4 floats. So if 'float *in = (float*)input_items[0]', then it has a
length of ninput_items[0]*4. You can index the array from 0 to
(ninput_items[0]*4 - 1).

Tom
38cce7c8e6ff3ff19c3b82fcbfe07338?d=identicon&s=25 Bharat Mukkala (Guest)
on 2013-10-25 15:06
(Received via mailing list)
thanks , and i have created the block ,which is working fine (but it is
slow
for signals of larger size)




--
View this message in context:
http://gnuradio.4.n7.nabble.com/forecast-and-set-h...
Sent from the GnuRadio mailing list archive at Nabble.com.
38cce7c8e6ff3ff19c3b82fcbfe07338?d=identicon&s=25 Bharat Mukkala (Guest)
on 2013-11-07 14:52
(Received via mailing list)
i got a new problem.. when i am working with signals, i converted them
to
vectors using stream to vectors, then the vectors are given as input to
my
block (since my block has an input as vectors of fixed length) , then
processing is done on the vector, output is also a vector .. but the
problem
is that there is delay in processing the each vector.. and i declared my
i/o
signature as follows:

i/p signature              sizeof(float)*vec_len
o/p signature             sizeof(float)*vec_len

when is plot the output, it is not exactly delay because some unwanted
plot
is occurring and again my  ouput is being plotted... i can post my code
if u
need it...

thanks ...



--
View this message in context:
http://gnuradio.4.n7.nabble.com/forecast-and-set-h...
Sent from the GnuRadio mailing list archive at Nabble.com.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.