discrete signal is made into frames, removal of transient noise is aim.kernel is used as affinity metric to determine frames with transient noise.s is kernel scale. loglog plot should be as in figure attached but we are getting in different way.

1 view (last 30 days)
%discrete signal is made into frames, we are trying to remove transient noise in which kernel is used as affinity metric to determine frames with transient noise. here s is kernel scale value which should be from the linear region of loglog graph.we should get the loglog plot as shown in figure but we are getting it in a different way. can u please find where we are going wrong
clc;
close all;
clear all;
%x=input('enter the sequence x=');
[y1,fs]=wavread('C:\Users\COMPAQ\Desktop\speech sounds\household_noisy1.wav');
y=y1(2001:25000);
n=length(y);
N=100;%no.of samples in each frame is fixed
ym=reshape(y,N,[]);
m=n/N;%no. of frames
g=zeros(N,m);
ya=zeros(N,m);
for k=1:m
x=ym(:,k)';
w=x;
z=x;
for i=1:N-1
for i=N-1:-1:1 %right shift by 1 element
x(i+1)=x(i);
end
x(1)=0;
z=[z;x];
end
r=[z]*[w'];
r=r/n; %normalization
p=N-1;
a = levinson(r,p);
g(:,k)=a';%Auto Regressive coefficients
y1p=0;
yp=ym(:,k)';
for j=1:N
for i=1:N-1
yp(i)=yp(i+1);%left shift by 1 element
end
yp(N)=0;
y1p= y1p+(g(j,k).*yp);
end
ya(:,k)=y1p';
end
disp(ya);
ysmeart= ym - ya;%smeared version eq:11 achieved
ysmearf=fft(ysmeart);
ysmearf = ysmearf';
psd=((abs(ysmearf)).^2)./N;
sumkernel=0;
s=0.0001:10;
for i=1:m
for j=1:m
summation=(abs(psd(i,:)-psd(j,:))).^2;
ps=sum(summation(:));
sumkernel=sumkernel + exp(-(ps)/2*s.^2);
end
end
loglog(s,sumkernel);

Answers (0)

Community Treasure Hunt

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

Start Hunting!