Solving system of inequalities where individual variables already have constraints

27 Views Asked by At

I'm currently trying to come up with an alternative to the Griffin Lim algorithm in signal processing, and I have come to a stage where I need to solve a system of inequalities where the variables are simple trigonometric functions. Here is a simple GNU Octave code which is self explanatory

s = [3 1 4 1 5 9 2 6];
f = fft(s);
a = abs(f);
an = arg(f);
p = an;
#vat1 is the value of the signal at time 1
vat1 = 0.25*(a(2)*cos(p(2)) + a(3)*cos(p(3)) + a(4)*cos(p(4))) + (1/8)*(a(1) + a(5)*cos(p(5)))
#vat2 is the value of the signal at time 2
vat2 = 0.25*(a(2)*(0.7071*cos(p(2)) - 0.7071*sin(p(2))) - a(3)*sin(p(3)) - a(4)*(0.7071*cos(p(4)) + 0.7071*sin(p(4)))) + 0.125*(a(1) - a(5)*cos(p(5)))
#vat3 is the value of the signal at time 3
vat3 = 0.25*(-a(2)*sin(p(2)) - a(3)*cos(p(3)) + a(4)*(sin(p(4)))) + 0.125*(a(1) + a(5)*cos(p(5)))
#vat4 is the value of the signal at time 4
vat4 = 0.25*(a(2)*(-0.7071*cos(p(2)) - 0.7071*sin(p(2))) + a(3)*sin(p(3)) + a(4)*(0.7071*cos(p(4)) - 0.7071*sin(p(4)))) + 0.125*(a(1) - a(5)*cos(p(5)))
#vat5 is the value of the signal at time 5
vat5 = 0.25*(a(2)*(-cos(p(2))) + a(3)*cos(p(3)) - a(4)*cos(p(4))) + (1/8)*(a(1) + a(5)*cos(p(5)))
#vat6 is the value of the signal at time 6
vat6 = 0.25*(a(2)*(-0.7071*cos(p(2)) + 0.7071*sin(p((2)))) + a(3)*(-sin(p(3))) + a(4)*(0.7071*cos(p(4)) + 0.7071*sin(p(4)))) + 0.125*(a(1) - a(5)*cos(p(5)))
#vat7 is the value of the signal at time 7
vat7 = 0.25*(a(2)*(sin(p(2))) + a(3)*(-cos(p(3))) + a(4)*(-sin(p(4)))) + 0.125*(a(1) + a(5)*cos(p(5)))
#vat 8 is the value of the signal at time 8
vat8 = 0.25*(a(2)*(0.7071*cos(p(2)) + 0.7071*sin(p(2))) + a(3)*(sin(p(3))) + a(4)*(-0.7071*cos(p(4)) + 0.7071*sin(p(4)))) + 0.125*(a(1) - a(5)*cos(p(5)))

I'm using a user defined signal 's'(just for an example, I am using the first few digits of Pi). It can be replaced with any 8 point signal. Next, I have the variables f(discrete fourier transform of signal), a(magnitudes of each of the components of f), and an(angle of each of the components of f).

Now that I have all of this, I have written expressions for the value of the signal at time ranging from 1 to 8. This is given by vat1, vat2.... vat8.

I know that the "vat" variables have a minimum possible value of 0 and a maximum possible value of 9. That is,

0<=vat_x<=9

Given this set of 8 inequalities, my intention is to solve for the possible values of phase p from only values of amplitudes a. It obviously won't give the exact phase values, but any sensible possible range is great.

I could assume that cos(p) itself is a variable, but then it gives really weird answers. Is there any way of solving this set taking into consideration that the variables involved have predefined limits?