why the optimal value equals infinity
Show older comments
clear
close all
clc
%%
B=8e6;
taw=8e-6;
K=B/taw;
fs=7*B;
t=-taw/2:1/fs:taw/2;
freq_func=K*t;
plot(t,freq_func)
%%
phi=[];
for jj=1:length(freq_func)
vv=(t(2)-t(1))*sum(freq_func(1:jj));
phi=[phi vv];
end
x_t=exp(1j*2*pi*phi);
% plot(real(x_t))
x_tcorr=abs(xcorr(x_t));
x_tcorr=x_tcorr/max(x_tcorr);
[val,indx]=findpeaks(x_tcorr);
sortval=sort(val,'descend');
SLL=pow2db((sortval(2)/sortval(1))^2)
plot(real(x_tcorr))
plot(20*log10(x_tcorr))
%% OPTIMIZATION
% Given data
x = x_t.'; % vector of complex numbers
N_L = 8; % integer constant
% p = ...; % integer constant
LPG=-2;
alpha =db2pow(-LPG); % positive scalar constant
beta =[449 443.111 389.596 323.947 243.949 158.551 76.6573 5.99828];% 1:1:2*N_L; % vector of positive scalar constants
B=fliplr(beta);
beta=[B beta];
% lambda = ...; % cell array of complex vectors
N=length(x);
colsig= [flipud(x); zeros(N-1,1)];
A=zeros(2*N-1,N);
for i=1:N
A(:,i)=colsig;
colsig=circshift(colsig,1);
end
W=A([N-7 N-6 N-5 N-4 N-3 N-2 N-1 N N+1 N+2 N+3 N+4 N+5 N+6 N+7],:);
A([N-7 N-6 N-5 N-4 N-3 N-2 N-1 N N+1 N+2 N+3 N+4 N+5 N+6 N+7],:)=[];
% N = length(x);
% K=randi([N+2 2*N],1);
% p=floor((K-N)/2);
% pading=zeros(K-1,1);
% col_1=vertcat(x,pading);
% A=zeros(K+N-1,length(x));
% for ii=1:length(x)
% col_ii= circshift(col_1,ii-1);
% A(:,ii)=col_ii;
% end
% F=ones(1,2*N+2*p-1);
% F=ones(1,length(x));
% F(N+p+2)=0;
% mat_F=diag(F);
% y=A*x;
% cost_func=y'*mat_F*y;
% Define optimization variables
% p=N;
p=floor(N/2-1);
A=real(A);
W=real(W);
cvx_begin
variables y(N) t
% Define objective function
minimize t
% Define constraints
subject to
(x'*y) == (x'*x)
for i =1:2*p-1
if abs(i) >= N_L
((y')*(A(i,:)'))*A(i,:)*y <= t
else
((y')*(W(i,:)'))*W(i,:)*y <= beta(abs(i))
end
end
% for o = 1:2*N_L-1
%
% ((y')*(W(o,:)'))*W(o,:)*y <= beta(abs(o))
% end
% for i =-p:p
% if abs(i) >= N_L
% (( y')*(A(i+N+p,:))')*A(i+N+p,:)*y <=t
% end
% end
% for o = 1:2*N_L
% (( y')*(A(o+N+p,:))')*A(o+N+p,:)*y <= beta(abs(o))
% end
(y'*y) <= (alpha)*(x'*x);
cvx_end
%%
x_tcorr=abs(xcorr(x_t));
x_tcorr=x_tcorr/max(x_tcorr);
[val,indx]=findpeaks(x_tcorr);
sortval=sort(val,'descend');
SLL=pow2db((sortval(2)/sortval(1))^2)
mmf=abs(xcorr(x,y));
plot(20*log10(mmf/max(mmf)))
hold on
plot(20*log10(x_tcorr))
x_tcorr1=abs(xcorr(y));
x_tcorr2=x_tcorr1/max(x_tcorr1);
% plot(20*log10(x_tcorr2))
[val,indx]=findpeaks(x_tcorr2);
sortval1=sort(val,'descend');
SLL2=pow2db((sortval1(2)/sortval1(1))^2)
4 Comments
Walter Roberson
on 25 Apr 2023
Walter Roberson
on 25 Apr 2023
minimize t
But nothing in the constraints involves t so the minimum is going to be at one of the infinities.
Mohamed
on 25 Apr 2023
Torsten
on 25 Apr 2023
Maybe abs(i) is always < N_L for your system ?
Answers (0)
Categories
Find more on Direct Search in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

