A list,

Matlab based on different SNR microphones receive signals

Ii. Source code

clear all;
close all;
clc
%****************************************************%
[s,fs]=wavread('C9_1_y.wav');   
s=s/max(abs(s));
sound_length = 6400; % load room impulse response load h.mat; % the microphone1The signal of s1 = conv (s, h1); s1=s1(1:sound_length); % the microphone2The signal of s2 = conv (s, h2); s2=s2(1:sound_length); % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * % % % added white noise SNR =20dB
s1_20db = awgn(s1,20.'measured'.'db');
s2_20db = awgn(s2,20.'measured'.'db');
%SNR=10dB
s1_10db = awgn(s1,10.'measured'.'db');
s2_10db = awgn(s2,10.'measured'.'db');
%SNR=0dB
s1_0db = awgn(s1,0.'measured'.'db');
s2_0db = awgn(s2,0.'measured'.'db');
%SNR=- 5dB
s1_m5db = awgn(s1,- 5.'measured'.'db');
s2_m5db = awgn(s2,- 5.'measured'.'db');
figure(1); % Display original input voice signal waveform subplot(5.2.1),plot(s1,'k'),title('Microphone 1 (original)'),xlabel('Sampling point'),ylabel('幅度');
subplot(5.2.2),plot(s2,'k'),title('Microphone 2 (original)'),xlabel('Sampling point'),ylabel('幅度');
subplot(5.2.3),plot(s1_20db,'k'),title('Microphone 1 (SNR=20dB)'),xlabel('Sampling point'),ylabel('幅度');
subplot(5.2.4),plot(s2_20db,'k'),title('Microphone 2 (SNR=20dB)'),xlabel('Sampling point'),ylabel('幅度');
subplot(5.2.5),plot(s1_10db,'k'),title('Microphone 1 (SNR=10dB)'),xlabel('Sampling point'),ylabel('幅度');
subplot(5.2.6),plot(s2_10db,'k'),title('Microphone 2 (SNR=10dB)'),xlabel('Sampling point'),ylabel('幅度');
subplot(5.2.7),plot(s1_0db,'k'),title('Microphone 1 (SNR=0dB)'),xlabel('Sampling point'),ylabel('幅度'); function [h]=rir(fs, mic, n, r, rm, src); % room impulse response % fs sampling frequency % MIC Microphone coordinates (row vector) % n Number of virtual sound sources (2*n+1) ^3% r Wall reflection coefficient (- 1<R<1) % rm Room size (row vector) % SRC Sound source coordinates (row vector) % % h room impulse response nn=[-n:1:n];                                          
rms=nn+0.50.5* (- 1).^nn;                    
srcs=(- 1).^(nn);                                    
xi=[srcs*src(1)+rms*rm(1)-mic(1)]; % type (92 -* (SRC) yj = [SRCS2)+rms*rm(2)-mic(2)]; % type (9- 3* (SRC) zk = [SRCS3)+rms*rm(3)-mic(3)]; % type (94 -)Copy the code

3. Operation results

Fourth, note

Version: 2014 a