2016-08-21 1 views
1

私は理論的には受信機に到着する電力ピークのみを保存する測定データセットを持っています。これらのピークは4秒間隔で受信する必要があります(実際のシナリオでは少し逸脱する)。これで Example dataおそらくノイズの多いデータのセットでは、実際のデータのピークが均等になることがわかっているので、MATLABを使用して実際のデータをどのように検出できますか?

問題は、システムはまた、Iは画像の例のように、研究中又は同じ供給源からのエコーとして興味以外のソースからランダムデータを受信することができるということです青色のデータが実データであり、の赤色のデータが無視されるべきランダムなデータです

MATLABを使用して(おそらくいくつかの統計知識を使用して)最も望ましいデータを検出する最も良い方法は何ですか? (それはエコーかどう時々「寄生虫」データも、4秒の間隔を置いて配置することができる)

答えて

1

次のコードは、4
の倍数に近いギャップの最長系列に属する時間タグを検索しアルゴリズムは、有効なギャップがシリーズから欠落している可能性があると仮定します(連続性を検索しません)。

%T is the X coordinate of your graph (time tag). 
%Notice: The amplitude is irrelevant here. 
T = [1, 2, 5, 6, 7, 10, 12, 14]; 

%Create all possible combinations of indexes of T. 
[Y, X] = meshgrid(1:length(T)); 

%G matrix is the combinations of all gaps: 
%T(1) - T(1), T(2) - T(1), T(3) - T(1)... 
%It is inefficient to compute all gaps (even in reverse and T(1) - T(1)), 
%But it is a common way to solve problems using Matlab. 
G = T(X) - T(Y); 

%Ignore sign of gaps. 
G = abs(G); 

%Remove all gaps that are not multiple of 4 with 0.1 hysteresis. 
%Remove gaps like 5, 11, and 12.7... 
G((mod(G, 4) > 0.1) & (mod(G, 4) < 3.9)) = 0; 

%C is a counter vector - counts all gaps that are not zeros. 
%Now C holds the number of elements in the relevant series of each time sample. 
C = sum(G > 0, 1); 

%Only indexes belongs to the maximum series are valid. 
ind = (C == max(C)); 

%Result: time tags belongs to the longest series. 
resT = T(ind) 

注:それを行いますこと、

T = [1, 2, 5, 6, 7, 10, 12, 14]; 
len = length(T); 
C = zeros(1, len); 

for i = 1:len-1 
    j = i; 
    k = i+1; 
    while (k <= len) 
     gap = T(k) - T(j); 
     if (abs(gap - 4) < 0.1) 
      C(i) = C(i) + 1; %Increase series counter. 

      %Continue searching from j forward. 
      j = k; 
      k = j+1; 
     else 
      k = k+1; 
     end 

     if (gap > 4.1) 
      %Break series if gap is above 4.1 
      break; 
     end     
    end 
end 

%now find(C == max(C)) is the index of the beginning of the longest contentious series. 
+0

まあ:あなたが隙間なく最長のシリーズを探している場合は
次のコードを使用することができます!どうもありがとう! :) – ebernardes

+0

喜んでください...私の解決策はすべてのケースをカバーしていないことに注意してください。例えば、2つの非常に近いパルスが間違って数えられるかもしれません。私もそれを徹底的にテストしなかった。 – Rotem

+0

最初の1つまたは2つ目のどちらのソリューションが好きですか? – Rotem

関連する問題