Mercurial > hg > audiostuff
comparison intercom/aec.h @ 3:c6c5a16ce2f2
compilation fixes
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 09:59:25 +0200 |
parents | 13be24d74cd2 |
children |
comparison
equal
deleted
inserted
replaced
2:13be24d74cd2 | 3:c6c5a16ce2f2 |
---|---|
301 * in x: loudspeaker sample (PCM as REALing point value) | 301 * in x: loudspeaker sample (PCM as REALing point value) |
302 * return: from 0 for doubletalk to 1.0 for single talk | 302 * return: from 0 for doubletalk to 1.0 for single talk |
303 */ | 303 */ |
304 float dtd(REAL d, REAL x); | 304 float dtd(REAL d, REAL x); |
305 | 305 |
306 void AEC::leaky(); | 306 void leaky(); |
307 | 307 |
308 /* Normalized Least Mean Square Algorithm pre-whitening (NLMS-pw) | 308 /* Normalized Least Mean Square Algorithm pre-whitening (NLMS-pw) |
309 * The LMS algorithm was developed by Bernard Widrow | 309 * The LMS algorithm was developed by Bernard Widrow |
310 * book: Haykin, Adaptive Filter Theory, 4. edition, Prentice Hall, 2002 | 310 * book: Haykin, Adaptive Filter Theory, 4. edition, Prentice Hall, 2002 |
311 * | 311 * |
325 /* Acoustic Echo Cancellation and Suppression of one sample | 325 /* Acoustic Echo Cancellation and Suppression of one sample |
326 * in d: microphone signal with echo | 326 * in d: microphone signal with echo |
327 * in x: loudspeaker signal | 327 * in x: loudspeaker signal |
328 * return: echo cancelled microphone signal | 328 * return: echo cancelled microphone signal |
329 */ | 329 */ |
330 int AEC::doAEC(int d_, int x_); | 330 int doAEC(int d_, int x_); |
331 | 331 |
332 float AEC::getambient() { | 332 float getambient() { |
333 return dfast; | 333 return dfast; |
334 }; | 334 }; |
335 void AEC::setambient(float Min_xf) { | 335 void setambient(float Min_xf) { |
336 dotp_xf_xf -= delta; // subtract old delta | 336 dotp_xf_xf -= delta; // subtract old delta |
337 delta = (NLMS_LEN-1) * Min_xf * Min_xf; | 337 delta = (NLMS_LEN-1) * Min_xf * Min_xf; |
338 dotp_xf_xf += delta; // add new delta | 338 dotp_xf_xf += delta; // add new delta |
339 }; | 339 }; |
340 void AEC::setgain(float gain_) { | 340 void setgain(float gain_) { |
341 gain = gain_; | 341 gain = gain_; |
342 }; | 342 }; |
343 void AEC::openwdisplay(); | 343 void openwdisplay(); |
344 void AEC::setaes(float aes_y2_) { | 344 void setaes(float aes_y2_) { |
345 aes_y2 = aes_y2_; | 345 aes_y2 = aes_y2_; |
346 }; | 346 }; |
347 double AEC::max_dotp_xf_xf(double u); | 347 double max_dotp_xf_xf(double u); |
348 }; | 348 }; |
349 | 349 |
350 #define _AEC_H | 350 #define _AEC_H |
351 #endif | 351 #endif |