sound card input and noise cancel

hello i want to cancel some noise of frigirator in my house i want coninously input from sound card and output throw speakers signal with phase -180 what command coniounusly do it all command just record
y = wavrecord(31250*5,31250);
also is there beter way than sending to speaker -y , i was thinkink about some adaptive filter lms or wiener to cancel the noise in my room

5 comentarios

michael scheinfeild
michael scheinfeild el 5 de Oct. de 2012
Editada: Walter Roberson el 5 de Oct. de 2012
i have found somthing in data acquisition but it not work succefuly i think some timing can anybody help , the sound output not synchronized i inveresed the signal
============================
ai = analoginput('winsound');
addchannel(ai,1:2);
set(ai,'SampleRate',44100)
set(ai,'SamplesPerTrigger',44100)
ao = analogoutput('winsound');
addchannel(ao,1:2);
set(ao,'SampleRate',44100)
for k=1:10
start(ai)
wait(ai,3)
data = getdata(ai);
putdata(ao,[ -data ])
start(ao)
end
delete(ai)
delete(ao)
clear ao
Walter Roberson
Walter Roberson el 5 de Oct. de 2012
You are getting one second's worth of samples each time. Your sound is going to have traveled at least 660 feet before you start to output the canceling sound. That has no chance of being useful unless the speaker is at least 660 feet closer to the listener than the microphone is.
Daniel Shub
Daniel Shub el 5 de Oct. de 2012
I am not sure that this is true. If the noise is a low frequency periodic hum, for example a compressor motor, then slipped cycles shouldn't be a problem.
Walter Roberson
Walter Roberson el 5 de Oct. de 2012
Good point, Daniel.
michael scheinfeild
michael scheinfeild el 6 de Oct. de 2012
yes it is harmonic noise from pumps tweo floors bentith my apartment it wake me up in the middel of the night i was thinking maybe just sending white noise to the air to cancel this noise

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Oct. de 2012

0 votos

Sending sounds out of phase 5 seconds after the original sound is not going to achieve any cancellation.
You need to use operations with low latency. The tolerable latency will depend upon the relative distances between the sound source, the microphone, the speaker, and the listener. You will have strong difficulty in getting the microphone latency to less than 6 ms in MATLAB, which is approximately 4 feet of travel for sound (at room temperature). Even getting to 6 ms is not easy, but it is easier as of R2012b (or was it R2012a) which added support for ASIO channels.
You might need the Data Acquisition Toolkit to access the data in nearly those time frames.

Más respuestas (1)

michael scheinfeild
michael scheinfeild el 6 de Oct. de 2012

0 votos

lets say i want each time to process block of 1024 what is the command for both input and output

Categorías

Más información sobre Audio I/O and Waveform Generation en Centro de ayuda y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by