8 #ifndef __wooferTweeterFilter_hpp__
9 #define __wooferTweeterFilter_hpp__
21 template<
typename wooferFilterT,
typename tweeterFilterT>
22 class wooferTweeterFilter
27 typedef typename wooferFilterT::floatT floatT;
29 typedef std::complex<floatT> complexT;
32 typedef wavefront<floatT> wavefrontT;
35 typedef wooferTweeterCommand<floatT> commandT;
38 wooferTweeterFilter();
41 tweeterFilterT tweeter;
48 template<
typename dmT>
49 void initialize(dmT & dm);
51 void filterCommands(commandT & filtAmps, commandT & rawAmps);
55 void initMeasurements(commandT & filtAmps, commandT & rawAmps)
57 filtAmps.wooferVect.resize(1, wooferNModes);
58 filtAmps.wooferVect.setZero();
59 filtAmps.tweeterVect.resize(1, tweeterNModes);
60 filtAmps.tweeterVect.setZero();
62 rawAmps.wooferVect.resize(1, wooferNModes);
63 rawAmps.wooferVect.setZero();
64 rawAmps.tweeterVect.resize(1, tweeterNModes);
65 rawAmps.tweeterVect.setZero();
71 template<
typename wooferFilterT,
typename tweeterFilterT>
72 wooferTweeterFilter<wooferFilterT, tweeterFilterT>::wooferTweeterFilter()
79 template<
typename wooferFilterT,
typename tweeterFilterT>
80 template<
typename dmT>
81 void wooferTweeterFilter<wooferFilterT, tweeterFilterT>::initialize(dmT & dm)
83 woofer.initialize(dm.woofer);
84 wooferNModes = dm.woofer.nModes();
86 tweeter.initialize(dm.tweeter);
87 tweeterNModes = dm.tweeter.nModes();
92 template<
typename wooferFilterT,
typename tweeterFilterT>
93 void wooferTweeterFilter<wooferFilterT, tweeterFilterT>::filterCommands(commandT & filtAmps, commandT & rawAmps)
95 static int called = 0;
104 for(
int i=78; i< 1680; ++i)
105 tweeter.setLeak(i, 0.01);
108 woofer.filterCommands(filtAmps.wooferVect, rawAmps.wooferVect);
109 tweeter.filterCommands(filtAmps.tweeterVect, rawAmps.tweeterVect);