【问题标题】:ECG wave form in android application [duplicate]android应用程序中的心电图波形[重复]
【发布时间】:2013-06-21 09:22:35
【问题描述】:

我目前正在做一个涉及在安卓手机上使用心电图信号的项目。

我正在决定是否应该为 android 制作自己的信号处理库,因为我似乎无法在网上找到任何东西。

有人知道我可以使用的库吗,或者我自己制作一个库会更容易、更快捷吗?

谢谢

【问题讨论】:

  • 处理是什么意思?分析还是绘图?
  • 在安卓应用中绘制心电波形

标签: java javascript android signal-processing


【解决方案1】:

我使用 AndroidPlot 实时绘制心电图信号。我使用的传感器是一个 4 导联心电图,可以通过蓝牙提供 RL 和 LL。这是绘图的示例,但您可以根据需要随意修改它。如果最近的 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); 
}

【讨论】:

  • 感谢您的回答。您的心电图传感器给出了什么样的输出?
  • 有效载荷包括传感器样板版本、GPS、Accel 和 Gyro。我已将传感器配置为仅提供 ECG。正如您所看到的代码,它包含 2 个浮点数。
  • 我正在使用脉搏传感器来获取心电图输出,它会给出一个模拟信号,将模拟信号转换为数字信号并通过蓝牙发送到手机 - 任何建议都请
  • 能否请您发送有关您的项目的完整详细信息。plsss selvadinesh8@gmail.com
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-02-25
  • 1970-01-01
  • 2015-08-12
  • 2011-01-12
相关资源
最近更新 更多