how can i convert the recorded voice into noise using any algorithm in matlab?

조회 수: 3 (최근 30일)
haseeb
haseeb 2014년 7월 7일
편집: John D'Errico 2014년 7월 22일
i'm trying to make my own algorithm which is capable of converting the reocrded voice into noise, and when i apply the reverse process on the converted voice; i.e. noise, i should get the original recorded voice. well, i'm doing this, so that if someone plays that voice, it appears to him like a noise.. and when i perform the reverse operation on that converted voice, i.e. noise, i should get the original voice back? here's the code how em making the recorded voice into noise? this code is working but upto certain extent. the recorded voice is converted into noise but one can hear the original voice in the background, and if someone plays that noise into some audio player using slow mode, a man can hear that voice.. can someone do some modifications in that code,so that i should completely become the noise and no one can hear that voice, even if someone plays that voice in some audio player in slow mode.. and when i apply the reverse process, i should get the original voice back.. the code is:
c=wavread('haseeb');
a=(c-min(c))/(max(c)-min(c)); % normalization to bring the voice values in the range [0,1]
for i=1:length(a)
% speading the values into the range[-1,1]
if((a(i,1)>=0)&&(a(i,1)<=0.2))
b(i,1)=a(i,1)-1;
elseif((a(i,1)>0.2)&&(a(i,1)<=0.4))
b(i,1)=a(i,1)+0.6;
elseif((a(i,1)>0.4)&&(a(i,1)<=0.6))
b(i,1)=a(i,1)-0.5;
elseif((a(i,1)>0.6)&&(a(i,1)<=0.8))
b(i,1)=a(i,1)-1.2;
elseif((a(i,1)>0.8)&&(a(i,1)<=1))
b(i,1)=a(i,1)-0.4;
else
end
end
  댓글 수: 1
haseeb
haseeb 2014년 7월 7일
i don't want to add any linear noise, e.g. awgn or salt&pepper.. i've to do some programming to make the recorded voice a noise, and then apply the reverse process on converted voice, i.e. noise to get back the original recorded voice. hope someone will help me :)

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2014년 7월 22일
Just scramble:
clc;
m= 11:19 % Sample data
% Get random locations where to send elements to.
randomLocations = randperm(numel(m))
% Get a new array, pulling elements from those locations.
% It will be m, but scrambled.
scrambled_m = m(randomLocations)
% Restore signal:
% Find out where things need to come from.
[~, sortOrder] = sort(randomLocations)
% Rearrange elements to original order.
restored_m = scrambled_m(sortOrder)
In the command window:
m =
11 12 13 14 15 16 17 18 19
randomLocations =
3 9 5 4 6 7 8 1 2
scrambled_m =
13 19 15 14 16 17 18 11 12
sortOrder =
8 9 1 4 3 5 6 7 2
restored_m =
11 12 13 14 15 16 17 18 19

John D'Errico
John D'Errico 2014년 7월 22일
편집: John D'Errico 2014년 7월 22일
Image has the right solution, almost. In fact, I like it, but it is imperfect since you need to know the sort order, and since that order was random, you would need to store that order with the signal. (You could store the random seed of course, but you would still need to store some information.)
Instead, a simple deterministic scramble should work nicely, and all you need to know is the length of the signal. For example, suppose your signal has length 20. I'll call it n. We need to choose an integer that is relatively prime to the signal length. I'll choose a sufficiently large prime number that would be unlikely to cause a problem. 94906297 should suffice, chosen as the smallest prime number that exceeds sqrt(2^53).
The number 94906297 is always relatively prime to n as long as n is smaller than 94906297. It will yield a perfectly viable (apparently semi-random) scramble of the numbers 1:n. For
n = 30;
mod((1:n)*94906297,n) + 1
ans =
Columns 1 through 22
8 15 22 29 6 13 20 27 4 11 18 25 2 9 16 23 30 7 14 21 28 5
Columns 23 through 30
12 19 26 3 10 17 24 1
As well, since 94906297 large enough, but not too large, you have no fears of overflowing a double on any signal of reasonable length.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by