diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d5a4ed..4871c8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,10 +34,7 @@ list(APPEND inspectrum_sources fft.cpp frequencydemod.cpp mainwindow.cpp - grsamplebuffer.cpp inputsource.cpp - memory_sink_impl.cc - memory_source_impl.cc plot.cpp plots.cpp plotview.cpp @@ -54,15 +51,10 @@ list(APPEND inspectrum_sources INCLUDE(FindPkgConfig) find_package(Qt5Widgets REQUIRED) -find_package(Boost COMPONENTS system program_options REQUIRED) -set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FILTER PMT) -find_package(Gnuradio REQUIRED) pkg_check_modules(FFTW REQUIRED fftw3f) find_package(Liquid REQUIRED) include_directories( - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ${QT_INCLUDES} ${FFTW_INCLUDEDIR} ${FFTW_INCLUDE_DIRS} @@ -77,8 +69,6 @@ add_executable(inspectrum ${inspectrum_sources}) qt5_use_modules(inspectrum Widgets Concurrent) target_link_libraries(inspectrum - ${Boost_LIBRARIES} - ${GNURADIO_ALL_LIBRARIES} ${QT_LIBRARIES} ${FFTW_LIBRARIES} ${LIQUID_LIBRARIES} diff --git a/README.md b/README.md index 019018d..158e2a6 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ inspectrum is a tool for analysing captured signals, primarily from software-def ## Try it ### Prerequisites - * boost >=1.35 - * gnuradio 3.7.x * qt5 * fftw 3.x * cmake diff --git a/grsamplebuffer.cpp b/grsamplebuffer.cpp deleted file mode 100644 index 0b74c61..0000000 --- a/grsamplebuffer.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#include "grsamplebuffer.h" - -template -void GRSampleBuffer::work(void *input, void *output, int length, off_t sampleid) -{ - mem_source->set_source(input, length, sampleid); - mem_sink->set_sink(output, length); - tb->run(); -} - -template class GRSampleBuffer, std::complex>; -template class GRSampleBuffer, float>; -template class GRSampleBuffer; diff --git a/grsamplebuffer.h b/grsamplebuffer.h deleted file mode 100644 index c088f29..0000000 --- a/grsamplebuffer.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#pragma once - -#include -#include -#include "memory_sink.h" -#include "memory_source.h" - -#include "samplebuffer.h" - -template -class GRSampleBuffer : public SampleBuffer -{ -private: - gr::top_block_sptr tb; - gr::blocks::memory_source::sptr mem_source; - gr::blocks::memory_sink::sptr mem_sink; - -public: - GRSampleBuffer(SampleSource *src, gr::top_block_sptr tb, gr::blocks::memory_source::sptr mem_source, gr::blocks::memory_sink::sptr mem_sink) - : SampleBuffer(src), tb(tb), mem_source(mem_source), mem_sink(mem_sink) {}; - virtual void work(void *input, void *output, int count, off_t sampleid); -}; diff --git a/memory_sink.h b/memory_sink.h deleted file mode 100644 index afcd2cb..0000000 --- a/memory_sink.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#ifndef INCLUDED_GR_MEMORY_SINK_H -#define INCLUDED_GR_MEMORY_SINK_H - -#include -#include - -namespace gr -{ -namespace blocks -{ -class memory_sink : virtual public sync_block -{ -public: - typedef boost::shared_ptr sptr; - - static sptr make(size_t itemsize); - - virtual void set_sink(void *sink, size_t length) = 0; -}; - -} /* namespace blocks */ -} /* namespace gr */ - -#endif /* INCLUDED_GR_MEMORY_SINK_H */ \ No newline at end of file diff --git a/memory_sink_impl.cc b/memory_sink_impl.cc deleted file mode 100644 index 7d57c3e..0000000 --- a/memory_sink_impl.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#include "memory_sink_impl.h" -#include -#include - -namespace gr { - namespace blocks { - - memory_sink::sptr - memory_sink::make(size_t itemsize) - { - return gnuradio::get_initial_sptr - (new memory_sink_impl(itemsize)); - } - - memory_sink_impl::memory_sink_impl(size_t itemsize) - : sync_block("memory_sink", - io_signature::make(1, 1, itemsize), - io_signature::make(0, 0, 0)), - d_itemsize(itemsize) - { - } - - memory_sink_impl::~memory_sink_impl() - { - } - - void - memory_sink_impl::set_sink(void *sink, size_t length) - { - d_sink = sink; - d_length = length; - d_ptr = 0; - } - - int - memory_sink_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - char *inbuf = (char*)input_items[0]; - long nwritten = 0; - - if(!d_sink) - return noutput_items; - - nwritten = std::min((long)(d_length - d_ptr), (long)noutput_items); - if (nwritten >= 0) { - memcpy((char*)d_sink + d_ptr * d_itemsize, inbuf, nwritten * d_itemsize); - } - d_ptr += nwritten; - - return (nwritten == 0) ? -1 : nwritten; - } - - } /* namespace blocks */ -} /* namespace gr */ diff --git a/memory_sink_impl.h b/memory_sink_impl.h deleted file mode 100644 index c2fdac5..0000000 --- a/memory_sink_impl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#ifndef INCLUDED_GR_MEMORY_SINK_IMPL_H -#define INCLUDED_GR_MEMORY_SINK_IMPL_H - -#include "memory_sink.h" - -namespace gr -{ -namespace blocks -{ - -class memory_sink_impl : public memory_sink -{ -private: - size_t d_itemsize; - void *d_sink; - size_t d_length; - size_t d_ptr = 0; - -public: - memory_sink_impl(size_t itemsize); - ~memory_sink_impl(); - - void set_sink(void *sink, size_t length); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -} /* namespace blocks */ -} /* namespace gr */ - -#endif /* INCLUDED_GR_MEMORY_SINK_IMPL_H */ \ No newline at end of file diff --git a/memory_source.h b/memory_source.h deleted file mode 100644 index 81a6b5e..0000000 --- a/memory_source.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#ifndef INCLUDED_GR_MEMORY_SOURCE_H -#define INCLUDED_GR_MEMORY_SOURCE_H - -#include -#include - -namespace gr -{ -namespace blocks -{ -class memory_source : virtual public sync_block -{ -public: - typedef boost::shared_ptr sptr; - - static sptr make(size_t itemsize); - - virtual void set_source(void *source, size_t length, uint64_t sampleid) = 0; -}; - -} /* namespace blocks */ -} /* namespace gr */ - -#endif /* INCLUDED_GR_MEMORY_SOURCE_H */ \ No newline at end of file diff --git a/memory_source_impl.cc b/memory_source_impl.cc deleted file mode 100644 index b1786c6..0000000 --- a/memory_source_impl.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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 program. If not, see . - */ - -#include "memory_source_impl.h" -#include -#include - -namespace gr { - namespace blocks { - - memory_source::sptr - memory_source::make(size_t itemsize) - { - return gnuradio::get_initial_sptr - (new memory_source_impl(itemsize)); - } - - memory_source_impl::memory_source_impl(size_t itemsize) - : sync_block("memory_source", - io_signature::make(0, 0, 0), - io_signature::make(1, 1, itemsize)), - d_itemsize(itemsize) - { - } - - memory_source_impl::~memory_source_impl() - { - } - - void - memory_source_impl::set_source(void *source, size_t length, uint64_t sampleid) - { - d_source = source; - d_length = length; - d_ptr = 0; - d_sampleid = sampleid; - } - - int - memory_source_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - char *outbuf = (char*)output_items[0]; - long nwritten = 0; - - if(!d_source) - return noutput_items; - - if (d_ptr == 0) - add_item_tag(0, 0, pmt::string_to_symbol("block_start"), pmt::from_uint64(d_sampleid)); - - nwritten = std::min((long)(d_length - d_ptr), (long)noutput_items); - - if (nwritten >= 0) { - memcpy(outbuf, (char*)d_source + d_ptr * d_itemsize, nwritten * d_itemsize); - } - d_ptr += nwritten; - - return (nwritten == 0) ? -1 : nwritten; - } - - } /* namespace blocks */ -} /* namespace gr */ diff --git a/memory_source_impl.h b/memory_source_impl.h deleted file mode 100644 index 30f6cb4..0000000 --- a/memory_source_impl.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015, Mike Walters - * - * This file is part of inspectrum. - * - * This program 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 of the License, or - * (at your option) any later version. - * - * This program 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. - *ha - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INCLUDED_GR_MEMORY_SOURCE_IMPL_H -#define INCLUDED_GR_MEMORY_SOURCE_IMPL_H - -#include "memory_source.h" - -namespace gr -{ -namespace blocks -{ - -class memory_source_impl : public memory_source -{ -private: - size_t d_itemsize; - void *d_source; - size_t d_length; - size_t d_ptr = 0; - uint64_t d_sampleid; - -public: - memory_source_impl(size_t itemsize); - ~memory_source_impl(); - - void set_source(void *source, size_t length, uint64_t sampleid); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -} /* namespace blocks */ -} /* namespace gr */ - -#endif /* INCLUDED_GR_MEMORY_SOURCE_IMPL_H */ \ No newline at end of file diff --git a/plots.cpp b/plots.cpp index 1aa79f5..1de2770 100644 --- a/plots.cpp +++ b/plots.cpp @@ -19,10 +19,6 @@ #include #include -#include -#include "grsamplebuffer.h" -#include "memory_sink.h" -#include "memory_source.h" #include "threshold.h" #include "traceplot.h" diff --git a/plotview.cpp b/plotview.cpp index 145dfed..75789ec 100644 --- a/plotview.cpp +++ b/plotview.cpp @@ -18,6 +18,7 @@ */ #include "plotview.h" +#include #include #include #include diff --git a/spectrogramplot.h b/spectrogramplot.h index 4d8f47c..44d7ee0 100644 --- a/spectrogramplot.h +++ b/spectrogramplot.h @@ -22,7 +22,6 @@ #include #include #include "fft.h" -#include "grsamplebuffer.h" #include "inputsource.h" #include "plot.h" #include "tuner.h"