Hi,
ich hoffe, ihr könnt mir helfen. Und zwar führe ich eine
Kreuzkorrelation zwischen zwei Signalen durch:
1 | // alle Variablen als int16_t deklariert
|
2 | #undef STEP
|
3 | #define STEP(k) (s1[k] * s2[k - lambda])
|
4 |
|
5 | for (lambda = 40; lambda <= 120; lambda++)
|
6 | {
|
7 | int32_t result;
|
8 |
|
9 | L_result = STEP(0); L_result += STEP(1);
|
10 | L_result += STEP(2); L_result += STEP(3);
|
11 | L_result += STEP(4); L_result += STEP(5);
|
12 | L_result += STEP(6); L_result += STEP(7);
|
13 | L_result += STEP(8); L_result += STEP(9);
|
14 | L_result += STEP(10); L_result += STEP(11);
|
15 | L_result += STEP(12); L_result += STEP(13);
|
16 | L_result += STEP(14); L_result += STEP(15);
|
17 | L_result += STEP(16); L_result += STEP(17);
|
18 | L_result += STEP(18); L_result += STEP(19);
|
19 | L_result += STEP(20); L_result += STEP(21);
|
20 | L_result += STEP(22); L_result += STEP(23);
|
21 | L_result += STEP(24); L_result += STEP(25);
|
22 | L_result += STEP(26); L_result += STEP(27);
|
23 | L_result += STEP(28); L_result += STEP(29);
|
24 | L_result += STEP(30); L_result += STEP(31);
|
25 | L_result += STEP(32); L_result += STEP(33);
|
26 | L_result += STEP(34); L_result += STEP(35);
|
27 | L_result += STEP(36); L_result += STEP(37);
|
28 | L_result += STEP(38); L_result += STEP(39);
|
29 |
|
30 | if (result > max)
|
31 | {
|
32 | x = lambda;
|
33 | max = result;
|
34 | }
|
35 | }
|
Eigentlich interessiert mich aber nur die Stelle der maximalen
Kreuzkorrelation und der entsprechende Wert. Letztendlich benötige ich
für die Berechnung also eine Menge Rechenzeit (um nicht zu sagen, zu
viel), obwohl mich nur ein Wert interessiert. Gibt es eine Möglichkeit,
hier ohne eine vollständige Kreuzkorrelation auszukommen? Oder evtl.
eine einfache Abschätzung, mit der ich dann die Suche nach dem Maximum
auf einige wenige Berechnungen begrenzen kann?
Vielleicht habt ihr eine Idee? Mir ist leider bislang nichts eingefallen
:-(
Vielen dank schonmal im Vorraus!
Viele Grüße
Michael