Minimize L2 Norm of a Function

11 Ansichten (letzte 30 Tage)
M Salman Rashed
M Salman Rashed am 30 Okt. 2016
Beantwortet: M Salman Rashed am 4 Nov. 2016
Hi all
As already aware, I am establishing myself in MATLAB and seeking answers sometimes to trivial queries... But need this to get going, so I apologize if my queries sound stupid to you.
Have got response on just a couple of queries so far, please do give me a go on this. I have a normalized random sequence "a" of length "j", which I want to follow and window function "w"(upramp / downramp). The difference between the sequence values after adding "a" to "w" is "e" or error function.
Now, how can I minimise the L2 Norm of the function e(j) = (a(j)- w(j))??? I can calculate
||e||2 = sqrt (sum ((a(j)- e(j)).^2));
But how do I minimize this function??? A prompt help will be appreciated...
Regards

Akzeptierte Antwort

M Salman Rashed
M Salman Rashed am 4 Nov. 2016
Answer found. By taking derivative of squared error, the function is optimized. The mathematical expression reduces simply to a simplified version of an and an. Using this with a small step in iterations, the desired result is achieved.
Gracias Walter and the community

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 30 Okt. 2016
It is also possible to express the question for use with fminsearch or fmincon (or the other fmin* functions).
It is not completely clear what you are optimizing. Is it the content of the a vector directly? Is your a variable pre-determined and the question is to find the best order of it ?
  2 Kommentare
M Salman Rashed
M Salman Rashed am 31 Okt. 2016
Bearbeitet: Walter Roberson am 31 Okt. 2016
Hi Walter. Thanks for the response. Will try to explain this
I have a random sequence "a" that i want to use as a code from a transmitter. I am using ramping function "w" so that my sequence rides the ramping function and is ramped up initially from zero to say a base value of "1", stays for some time at base value "1" and then ramps down. Being random signal, I will have peaks and troughs from the base value, and I wish to minimise the error (difference between sequence 'a' and ramping function "w"). Part of the code is attached below.
a = randn (100,3); % Random normalised sequence
w = u = [( 1/2 + (1/2 * cos ((linspace (0, pi, (length(ab)/5))) + pi))) ones(1,(length (ab)*2/5)) (1/2 + (1/2 * cos (linspace (0, pi, (length(ab)*2/5))))) ]; % Window Ramping function
figure (); hold on; plot (u) % Plot of Ramping function
an = a + repmat (u', 1, K); % Signal to window conversion
plot (abs (an)) % Plot of signal following window
Now I wish to minimise the positive and negative peaks of this new signal "an" as compared to "w", so that the random sequence remains random but follows the window as well i.e.
min e = "an - w"
I have been told to utilise the l-2 norm optimization as it works best for this sequence.
Cheers
Walter Roberson
Walter Roberson am 31 Okt. 2016
What is permitted to be varied? Should the a be randomly regenerated many times until you randomly find a good an ? Should a be input to the minimization and the task is to find the best a in a non-random manner? Should some parameter creating the window function w be changed? Should something about the way an is created be changed?

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by