Am i adding the additive noise to every sample? Speaker Recogntion

1 Ansicht (letzte 30 Tage)
Bisma Waheed
Bisma Waheed am 18 Apr. 2018
I want to add random noise to my voice samples. this method works but i am not sure if noise is been added correctly because this noise is very less and my results are heavily being affected with it.The recognition rate has gone from 100 percent to 1 percent with so little noise. All of the voice samples now match the same speaker.
For example -i have 10 speakers and 90 samples. All samples match speaker 9.
function test(testdir, n, code)
for k = 1:n % read test sound file of each speaker
file = sprintf('%sc%d.wav', testdir, k);
[s, fs] = audioread(file);
rng default
noise = 0.1 * rand(size(s));
noisySig = s + noise;
SNR4545= snr(s,noise);
% calc SNR using equation
sigPow_check = 10 * log10(mean(s.^2)); % signal power
noisePow_check = 10 * log10(mean(noise.^2));% noise power
SNR_check = sigPow_check - noisePow_check;
fprintf('\n calculation with equation: \n');
fprintf('SNR: %.2f dB \n', SNR_check) ;
fprintf('noise power: %.2f dB \n', noisePow_check) ;
fprintf('signal power: %.2f dB \n', sigPow_check) ;
x= noisySig ;
v = mfcc(x, fs); % Compute MFCC's
distmin = inf;
k1 = 0;
for l = 1:length(code) % each trained codebook, compute distortion
d = disteu(v, code{l});
dist = sum(min(d,[],2)) / size(d,1);
if dist < distmin
distmin = dist;
k1 = l;
end
end
msg = sprintf('speaker%d -->> s%d', k, k1);
disp(msg);
end
RESULTS: calculation with equation: SNR: -9.78 dB noise power: -24.78 dB signal power: -34.56 dB speaker1 -->> s20
calculation with equation:
SNR: -11.98 dB
noise power: -24.78 dB
signal power: -36.76 dB
speaker2 -->> s20
calculation with equation:
SNR: -17.55 dB
noise power: -24.78 dB
signal power: -42.33 dB
speaker3 -->> s20
calculation with equation:
SNR: -16.25 dB
noise power: -24.78 dB
signal power: -41.03 dB
speaker4 -->> s20
calculation with equation:
SNR: -15.76 dB
noise power: -24.78 dB
signal power: -40.54 dB
speaker5 -->> s20
calculation with equation:
SNR: -13.60 dB
noise power: -24.78 dB
signal power: -38.39 dB
speaker6 -->> s20
calculation with equation:
SNR: -11.78 dB
noise power: -24.78 dB
signal power: -36.57 dB
speaker7 -->> s20
calculation with equation:
SNR: -14.39 dB
noise power: -24.79 dB
signal power: -39.18 dB
speaker8 -->> s20
calculation with equation:
SNR: -17.02 dB
noise power: -24.79 dB
signal power: -41.81 dB
speaker9 -->> s20
calculation with equation:
SNR: -11.09 dB
noise power: -24.78 dB
signal power: -35.87 dB
speaker10 -->> s20

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by