hello, i have equation, but dont know how to solve it, x=argmaxD(epsilon), please help

4 views (last 30 days)
here my code before the equation
[y,fs]=audioread('drm-15435.if.wav');
%[y,fs]=audioread('drm-6095.if.wav');
pwelch(y,[ ],[ ],fs);
y1 = y.*exp(-1i*2*pi*(0:length(y)-1)'*12/48);
pwelch(y1,[ ],[ ],fs);
yf = filter(one,y1);
pwelch(yf,[ ],[ ],fs);
q=yf(1:4:end);
pwelch(q,[ ],[ ],fs/4);
Nu = 288;
Ng = 32;
Nu1 = 256;
Ng1 = 64;
Nu2 = 176;
Ng2 = 64;
Nu3 = 112;
Ng3 = 88;
a = size(q,1);
two =(subs(a , a + Ng-1));
two1 =(subs(a , a + Ng1-1));
two2 =(subs(a , a + Ng2-1));
two3 =(subs(a , a + Ng3-1));
for epsilon = 1:1000
q1= q(epsilon :epsilon+Ng-1);
q2= q(epsilon+ Ng+Nu: epsilon+Ng-1+Ng+Nu);
D(epsilon)= abs(sum(q1.*conj(q2)))-0.5 * sum(abs(q1).^2+abs(q2.^2));
end
for epsilon = 1:1000
q1= q(epsilon :epsilon+Ng1-1);
q2= q(epsilon+ Ng1+Nu1: epsilon+Ng1-1+Ng1+Nu1);
D1(epsilon)= abs(sum(q1.*conj(q2)))-0.5 * sum(abs(q1).^2+abs(q2.^2));
end
for epsilon = 1:1000
q1= q(epsilon :epsilon+Ng2-1);
q2= q(epsilon+ Ng2+Nu2: epsilon+Ng2-1+Ng2+Nu2);
D2(epsilon)= abs(sum(q1.*conj(q2)))-0.5 * sum(abs(q1).^2+abs(q2.^2));
end
for epsilon = 1:1000
q1= q(epsilon :epsilon+Ng3-1);
q2= q(epsilon+ Ng3+Nu3: epsilon+Ng3-1+Ng3+Nu3);
D3(epsilon)= abs(sum(q1.*conj(q2)))-0.5 * sum(abs(q1).^2+abs(q2.^2));
end
subplot(2,2,1)
plot(D)
title('D')
subplot(2,2,2)
plot(D1)
title('D1')
subplot(2,2,3)
plot(D2)
title('D2')
subplot(2,2,4)
plot(D3)
title('D3')

Answers (1)

Massimo Zanetti
Massimo Zanetti on 8 Oct 2016
Given D, then just
[~,e]=max(G)

Community Treasure Hunt

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

Start Hunting!