12/11/2017 Correlation
Contents
MatchingNoiseandSpeech
Method1finddelay
Method2MovieSlateWay
MatchingNoiseandSpeech
clc;close all; clear all;
% Read audio files
[input,ifs] = audioread('Real_Input_Final.m4a');
input = (input(:,1)+input(:,2))/2;
[noise,fs] = audioread('Realnoise.m4a');
noise = resample(noise,ifs,fs);
Method1finddelay
% Find how many delays
D = finddelay(noise,input);
% Trim signals before delay time
input_1 = input(D:end,1);
% Make the length of noise same as the length of speech
noise_1 = noise(1:length(input_1),1);
% Run adaptive filters here
Method2MovieSlateWay
% Find the max inpluse signal and its index
[M_n,I_n] = max(noise);
[M_i,I_i] = max(input);
% Trim signals before the impulse signal
noise_2 = noise(I_n:end,1);
input_2 = input(I_i:end,1);
% Make the length of noise same as the length of speech
noise_2 = noise_2(1:length(input_2),1);
% Run adaptive filter here
PublishedwithMATLABR2017a
le:///Users/Y/Desktop/Google%20%E4%BA%91%E7%AB%AF%E7%A1%AC%E7%9B%98/EECS%20351/EECS351%20Project/Final/Code_TO_SUBMIT_V3/h 1/2