Icky
Computer
- Feb 1, 2005
- 2
I'm working on simulating a full duplex conference phone in Matlab, so that I can test the code for the phone. One thing I'll be using it for is echo cancellation. The problem I've run into is that I'm forced to use a loop that is very timeconsuming, and I'm trying to find a better way of handling it in Matlab.
Below is some schematics of how I picture the system.
* IN1 and IN2 are vectors, sound, data into the system
* phone() is a function that can be changed depending on the application. Indata is one sample (int) and out is another (int)
* feedback() is a function that for each sample in produces an echo that is added to IN1 or IN2
* phoneline() is left out for this example
An easy application using this system would be to have the phones working as regular speaker phones (half duplex), that is whoever talks louder gets to transmit.
Such an application would not transmit data coming from say IN2 if it had "louder" data on OUT1.
And this is where I get into trouble. Since my function phone() will change the indata of the whole system, I must loop it for every sample in IN1 and IN2.
Or are there some other nifty way to do such a thing in Matlab? Any ideas?
//Magnus
Below is some schematics of how I picture the system.
* IN1 and IN2 are vectors, sound, data into the system
* phone() is a function that can be changed depending on the application. Indata is one sample (int) and out is another (int)
* feedback() is a function that for each sample in produces an echo that is added to IN1 or IN2
* phoneline() is left out for this example
Code:
IN1 ---> phone() --> phoneline() --> phone() --> OUT1
feedback() feedback()
OUT2 <-- phone() <-- phoneline() <-- phone() <-- IN2
Such an application would not transmit data coming from say IN2 if it had "louder" data on OUT1.
And this is where I get into trouble. Since my function phone() will change the indata of the whole system, I must loop it for every sample in IN1 and IN2.
Or are there some other nifty way to do such a thing in Matlab? Any ideas?
//Magnus