Skip to content

Commit

Permalink
added esprit files. the QA file revealed a bug for some blocks: the p…
Browse files Browse the repository at this point in the history
…ublic methods are not visible in the python domain. methods like decimation() in the esprit hier block can not be called but are needed for the QA so probably the new 3.7 code structure makes it fail. still investigating.
  • Loading branch information
Felix Wunsch committed Feb 11, 2014
1 parent aa94a9e commit f5f9d93
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion grc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install(FILES
specest_burg.xml
specest_welch.xml
specest_esprit_vcf.xml
#specest_esprit_spectrum_vcf.xml
#specest_esprit_spectrum_vcf.xml
#specest_esprit.xml
DESTINATION share/gnuradio/grc/blocks
)
3 changes: 2 additions & 1 deletion include/specest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ install(FILES
esprit_algo.h
esprit_fortran_algo.h
esprit_vcf.h
esprit_spectrum_vcf.h DESTINATION include/specest
esprit_spectrum_vcf.h
esprit.h DESTINATION include/specest
)
1 change: 1 addition & 0 deletions include/specest/burg.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ namespace gr {
* creating new instances.
*/
static sptr make(unsigned block_len, unsigned fft_len, unsigned order, bool fftshift = false, int decimation = 1);
virtual void set_decimation(int n) = 0; //!< Update the decimation rate at the input
};

} // namespace specest
Expand Down
1 change: 1 addition & 0 deletions include/specest/fcov.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ namespace gr {
* creating new instances.
*/
static sptr make(unsigned block_len, unsigned fft_len, unsigned order, bool fftshift = false, int decimation = 1);
virtual void set_decimation(int n) = 0; //!< Update the decimation rate at the input
};

} // namespace specest
Expand Down
2 changes: 1 addition & 1 deletion include/specest/fmcov.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace gr {
* creating new instances.
*/
static sptr make(unsigned block_len, unsigned fft_len, unsigned order, bool fftshift = false, int decimation = 1);

virtual void set_decimation(int n) = 0; //!< Update the decimation rate at the input
};

} // namespace specest
Expand Down
10 changes: 10 additions & 0 deletions include/specest/welch.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ namespace gr {
static sptr make(unsigned fft_len, int overlap, int ma_len, bool fft_shift, const std::vector<float> &window);
static sptr make(unsigned fft_len, int overlap = -1, int ma_len = 8, bool fft_shift = false, int window_type = (int) gr::filter::firdes::WIN_HAMMING, double beta = 6.76);
// Declaring int instead of win_type makes it compatible with Python

/**
* \brief Set the window applied before FFT. Must have same length as FFT length.
*/
virtual bool set_window(const std::vector<float> &window) = 0;

/**
* \brief Sets the window to the default (a Hamming window).
*/
virtual bool set_hamming() = 0;
};

} // namespace specest
Expand Down
3 changes: 2 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ list(APPEND specest_sources
welch_impl.cc
esprit_fortran_algo.cc
esprit_vcf_impl.cc
esprit_spectrum_vcf_impl.cc )
esprit_spectrum_vcf_impl.cc
esprit_impl.cc )

add_library(gnuradio-specest SHARED ${specest_sources})
target_link_libraries(gnuradio-specest gnuradio-specest-fortran
Expand Down
5 changes: 5 additions & 0 deletions lib/fcov_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ namespace gr {
{
}

void
fcov_impl::set_decimation(int n)
{
d_keep_one_in_n->set_n(n);
}

} /* namespace specest */
} /* namespace gr */
Expand Down
1 change: 1 addition & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ GR_ADD_TEST(qa_burg ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_burg.py)
GR_ADD_TEST(qa_welch ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_welch.py)
GR_ADD_TEST(qa_esprit_vcf ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_esprit_vcf.py)
GR_ADD_TEST(qa_esprit_spectrum_vcf ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_esprit_spectrum_vcf.py)
GR_ADD_TEST(qa_esprit ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_esprit.py)
3 changes: 3 additions & 0 deletions swig/specest_swig.i
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "specest/welch.h"
#include "specest/esprit_vcf.h"
#include "specest/esprit_spectrum_vcf.h"
#include "specest/esprit.h"
%}


Expand Down Expand Up @@ -54,3 +55,5 @@ GR_SWIG_BLOCK_MAGIC2(specest, welch);
GR_SWIG_BLOCK_MAGIC2(specest, esprit_vcf);
%include "specest/esprit_spectrum_vcf.h"
GR_SWIG_BLOCK_MAGIC2(specest, esprit_spectrum_vcf);
%include "specest/esprit.h"
GR_SWIG_BLOCK_MAGIC2(specest, esprit);

0 comments on commit f5f9d93

Please sign in to comment.