gr-baz Package
baz_music_doa.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2011 Communications Engineering Lab, KIT
00004  *
00005  * This is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 3, or (at your option)
00008  * any later version.
00009  *
00010  * This software is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this software; see the file COPYING.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef INCLUDED_BAZ_MUSIC_DOA_H
00022 #define INCLUDED_BAZ_MUSIC_DOA_H
00023 
00024 #include <gr_sync_block.h>
00025 #include <vector>
00026 #include <armadillo>
00027 #include <gruel/thread.h>
00028 
00029 class baz_music_doa;
00030 typedef boost::shared_ptr<baz_music_doa> baz_music_doa_sptr;
00031 
00032 typedef std::vector<gr_complex> antenna_response_t;
00033 typedef std::vector<antenna_response_t> array_response_t;
00034 typedef std::pair<double,double> doa_t;
00035 
00036 baz_music_doa_sptr baz_make_music_doa(unsigned int m, unsigned int n, unsigned int nsamples, const array_response_t& array_response, unsigned int resolution);
00037 
00038 class baz_music_doa : public gr_sync_block
00039 {
00040 private:
00041         friend baz_music_doa_sptr baz_make_music_doa(unsigned int m, unsigned int n, unsigned int nsamples, const array_response_t& array_response, unsigned int resolution);
00042 
00043         baz_music_doa(unsigned int m, unsigned int n, unsigned int nsamples, const array_response_t& array_response, unsigned int resolution);
00044 
00045 public:
00046         ~baz_music_doa();
00047 
00048         int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
00049 
00050 private:
00051         unsigned int d_m;
00052         unsigned int d_n;
00053         unsigned int d_nsamples;
00054         array_response_t d_array_response;
00055         unsigned int d_resolution;
00056         gruel::mutex  d_mutex;
00057 
00058 public:
00059         void set_array_response(const array_response_t& array_response);
00060 };
00061 
00062 #endif /* INCLUDED_BAZ_MUSIC_DOA_H */