|
|
real time analog input and output
hello,
i'm trying to get a code which will continuously sample an analog input (microphone) and then output the sample to a speaker.
i'm trying to do it using 2 TimerFcn, one for the input and one for the output, but only one of them is working (the last).
i also tried doing it with one timer function but i keep getting an error.
anyone have an idea?
thanks.
|
|
0
|
|
|
|
Reply
|
lior
|
6/11/2010 9:08:04 PM |
|
You are using the DAQ toolbox? The fastest way to accomplish this might be a getsample() followed by a putsample()
"lior " <liord2@gmail.com> wrote in message <huu8jk$458$1@fred.mathworks.com>...
> hello,
> i'm trying to get a code which will continuously sample an analog input (microphone) and then output the sample to a speaker.
> i'm trying to do it using 2 TimerFcn, one for the input and one for the output, but only one of them is working (the last).
> i also tried doing it with one timer function but i keep getting an error.
>
> anyone have an idea?
>
> thanks.
|
|
0
|
|
|
|
Reply
|
Patrick
|
6/11/2010 10:24:07 PM
|
|
http://spikehound.sourceforge.net/
This matlab program will route the data from any input source (daq toolbox) to the computer speakers using the "listen" button. It was originally designed so that you could capture neural spikes on a national instruments board (or otherwise) and listen to them on your speakers.
It works by hooking the "samples acquired function" of a data acquisition object. After a certain number of samples are captured on the input, the samp acq func is called and the samples are put into the output buffer of an analog output.
It's tricky. In theory, the sample rates of your inputs and outputs need to be the same or you need to do interpolation or resampling to get your output signal matching your input signal in time.
Then, as you backfill the output buffer (using putdata) it may be that your device finishes before you can pump more data in, so you'll need to restart it with the next chunk of data. Spikehound (the software at the link above) is provided in compiled and .m code version. There's a "listen" button that allows you to route the selected input channel to your system speakers.
And you'll have to be careful about feedback if you're using a mic and speakers. The software won't do feedback cancelation.
Good luck
|
|
0
|
|
|
|
Reply
|
Gus
|
6/12/2010 12:12:26 PM
|
|
"lior" wrote in message <huu8jk$458$1@fred.mathworks.com>...
> hello,
> i'm trying to get a code which will continuously sample an analog input (microphone) and then output the sample to a speaker.
> i'm trying to do it using 2 TimerFcn, one for the input and one for the output, but only one of them is working (the last).
> i also tried doing it with one timer function but i keep getting an error.
>
> anyone have an idea?
>
> thanks.
pls see this...data can be =wavread()
or DAQ output
data = getdata(AI);
q = quantizer([16 10]);
input2=num2bin(q,data);
input3=double(input2);
input5=input3-48;
|
|
0
|
|
|
|
Reply
|
bkv.kannur (2)
|
2/7/2012 8:59:11 PM
|
|
"lior" wrote in message <huu8jk$458$1@fred.mathworks.com>...
> hello,
> i'm trying to get a code which will continuously sample an analog input (microphone) and then output the sample to a speaker.
> i'm trying to do it using 2 TimerFcn, one for the input and one for the output, but only one of them is working (the last).
> i also tried doing it with one timer function but i keep getting an error.
>
> anyone have an idea?
>
> thanks.
pls see this...data can be =wavread()
or DAQ output
data = getdata(AI);
q = quantizer([16 10]);
input2=num2bin(q,data);
input3=double(input2);
input5=input3-48;
|
|
0
|
|
|
|
Reply
|
bkv.kannur (2)
|
2/7/2012 8:59:11 PM
|
|
|
4 Replies
414 Views
(page loaded in 0.059 seconds)
Similiar Articles: real time analog input and output - comp.soft-sys.matlab ...hello, i'm trying to get a code which will continuously sample an analog input (microphone) and then output the sample to a speaker. i'm trying to d... Analog output board with Real time windows target - comp.soft-sys ...Hi all, I need to use the Analog Output Block in Real Time Windows Target for ... between FlightGear and Matlab - comp.soft-sys ... real time analog input and output ... A development platform for implementation of hardware-in-the-loop ...... Encoder Input Block, Digital Input Block, Analog Output Block, Frequency Output Block, Digital Output Block and Pulse Output Block. The platform achieves real-time ... Realtime exchange between FlightGear and Matlab - comp.soft-sys ...real time analog input and output - comp.soft-sys.matlab ... stop matlab from execution - comp.soft-sys.matlab Simulink® Real Time Execution - File Exchange - MATLAB ... Interpreting Top output - comp.unix.programmerreal time analog input and output - comp.soft-sys.matlab ... Interpreting Top output - comp.unix.programmer... more time and finally noticed there words cputime and real ... Capturing the output of a vim command into a buffer or register ...real time analog input and output - comp.soft-sys.matlab ..... so that you could capture ... and the samples are put into the output buffer ... ps output length for ... Analog audio filter in Simulink - comp.soft-sys.matlabreal time analog input and output - comp.soft-sys.matlab ... Audio Lag using Optical Audio - CNET Home audio ... Sigma Delta - Decimation Filter Design - comp.dsp ... Real-Time Windows Target and RS232 communication? - comp.soft-sys ...Accessing the UART for serial communication in linux - comp.unix ... real time analog input and output - comp.soft-sys.matlab ... Real-Time Windows Target and RS232 ... Voltage Limiting Input Voltage to Codec ADC - comp.dspreal time analog input and output - comp.soft-sys.matlab ... Voltage Limiting Input Voltage to Codec ADC - comp.dsp Yeah, I'm going to add that this time also ... Matlab with card PCI-1711? - comp.soft-sys.matlabIn RTW, the Configuration of analog input and analog output is all correct. ... Analog output board with Real time windows target - comp.soft-sys ... Data Acquisition from ... real time analog input and output - comp.soft-sys.matlab ...hello, i'm trying to get a code which will continuously sample an analog input (microphone) and then output the sample to a speaker. i'm trying to d... NetAcquire Analog Input/Output - Real-Time Distributed Analog ...The NetAcquire AIO 3000 distributed data acquisition system not only monitors and controls equipment that is hundreds of feet away, but offers powerful real-time ... 7/24/2012 1:47:17 AM
|
|
|
|
|
|
|
|
|