/* -*- c++ -*- */ /* * Copyright 2018 <+YOU OR YOUR COMPANY+>. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "chaotic_prefix_bc_impl.h" namespace gr { namespace chaos { chaotic_prefix_bc::sptr chaotic_prefix_bc::make(float init, float parameter, unsigned int header_len, const std::string &len_tag_key) { return gnuradio::get_initial_sptr (new chaotic_prefix_bc_impl(init, parameter, header_len, len_tag_key)); } /* * The private constructor */ chaotic_prefix_bc_impl::chaotic_prefix_bc_impl(float init, float parameter, unsigned int header_len, const std::string &len_tag_key) : gr::tagged_stream_block("chaotic_prefix_bc", gr::io_signature::make(1, 1, sizeof(char)), gr::io_signature::make(1, 1, sizeof(gr_complex)), len_tag_key), d_init(init), d_parameter(parameter), d_header_len(header_len) { set_tag_propagation_policy(TPP_DONT);// dont propagate tags } /* * Our virtual destructor. */ chaotic_prefix_bc_impl::~chaotic_prefix_bc_impl() { } std::vector chaotic_prefix_bc_impl::Logistic_map(float init, float parameter, unsigned int seq_len) { //float parameter=3.62; std::vector chaotic_seq; chaotic_seq.push_back(init); float x_nn; float sum=d_init; for (int i=1;imaxabs) { maxabs=std::abs(chaotic_seq[i]); } } for (int i=0;i chaotic_float=Logistic_map(d_init, d_parameter, d_header_len); std::vector chaotic_complex; for (int i=0;i *p=&chaotic_complex; memcpy((void *)out,&chaotic_complex[0],d_header_len*sizeof(gr_complex)); out+=d_header_len; // Do <+signal processing+> noutput_items=d_header_len; // Tell runtime system how many output items we produced. return noutput_items; } } /* namespace chaos */ } /* namespace gr */