/**************************************************************************************** * Class: sndbuf_smart * * Purpose: Extend sndbuf with the capability to do filtering and find incidence angles * * Author: Luke Scharf (lscharf@vt.edu) * * History: * 06-28-2000: Start work. ***************************************************************************************/ /******************************* * Multiple Include Protection * *****************************/ #ifndef _SNDBUF_SMART_H_ #define _SNDBUF_SMART_H_ /************ * Includes * *********/ #include "sndbuf_config.h" #include "sndbuf.h" /************ * Defines * *********/ #define ALL_CHAN -1 //A flag meaning "all relevant channels" /*********************** * Class: sndbuf_smart * ********************/ class sndbuf_smart : public sndbuf { //-- Structors -- public: sndbuf_smart(int new_chan_max, int new_samp_max); ~sndbuf_smart(); //-- Sound Generation Methods -- public: void gen_tone(int my_chan, float freq); void gen_noise(int my_chan); //-- DSP/Analysis Methods -- public: void fir(sndbuf& pat, int pat_chan=0); void fir(int src_chan, int dst_chan, sndbuf& pat, int pat_chan); int q_min(int chan); int q_max(int chan); int min(int chan); int max(int chan); inline int zero_dn(int my_chan); inline int zero_dn(int my_chan, int start, int finish); inline int zero_dn_avg(int my_chan, int wl); inline int zero_up(int my_chan); inline int zero_up(int my_chan, int start, int finish); int q_phase_dist(int c0, int c1, int wl); int phase_dist(int c0, int c1, int wl); double incidence_quick(int c0, int c1, int wl, int dist); private: void convolution(BUF_TYPE* dat, int dat_cnt, BUF_TYPE* pat, int pat_cnt, BUF_TYPE* dest, int dest_cnt); int max(BUF_TYPE* buf, int buf_cnt); int min(BUF_TYPE* buf, int buf_cnt); }; /******************************* * Multiple Include Protection * *****************************/ #endif