Finding the wanted linear combination of two parameters

조회 수: 2 (최근 30일)
Markus Toivonen
Markus Toivonen 2018년 6월 8일
답변: Prajit T R 2018년 6월 11일
I am not necessarily looking for the 100% right answer, maybe rather get feedback on how to approach solving this or what areas of mathematics to research to solve this type of problem. If this is not appropiate place to post this, feel free to flag/remove it. Thank you.
I have two different signals:
a*s1
b*s2
And their superposition is
s3 = (a*s1)+(b*s2)
I want to solve the coefficients a and b, so that the maximum value of the superposition, c, and the index where that value occurs, idx, is fixed. So for example, c would be 100 and idx = 106.
Some type of iteration is needed, but what would be the optimal way to do it? I can only think of two for loops that would loop over all the values of a and b (the range would be something like [0 1000] with steps of 0.1), and finding the closest approximation, by comparing to the best previous value we have stored.
  댓글 수: 1
Matt J
Matt J 2018년 6월 8일
This, in general, is impossible. Suppose s1 and s2 and hence also s3 are both linear ramps. You do not have the freedom to specify idx arbitrarily in that case. The maximum must occur either at s3(1) or s3(end).

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

답변 (1개)

Prajit T R
Prajit T R 2018년 6월 11일
Hi Markus
Taking your example of c=100 and idx=106, you wish to find the values of 'a' and 'b' such that value of maximum superposition at the index position is 'c'. We can simplify the equation to get:
c = a*s1(idx) + b*s2(idx)
Let us say the values of s1(idx) and s2(idx) are 6 and 10 respectively. The equation now becomes:
100 = 6*a + 10*b
Now you can obtain a curve for this data and get its maxima. As you suggested, the complexity is O(n^2) as we have to loop over the values of 'a' and 'b'. As we need two equations to solve a two-variable problem, this is the way forward. Unless you have a specific bound for the values of 'a' and 'b', in which case we have the second equation to help us solve for 'a' and 'b'.
With a single equation, there are infinite possible values for 'a' and 'b' and the maximum value may be any of those.
Hope this helps.
Prajit

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by