Skip to content

Commit f64b971

Browse files
committed
filter: work on creating gr-filter top-level component.
Builds but does not bring in libgnuradio-fft.so symbols.
1 parent a7afbf2 commit f64b971

21 files changed

+1098
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ add_subdirectory(gnuradio-core)
229229
add_subdirectory(grc)
230230

231231
add_subdirectory(gr-fft)
232+
add_subdirectory(gr-filter)
232233
add_subdirectory(gr-atsc)
233234
add_subdirectory(gr-audio)
234235
add_subdirectory(gr-comedi)

gr-filter/CMakeLists.txt

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Copyright 2012 Free Software Foundation, Inc.
2+
#
3+
# This file is part of GNU Radio
4+
#
5+
# GNU Radio is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
#
10+
# GNU Radio is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with GNU Radio; see the file COPYING. If not, write to
17+
# the Free Software Foundation, Inc., 51 Franklin Street,
18+
# Boston, MA 02110-1301, USA.
19+
20+
########################################################################
21+
# Setup dependencies
22+
########################################################################
23+
include(GrBoost)
24+
25+
########################################################################
26+
# Register component
27+
########################################################################
28+
include(GrComponent)
29+
30+
GR_REGISTER_COMPONENT("gr-filter" ENABLE_GR_FILTER
31+
ENABLE_GRUEL
32+
ENABLE_VOLK
33+
Boost_FOUND
34+
ENABLE_GR_CORE
35+
ENABLE_GR_FFT
36+
)
37+
38+
GR_SET_GLOBAL(FILTER_INCLUDE_DIRS
39+
${CMAKE_CURRENT_SOURCE_DIR}/lib
40+
${CMAKE_CURRENT_SOURCE_DIR}/include
41+
)
42+
43+
########################################################################
44+
# Begin conditional configuration
45+
########################################################################
46+
if(ENABLE_GR_FILTER)
47+
48+
########################################################################
49+
# Setup CPack components
50+
########################################################################
51+
include(GrPackage)
52+
CPACK_SET(CPACK_COMPONENT_GROUP_FILTER_DESCRIPTION "GNU Radio Filter Blocks")
53+
54+
CPACK_COMPONENT("filter_runtime"
55+
GROUP "Filter"
56+
DISPLAY_NAME "Runtime"
57+
DESCRIPTION "Runtime"
58+
DEPENDS "core_runtime"
59+
)
60+
61+
CPACK_COMPONENT("filter_devel"
62+
GROUP "Filter"
63+
DISPLAY_NAME "Development"
64+
DESCRIPTION "C++ headers, package config, import libraries"
65+
DEPENDS "core_devel"
66+
)
67+
68+
CPACK_COMPONENT("filter_python"
69+
GROUP "Filter"
70+
DISPLAY_NAME "Python"
71+
DESCRIPTION "Python modules for runtime; GRC xml files"
72+
DEPENDS "core_python;filter_runtime"
73+
)
74+
75+
CPACK_COMPONENT("filter_swig"
76+
GROUP "Filter"
77+
DISPLAY_NAME "SWIG"
78+
DESCRIPTION "SWIG development .i files"
79+
DEPENDS "core_swig;filter_python;filter_devel"
80+
)
81+
82+
########################################################################
83+
# Add subdirectories
84+
########################################################################
85+
add_subdirectory(include/filter)
86+
add_subdirectory(lib)
87+
if(ENABLE_PYTHON)
88+
add_subdirectory(swig)
89+
add_subdirectory(python)
90+
add_subdirectory(grc)
91+
endif(ENABLE_PYTHON)
92+
#add_subdirectory(examples)
93+
add_subdirectory(doc)
94+
95+
########################################################################
96+
# Create Pkg Config File
97+
########################################################################
98+
configure_file(
99+
${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-filter.pc.in
100+
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-filter.pc
101+
@ONLY)
102+
103+
install(
104+
FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-filter.pc
105+
DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
106+
COMPONENT "filter_devel"
107+
)
108+
109+
endif(ENABLE_GR_FILTER)

gr-filter/doc/CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2012 Free Software Foundation, Inc.
2+
#
3+
# This file is part of GNU Radio
4+
#
5+
# GNU Radio is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
#
10+
# GNU Radio is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with GNU Radio; see the file COPYING. If not, write to
17+
# the Free Software Foundation, Inc., 51 Franklin Street,
18+
# Boston, MA 02110-1301, USA.
19+
20+
install(
21+
FILES README.filter
22+
DESTINATION ${GR_PKG_DOC_DIR}
23+
)

gr-filter/doc/README.filter

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This is the gr-filter package. It contains signal processing blocks to
2+
perform filtering operations.
3+
4+
The Python namespace is in gnuradio.filter, which would be normally
5+
imported as:
6+
7+
from gnuradio import filter
8+
9+
See the Doxygen documentation for details about the blocks available
10+
in this package. A quick listing of the details can be found in Python
11+
after importing by using:
12+
13+
help(filter)

gr-filter/doc/filter.dox

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*! \page page_filter filter Signal Processing Blocks
2+
3+
\section Introduction
4+
5+
This is the gr-filter package. It contains signal processing blocks to
6+
perform filtering operations.
7+
8+
The Python namespace is in gnuradio.filter, which would be normally
9+
imported as:
10+
11+
\code
12+
from gnuradio import filter
13+
\endcode
14+
15+
See the Doxygen documentation for details about the blocks available
16+
in this package. A quick listing of the details can be found in Python
17+
after importing by using:
18+
19+
\code
20+
help(filter)
21+
\endcode
22+
23+
\section Dependencies
24+
25+
The filter blocks depend on \ref page_fft.
26+
27+
*/

gr-filter/gnuradio-filter.pc.in

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=@prefix@
2+
exec_prefix=@exec_prefix@
3+
libdir=@libdir@
4+
includedir=@includedir@
5+
6+
Name: gnuradio-filter
7+
Description: GNU Radio's filter signal processing blocks
8+
Requires: gnuradio-core gnuradio-fft
9+
Version: @LIBVER@
10+
Libs: -L${libdir} -lgnuradio-filter
11+
Cflags: -I${includedir}

gr-filter/grc/CMakeLists.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2012 Free Software Foundation, Inc.
2+
#
3+
# This file is part of GNU Radio
4+
#
5+
# GNU Radio is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
#
10+
# GNU Radio is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with GNU Radio; see the file COPYING. If not, write to
17+
# the Free Software Foundation, Inc., 51 Franklin Street,
18+
# Boston, MA 02110-1301, USA.
19+
20+
install(FILES
21+
filter_block_tree.xml
22+
DESTINATION ${GRC_BLOCKS_DIR}
23+
COMPONENT "filter_python"
24+
)

gr-filter/grc/filter_block_tree.xml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
Copyright 2012 Free Software Foundation, Inc.
5+
6+
This file is part of GNU Radio
7+
8+
GNU Radio is free software; you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation; either version 3, or (at your option)
11+
any later version.
12+
13+
GNU Radio is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with GNU Radio; see the file COPYING. If not, write to
20+
the Free Software Foundation, Inc., 51 Franklin Street,
21+
Boston, MA 02110-1301, USA.
22+
-->
23+
24+
<!--
25+
###################################################
26+
##Block Tree for GR Filter blocks.
27+
###################################################
28+
-->
29+
<cat>
30+
<name></name> <!-- Blank for Root Name -->
31+
<cat>
32+
<name>Filters</name>
33+
</cat>
34+
</cat>
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Copyright 2012 Free Software Foundation, Inc.
2+
#
3+
# This file is part of GNU Radio
4+
#
5+
# GNU Radio is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
#
10+
# GNU Radio is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with GNU Radio; see the file COPYING. If not, write to
17+
# the Free Software Foundation, Inc., 51 Franklin Street,
18+
# Boston, MA 02110-1301, USA.
19+
20+
########################################################################
21+
# generate helper scripts to expand templated files
22+
########################################################################
23+
include(GrPython)
24+
25+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
26+
#!${PYTHON_EXECUTABLE}
27+
28+
import sys, os, re
29+
sys.path.append('${GR_CORE_PYTHONPATH}')
30+
os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
31+
os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
32+
33+
if __name__ == '__main__':
34+
import build_utils
35+
root, inp = sys.argv[1:3]
36+
for sig in sys.argv[3:]:
37+
name = re.sub ('X+', sig, root)
38+
d = build_utils.standard_dict2(name, sig, 'filter')
39+
build_utils.expand_template(d, inp)
40+
41+
")
42+
43+
macro(expand_h root)
44+
#make a list of all the generated files
45+
unset(expanded_files_h)
46+
foreach(sig ${ARGN})
47+
string(REGEX REPLACE "X+" ${sig} name ${root})
48+
list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
49+
endforeach(sig)
50+
51+
#create a command to generate the files
52+
add_custom_command(
53+
OUTPUT ${expanded_files_h}
54+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
55+
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
56+
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
57+
${root} ${root}.h.t ${ARGN}
58+
)
59+
60+
#install rules for the generated h files
61+
list(APPEND generated_includes ${expanded_files_h})
62+
endmacro(expand_h)
63+
64+
########################################################################
65+
# Invoke macro to generate various sources
66+
#######################################################################
67+
#expand_h(fir_filter_XXX fff ccc ccf fcc fsf scc)
68+
69+
#add_custom_target(filter_generated_includes DEPENDS
70+
# ${generated_includes}
71+
#)
72+
73+
########################################################################
74+
# Install header files
75+
########################################################################
76+
install(FILES
77+
api.h
78+
fir_filter_fff.h
79+
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/fft
80+
COMPONENT "fft_devel"
81+
)
82+

gr-filter/include/filter/api.h

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2012 Free Software Foundation, Inc.
3+
*
4+
* This file is part of GNU Radio
5+
*
6+
* GNU Radio is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation; either version 3, or (at your option)
9+
* any later version.
10+
*
11+
* GNU Radio is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with GNU Radio; see the file COPYING. If not, write to
18+
* the Free Software Foundation, Inc., 51 Franklin Street,
19+
* Boston, MA 02110-1301, USA.
20+
*/
21+
22+
#ifndef INCLUDED_FILTER_API_H
23+
#define INCLUDED_FILTER_API_H
24+
25+
#include <gruel/attributes.h>
26+
27+
#ifdef gnuradio_filter_EXPORTS
28+
# define FILTER_API __GR_ATTR_EXPORT
29+
#else
30+
# define FILTER_API __GR_ATTR_IMPORT
31+
#endif
32+
33+
#endif /* INCLUDED_FILTER_API_H */

0 commit comments

Comments
 (0)