Changeset 253
- Timestamp:
- 06/09/06 13:26:17 (18 years ago)
- Files:
-
- branches/libfreebob-2.0/src/bebob_light/bebob_light_avdevice.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/debugmodule/debugmodule.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/AmdtpStreamProcessor.cpp (modified) (16 diffs)
- branches/libfreebob-2.0/src/libstreaming/AmdtpStreamProcessor.h (modified) (5 diffs)
- branches/libfreebob-2.0/src/libstreaming/MotuStreamProcessor.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/MotuStreamProcessor.h (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/Port.h (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/StreamProcessorManager.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libutil/DelayLockedLoop.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/libutil/DelayLockedLoop.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libutil/Makefile.am (modified) (1 diff)
- branches/libfreebob-2.0/src/libutil/test-dll.cpp (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libfreebob-2.0/src/bebob_light/bebob_light_avdevice.cpp
r242 r253 1786 1786 1787 1787 } 1788 1789 // FIXME: do this the proper way! 1790 m_transmitProcessor->syncmaster=m_receiveProcessor; 1788 1791 1789 1792 if (!addPlugToProcessor(*inputPlug,m_transmitProcessor, branches/libfreebob-2.0/src/debugmodule/debugmodule.cpp
r242 r253 93 93 va_list arg; 94 94 va_start( arg, format ); 95 DebugModuleManager::instance()->print( "%s (%s)[% d] %s: ", getPreSequence( level ),95 DebugModuleManager::instance()->print( "%s (%s)[%4d] %s: ", getPreSequence( level ), 96 96 file, line, function ); 97 97 DebugModuleManager::instance()->va_print( format, arg ); branches/libfreebob-2.0/src/libstreaming/AmdtpStreamProcessor.cpp
r249 r253 43 43 // this is one milisecond of processing delay 44 44 #define TICKS_PER_SECOND 24576000 45 #define RECEIVE_PROCESSING_DELAY (TICKS_PER_SECOND / 500)45 #define RECEIVE_PROCESSING_DELAY (TICKS_PER_SECOND * 1/1000) 46 46 47 47 namespace FreebobStreaming { … … 53 53 /* transmit */ 54 54 AmdtpTransmitStreamProcessor::AmdtpTransmitStreamProcessor(int port, int framerate, int dimension) 55 : TransmitStreamProcessor(port, framerate), m_dimension(dimension) {55 : TransmitStreamProcessor(port, framerate), m_dimension(dimension), m_last_timestamp(0) { 56 56 57 57 … … 106 106 *tag = IEC61883_TAG_WITH_CIP; 107 107 *sy = 0; 108 m_last_timestamp=9000.0 + cycle * 3072.0; 108 109 return RAW1394_ISO_OK; 109 110 } … … 116 117 117 118 // construct the packet cip 118 int nevents = iec61883_cip_fill_header (getNodeId(), &m_cip_status, packet); 119 119 // FIXME: this should be done differently: 120 // first we should determine the timestamp of the first sample in this block 121 // this can be done by reading the rate of the compagnion receiver 122 // this rate will give us the ticks per sample used by the device 123 // then we should take the previous timestamp, and add m_syt_interval * ticks_per_sample 124 // to this timestamp (only if we are sending events). This gives us the timestamp 125 // of the first sample in this packet. 126 // we should define a transfer delay and add it to this timestamp and then send it to 127 // the device. 128 129 // NOTE: this will even work when we're only transmitting (no receive stream): 130 // the ticks_per_sample value is initialized by the receive streamprocessor 131 // to the nominal value. We will then transmit at our own pace, being at nominal 132 // rate compared to the cycle counter. 133 134 // NOTE: this scheme might even work when sync'ing on the sync streams of the device 135 // they are AMDTP streams with SYT timestamps, therefore a decent estimate of 136 // ticks_per_frame can be found, and we are synced when using it. 137 138 // <<compile error here>> 139 140 int nevents = iec61883_cip_fill_header (getNodeId(), &m_cip_status, packet); 141 142 143 unsigned int timestamp_ticks=m_last_timestamp; // fixed transfer delay 144 timestamp_ticks += 9000; 145 unsigned int timestamp=(((timestamp_ticks/3072) << 12) & 0xF000); 146 timestamp |= ((timestamp_ticks % 3072)) & 0xFFF; 147 148 timestamp = htons(timestamp); 149 150 m_last_timestamp += nevents*syncmaster->getTicksPerFrame(); 151 152 if (nevents==0) { 153 timestamp=0xFFFF; 154 } 155 120 156 enum raw1394_iso_disposition retval = RAW1394_ISO_OK; 121 157 … … 142 178 143 179 // signal underrun 144 m_xruns++;180 // m_xruns++; 145 181 146 182 retval=RAW1394_ISO_DEFER; … … 159 195 } 160 196 161 if (packet->syt != 0xFFFF) { 162 unsigned int m_last_timestamp=ntohs(packet->syt); 163 // reconstruct the top part of the timestamp using the current cycle number 164 m_last_timestamp |= ((cycle << 12) & 0x01FF0000); 165 166 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Sent packet with SYT for cycle %2d: %5u ticks (%2u cycles + %04u ticks)\n", 167 cycle, 168 CYCLE_COUNTER_TO_TICKS(m_last_timestamp), 169 CYCLE_COUNTER_GET_CYCLES(m_last_timestamp), 170 CYCLE_COUNTER_GET_TICKS(m_last_timestamp) 171 ); 172 } 197 unsigned int timestamp2=ntohs(timestamp); 198 debugOutput(DEBUG_LEVEL_VERBOSE,"XMIT %d EVENTS, SYT %04X (was: %04X) for cycle %2d: %5u ticks (%2u cycles + %04u ticks)\n", 199 nevents, timestamp, packet->syt, cycle, 200 CYCLE_COUNTER_TO_TICKS(timestamp2), 201 CYCLE_COUNTER_GET_CYCLES(timestamp2), 202 CYCLE_COUNTER_GET_TICKS(timestamp2) 203 ); 173 204 } 174 205 175 206 *tag = IEC61883_TAG_WITH_CIP; 176 207 *sy = 0; 208 209 // FIXME: do this directly 210 packet->syt=timestamp; 177 211 178 212 // update the frame counter … … 205 239 // and we should also provide enough prefill for the 206 240 // SYT processing delay 207 / *if(!transferSilence((m_framerate * RECEIVE_PROCESSING_DELAY)/TICKS_PER_SECOND)) {208 debugFatal("Could not prefill transmit stream\n");209 return false;210 }*/ 241 // if(!transferSilence((m_framerate * RECEIVE_PROCESSING_DELAY)/TICKS_PER_SECOND)) { 242 // debugFatal("Could not prefill transmit stream\n"); 243 // return false; 244 // } 211 245 212 246 // the framecounter should be pulled back to … … 772 806 773 807 AmdtpReceiveStreamProcessor::AmdtpReceiveStreamProcessor(int port, int framerate, int dimension) 774 : ReceiveStreamProcessor(port, framerate), m_dimension(dimension), m_last_timestamp(0) {808 : ReceiveStreamProcessor(port, framerate), m_dimension(dimension), m_last_timestamp(0), m_last_timestamp2(0) { 775 809 776 810 … … 844 878 // actual presentation time later 845 879 if (packet->syt != 0xFFFF) { 846 847 m_last_timestamp=ntohs(packet->syt); 880 881 m_last_timestamp2=m_last_timestamp; 882 883 unsigned int syt_timestamp=ntohs(packet->syt); 848 884 // reconstruct the top part of the timestamp using the current cycle number 849 // m_last_timestamp |= ((cycle << 12) & 0x01FF0000); 850 unsigned int syt_cycles=CYCLE_COUNTER_GET_CYCLES(m_last_timestamp); 851 int new_cycles=cycle+(syt_cycles-(cycle & 0xF)); 852 // m_last_timestamp &= 0xFFF; // keep only the offset 853 // m_last_timestamp |= ((new_cycles << 12) & 0x01FFF000); // add the right cycle info 854 885 unsigned int now_cycle_masked=cycle & 0xF; 886 unsigned int syt_cycle=CYCLE_COUNTER_GET_CYCLES(syt_timestamp); 887 888 // if this is true, wraparound has occurred, undo this wraparound 889 if(syt_cycle<now_cycle_masked) syt_cycle += 0xF; 890 891 unsigned int delta_cycles=syt_cycle-now_cycle_masked; 892 893 // reconstruct the cycle part of the timestamp 894 unsigned int new_cycles=cycle + delta_cycles; 895 896 if(new_cycles>7999) new_cycles-=8000; // wrap around 897 898 m_last_timestamp = (new_cycles) << 12; 899 900 // now add the offset part on top of that 901 m_last_timestamp |= (syt_timestamp & 0xFFF); 902 903 // m_last_timestamp timestamp now contains all info, 904 // including cycle number 905 906 if (m_last_timestamp & m_last_timestamp2) { 907 // try and estimate the frame rate from the device: 908 int timestamp_difference=CYCLE_COUNTER_TO_TICKS(m_last_timestamp) 909 -CYCLE_COUNTER_TO_TICKS(m_last_timestamp2); 910 911 // handle wrap around of the cycle variable 912 if (new_cycles==0) timestamp_difference+=TICKS_PER_SECOND; 913 914 // implement a 1st order DLL to estimate the framerate 915 // this is the number of ticks between two samples 916 double f=timestamp_difference; 917 double err = timestamp_difference / m_syt_interval; 918 // now it contains the error between our estimate 919 // and the current measurement 920 err=err-m_ticks_per_frame; 921 922 // integrate the error 923 m_ticks_per_frame += 0.000001*err; 924 } 925 855 926 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"R-SYT for cycle (%2d %2d)=>%2d: %5uT (%04uC + %04uT) %04X %04X %d\n", 856 cycle, cycle & 0xF,new_cycles,927 cycle,now_cycle_masked,delta_cycles, 857 928 CYCLE_COUNTER_TO_TICKS(m_last_timestamp), 858 929 CYCLE_COUNTER_GET_CYCLES(m_last_timestamp), … … 860 931 ntohs(packet->syt),m_last_timestamp&0xFFFF, dropped 861 932 ); 933 934 #ifdef DEBUG 935 if(m_last_timestamp<m_last_timestamp2) { 936 if(new_cycles==0) { 937 debugWarning("timestamp not sequential, but it's wraparound. %08X %08X %08X\n",syt_timestamp, m_last_timestamp, m_last_timestamp2); 938 } else { 939 debugFatal("timestamp not sequential! %08X %08X %08X\n",syt_timestamp, m_last_timestamp, m_last_timestamp2); 940 return RAW1394_ISO_STOP; 941 } 942 } 943 #endif 944 862 945 } 863 946 } … … 892 975 // this uses SYT to determine if one period is ready 893 976 bool AmdtpReceiveStreamProcessor::isOnePeriodReady() { 894 #if 0 // this code is not ready yet 977 #define DO_SYT_SYNC 978 #ifdef DO_SYT_SYNC 979 // this code is not ready yet 895 980 896 981 // one sample will take a number off cycle counter ticks: … … 937 1022 // FIXME: if we are sure, make ideal_presentation_time an unsigned int 938 1023 // assert(ideal_presentation_time>=0); 939 940 941 /* if(ideal_presentation_time) { 942 debugOutput(DEBUG_LEVEL_VERBOSE, "Presentation time < 0 : %d\n", ideal_presentation_time);943 }*/ 1024 #ifdef DEBUG 1025 if(ideal_presentation_time<0) { 1026 debugWarning("ideal_presentation_time time is negative!\n"); 1027 } 1028 #endif 944 1029 945 1030 unsigned int current_time=m_handler->getCycleCounter() & 0x1FFFFFF; … … 949 1034 // so add one second 950 1035 // if (current_time_ticks < m_previous_signal_ticks) current_time_ticks += 24576000; 951 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Periods: %d \n",m_PeriodStat.m_count);1036 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Periods: %d, remote framerate %f\n",m_PeriodStat.m_count, m_ticks_per_frame); 952 1037 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Timestamp : %10u ticks (%3u secs + %4u cycles + %04u ticks)\n", 953 1038 m_last_timestamp_ticks, … … 978 1063 979 1064 if(tmp<0) { 980 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"SYT passed (%d ticks too late)\n",-tmp); 1065 debugOutput(DEBUG_LEVEL_VERBOSE,"SYT passed (%d ticks too late)\n",-tmp); 1066 debugOutput(DEBUG_LEVEL_VERBOSE,"Periods: %d, remote ticks/frame: %f, remote framerate = %f\n",m_PeriodStat.m_count, m_ticks_per_frame, 24576000.0/m_ticks_per_frame); 981 1067 if (-tmp>1000000) debugWarning("SYT VERY LATE: %d!\n",-tmp); 982 return true;1068 // return true; 983 1069 } else { 984 1070 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Too early wait %d ticks\n",tmp); 985 return false;1071 // return false; 986 1072 } 987 } else return false; 988 #endif 1073 } 1074 // else return false; 1075 // #else 989 1076 if(m_framecounter > (int)m_period) { 990 1077 return true; 991 1078 } else return false; 992 1079 #endif 993 1080 } 994 1081 … … 1014 1101 m_WakeupStat.reset(); 1015 1102 1103 // reset the framerate estimate 1104 m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / m_framerate; 1105 1106 debugOutput(DEBUG_LEVEL_VERBOSE,"Initializing remote ticks/frame to %f\n",m_ticks_per_frame); 1107 1108 //reset the timestamps 1109 m_last_timestamp=0; 1110 m_last_timestamp2=0; 1111 1016 1112 1017 1113 // reset all non-device specific stuff … … 1062 1158 break; 1063 1159 } 1160 1161 // prepare the framerate estimate 1162 m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / m_framerate; 1163 1164 debugOutput(DEBUG_LEVEL_VERBOSE,"Initializing remote ticks/frame to %f\n",m_ticks_per_frame); 1064 1165 1065 1166 // allocate the event buffer branches/libfreebob-2.0/src/libstreaming/AmdtpStreamProcessor.h
r244 r253 59 59 class AmdtpAudioPort; 60 60 class AmdtpMidiPort; 61 class AmdtpReceiveStreamProcessor; 61 62 62 63 /*! … … 101 102 unsigned int getMaxPacketSize() {return 4 * (2 + m_syt_interval * m_dimension);}; 102 103 104 // FIXME: do this the proper way! 105 AmdtpReceiveStreamProcessor *syncmaster; 106 103 107 protected: 104 108 … … 127 131 int encodeSilencePortToMBLAEvents(AmdtpAudioPort *, quadlet_t *data, 128 132 unsigned int offset, unsigned int nevents); 133 134 double m_last_timestamp; 135 129 136 130 137 DECLARE_DEBUG_MODULE; … … 173 180 unsigned int getMaxPacketSize() {return 4 * (2 + m_syt_interval * m_dimension);}; 174 181 182 double getTicksPerFrame() {return m_ticks_per_frame;}; 183 175 184 protected: 176 185 … … 186 195 187 196 unsigned int m_last_timestamp; 197 unsigned int m_last_timestamp2; 198 199 double m_ticks_per_frame; 188 200 189 201 DECLARE_DEBUG_MODULE; branches/libfreebob-2.0/src/libstreaming/MotuStreamProcessor.cpp
r249 r253 27 27 * 28 28 */ 29 29 30 30 31 #include "MotuStreamProcessor.h" branches/libfreebob-2.0/src/libstreaming/MotuStreamProcessor.h
r246 r253 28 28 #ifndef __FREEBOB_MOTUSTREAMPROCESSOR__ 29 29 #define __FREEBOB_MOTUSTREAMPROCESSOR__ 30 #include <assert.h> 30 31 31 32 #include "../debugmodule/debugmodule.h" branches/libfreebob-2.0/src/libstreaming/Port.h
r249 r253 28 28 #ifndef __FREEBOB_PORT__ 29 29 #define __FREEBOB_PORT__ 30 31 #include <stdint.h> 30 32 31 33 #include "../debugmodule/debugmodule.h" branches/libfreebob-2.0/src/libstreaming/StreamProcessorManager.cpp
r250 r253 157 157 } 158 158 159 m_streamingThread->setVerboseLevel(getDebugLevel());160 161 159 m_isoManager=new IsoHandlerManager(); 162 160 … … 667 665 668 666 if (m_isoManager) m_isoManager->setVerboseLevel(l); 669 if (m_streamingThread) m_streamingThread->setVerboseLevel(l);670 667 671 668 debugOutput( DEBUG_LEVEL_VERBOSE, " Receive processors...\n"); branches/libfreebob-2.0/src/libutil/DelayLockedLoop.cpp
r250 r253 29 29 #include "DelayLockedLoop.h" 30 30 31 namespace FreeBobUtil { 32 33 IMPL_DEBUG_MODULE( DelayLockedLoop, DelayLockedLoop, DEBUG_LEVEL_NORMAL ); 34 31 namespace FreebobUtil { 32 33 /** 34 * Creates a new Delay Locked Loop with a predefined order and 35 * a predefined set of coefficients. 36 * 37 * Make sure coeffs is a float array containing order+1 coefficients. 38 * 39 * @pre order > 0 40 * @param order order of the DLL 41 * @param coeffs coefficients to use 42 */ 43 DelayLockedLoop::DelayLockedLoop(unsigned int order, float *coeffs) 44 { 45 unsigned int i; 46 47 m_order=order; 48 if (m_order==0) m_order=1; 49 50 m_coeffs=new float[order]; 51 m_nodes=new float[order]; 52 53 for (i=0;i<order;i++) { 54 m_coeffs[i]=coeffs[i]; 55 m_nodes[i]=0.0; 56 } 57 58 } 59 60 /** 61 * Creates a new Delay Locked Loop with a predefined order. 62 * All coefficients are set to 0. 63 * 64 * @pre order > 0 65 * @param order order of the DLL 66 */ 67 DelayLockedLoop::DelayLockedLoop(unsigned int order) 68 { 69 unsigned int i; 70 71 m_order=order; 72 if (m_order==0) m_order=1; 73 74 m_coeffs=new float[order]; 75 m_nodes=new float[order]; 76 77 for (i=0;i<order;i++) { 78 m_coeffs[i]=0.0; 79 m_nodes[i]=0.0; 80 } 81 } 82 83 /** 84 * Creates a new first order Delay Locked Loop. 85 * The coefficient is set to 0. 86 * 87 */ 35 88 DelayLockedLoop::DelayLockedLoop() { 36 89 m_order=1; 90 91 m_coeffs=new float[1]; 92 m_coeffs[0]=0.0; 93 94 m_nodes=new float[1]; 95 m_nodes[0]=0.0; 37 96 } 38 97 39 98 DelayLockedLoop::~DelayLockedLoop() { 40 99 if(m_coeffs) delete[] m_coeffs; 100 if(m_nodes) delete[] m_nodes; 101 102 } 103 104 /** 105 * Returns the coefficient with index i 106 * 107 * i should be smaller than the DLL order 108 * 109 * @param i index of the coefficient 110 * @return value of the coefficient 111 */ 112 float 113 DelayLockedLoop::getCoefficient(unsigned int i) { 114 115 unsigned int x; 116 if (x<m_order) { 117 return m_coeffs[x]; 118 } else { 119 return 0.0; 120 } 121 } 122 /** 123 * Sets the value of the coefficient with index i 124 * 125 * i should be smaller than the DLL order 126 * 127 * @param i index of the coefficient 128 * @param c value of the coefficient 129 */ 130 void 131 DelayLockedLoop::setCoefficient(unsigned int i, float c) { 132 133 unsigned int x; 134 if (x<m_order) { 135 m_coeffs[x]=c; 136 } 137 } 138 139 /** 140 * Sets the value of the integrator output with index i. 141 * This allows to set the inital values 142 * 143 * i should be smaller than the DLL order 144 * 145 * 146 * @param i index of the integrator 147 * @param c value of the integrator output 148 */ 149 void 150 DelayLockedLoop::setIntegrator(unsigned int i, float c) { 151 152 unsigned int x; 153 if (x<m_order) { 154 m_nodes[x]=c; 155 } 156 } 157 158 /** 159 * Clears the internal state of the DLL, 160 * meaning that it will set all internal nodes to 0.0 161 */ 162 void 163 DelayLockedLoop::reset() { 164 165 unsigned int i; 166 for (i=0;i<m_order;i++) { 167 m_nodes[i]=0.0; 168 } 169 170 } 171 172 /** 173 * Returns the order of the DLL 174 * @return DLL order 175 */ 176 unsigned int 177 DelayLockedLoop::getOrder() { 178 return m_order; 179 } 180 181 /** 182 * Set the order of the DLL 183 * with setting of new coefficients 184 * 185 * Make sure coeffs is a float array containing 'order' coefficients. 186 * 187 * resets the DLL before changing the order 188 * 189 * @pre order > 0 190 * @param order new order for the DLL 191 * @param coeffs coefficients to use 192 */ 193 void 194 DelayLockedLoop::setOrder(unsigned int order, float* coeffs) { 195 unsigned int i; 196 197 reset(); 198 199 m_order=order; 200 if (m_order==0) m_order=1; 201 202 if(m_coeffs) delete[] m_coeffs; 203 m_coeffs=new float[order]; 204 205 if(m_nodes) delete[] m_nodes; 206 m_nodes=new float[order]; 207 208 for (i=0;i<order;i++) { 209 m_coeffs[i]=coeffs[i]; 210 m_nodes[i]=0.0; 211 } 212 213 } 214 215 /** 216 * Set the order of the DLL, 217 * the coefficients are set to 0 218 * 219 * resets the DLL before changing the order 220 * 221 * @pre order > 0 222 * @param order new order for the DLL 223 */ 224 void 225 DelayLockedLoop::setOrder(unsigned int order) { 226 unsigned int i; 227 228 reset(); 229 230 m_order=order; 231 232 if (m_order==0) m_order=1; 233 234 if(m_coeffs) delete[] m_coeffs; 235 m_coeffs=new float[order]; 236 237 if(m_nodes) delete[] m_nodes; 238 m_nodes=new float[order]; 239 240 for (i=0;i<order;i++) { 241 m_coeffs[i]=0.0; 242 m_nodes[i]=0.0; 243 } 244 245 } 246 247 /** 248 * Put a new value in the loop, updating all internal nodes and 249 * the output value. 250 * 251 * @param v new value 252 */ 253 void 254 DelayLockedLoop::put(float v) { 255 256 // we write the calculation out 257 // to make use of pipeline-ing and out of order execution 258 // except for very high order loops, then we do it looped 259 260 // error = newval - output 261 m_error=v-m_nodes[0]; 262 263 // update the output value 264 m_nodes[0]+=m_error*m_coeffs[0]; 265 266 if(m_order==1) return; // we are done 267 268 // add the output of the second integrator 269 m_nodes[0]+=m_nodes[1]; 270 271 // update the second integrator 272 m_nodes[1]+=m_error*m_coeffs[1]; 273 274 if(m_order==2) return; // we are done 275 276 // if the order is even higher, we are using a loop 277 unsigned int i; 278 for (i=2; i < m_order;i++) { 279 // add the i-th integrator value 280 m_nodes[i-1] += m_nodes[i]; 281 282 // update the i-th integrator 283 m_nodes[i] = m_coeffs[i] * m_error; 284 } 285 286 return; 287 } 288 289 /** 290 * Get the output value of the DLL 291 * 292 * @return current output value 293 */ 294 float 295 DelayLockedLoop::get() { 296 return m_nodes[0]; 297 } 298 299 /** 300 * Get the current error signal value 301 * 302 * @return current error signal value 303 */ 304 float 305 DelayLockedLoop::getError() { 306 return m_error; 41 307 } 42 308 branches/libfreebob-2.0/src/libutil/DelayLockedLoop.h
r250 r253 29 29 #define __FREEBOB_DELAYLOCKEDLOOP__ 30 30 31 #include "../debugmodule/debugmodule.h" 32 33 namespace FreeBobUtil { 31 namespace FreebobUtil { 34 32 35 33 class DelayLockedLoop { … … 37 35 public: 38 36 37 DelayLockedLoop(unsigned int order, float *coeffs); 38 DelayLockedLoop(unsigned int order); 39 39 DelayLockedLoop(); 40 40 41 virtual ~DelayLockedLoop(); 42 43 float getCoefficient(unsigned int i); 44 void setCoefficient(unsigned int i, float c); 45 46 void setIntegrator(unsigned int i, float c); 47 48 void reset(); 49 50 unsigned int getOrder(); 51 void setOrder(unsigned int i); 52 void setOrder(unsigned int order, float* coeffs); 53 54 void put(float v); 55 float get(); 56 float getError(); 57 58 protected: 41 59 42 protected: 43 DECLARE_DEBUG_MODULE; 60 unsigned int m_order; 44 61 62 float *m_coeffs; 63 float *m_nodes; 64 float m_error; 45 65 }; 46 66 branches/libfreebob-2.0/src/libutil/Makefile.am
r250 r253 25 25 26 26 MAINTAINERCLEANFILES = Makefile.in 27 noinst_PROGRAMS = test-dll 28 test_dll_SOURCES = test-dll.cpp 29 test_dll_LDADD = libutil.la