0

私は現在、Android 携帯電話で ECG 信号を使用するプロジェクトに取り組んでいます。

オンラインで何も見つからないように見えるため、Android用の独自の信号処理ライブラリを作成する必要があるかどうかを決定しています。

私が使用できるライブラリを知っている人はいますか、それとも自分で作成する方が簡単で速いでしょうか?

ありがとう

4

1 に答える 1

0

AndroidPlot を使用して、ECG 信号をリアルタイムでプロットしました。私が使用したセンサーは、Bluetooth を介して RL と LL を提供できる 4 リード ECG でした。これはプロットのサンプルですが、必要に応じて自由に変更してください。また、最近の AndroidPlot がここで使用されているメソッドをサポートしていない場合は、調査して変更してください。そして最後に、このメソッドはプロットを再描画し続けるため、効率的ではありません.AndroidPlotは新しいバージョンでより良い実装をサポートしていると思います:

これは、XML でプロットを定義する方法です。

<com.androidplot.xy.XYPlot
android:id="@+id/ecgSPlot"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
title="ECG History" /> 

そして、これはそれをプロットするコードです:

 public static XYPlot ecgHistoryPlot = null; 
 public static SimpleXYSeries ecgLevelsSeries = new SimpleXYSeries( 
        "ECG History");

private static LinkedList<Integer> ecgRaLlHistory = new LinkedList<Integer>(); 
private static LinkedList<Integer> ecgLaLlHistory = new LinkedList<Integer>(); 

/**
 * This method will set plot paramaters including look and label 
 */
private void setMergedPlotParam() { 
    ecgHistoryPlot = (XYPlot) viewRTPlotting.findViewById(R.id.ecgSPlot); 
    ecgHistoryPlot 
        .setRangeBoundaries(-180, 359, XYPlot.BoundaryMode.FIXED); 
    ecgHistoryPlot.setDomainBoundaries(0, 60, XYPlot.BoundaryMode.FIXED); 
    ecgHistoryPlot.addSeries(ecgRaLlHistorySeries, 
        LineAndPointRenderer.class, 
        new LineAndPointFormatter(Color.rgb(0, 0, 255), Color.BLACK)); 

    ecgHistoryPlot.addSeries(ecgLaLlHistorySeries, 
        LineAndPointRenderer.class, 
        new LineAndPointFormatter(Color.rgb(255, 0, 0), Color.BLACK)); 
    ecgHistoryPlot.setDomainStepValue(5); 
    ecgHistoryPlot.setTicksPerRangeLabel(3); 
    ecgHistoryPlot.setDomainLabel("Time"); 
    ecgHistoryPlot.getDomainLabelWidget().pack(); 
    ecgHistoryPlot.setRangeLabel("Level"); 
    ecgHistoryPlot.getRangeLabelWidget().pack(); 
    ecgHistoryPlot.disableAllMarkup(); 
} 

/**
 * This method will update plot data
 */
private static void drawMergedPlot(int EcgRaLl, int EcgLaLl) { 
    Number[] seriesRNumbers = { EcgRaLl, EcgLaLl }; 
    ecgLevelsSeries.setModel(Arrays.asList(seriesRNumbers), 
        SimpleXYSeries.ArrayFormat.XY_VALS_INTERLEAVED); 

    if (ecgRaLlHistory.size() > HISTORY_SIZE 
        || ecgLaLlHistory.size() > HISTORY_SIZE) { 
        ecgRaLlHistory.removeFirst(); 
        ecgLaLlHistory.removeFirst(); 
    } 

    ecgRaLlHistory.addLast(EcgRaLl); 
    ecgLaLlHistory.addLast(EcgLaLl); 

    ecgRaLlHistorySeries.setModel(ecgRaLlHistory, 
        SimpleXYSeries.ArrayFormat.Y_VALS_ONLY); 
    ecgLaLlHistorySeries.setModel(ecgLaLlHistory, 
        SimpleXYSeries.ArrayFormat.Y_VALS_ONLY); 
    ecgSHistoryPlot.redraw(); 
} 

/**
* This method should be called when there's new data.
*/
private static void onSensorReading(int EcgRaLl, int EcgLaLl) { 
    drawMergedPlot(EcgRaLl, EcgLaLl); 
}
于 2013-06-22T02:20:59.077 に答える