【问题标题】:Using NeuroSky's Mindwave Mobile(to measure brainwave) and Raspberry 3 to do FFT(to get certain frequency) with Python 2.7使用 NeuroSky 的 Mindwave Mobile(测量脑电波)和 Raspberry 3 使用 Python 2.7 进行 FFT(获取特定频率)
【发布时间】:2016-05-17 11:47:00
【问题描述】:

我正在使用 NeuroSky 的 Mindwave MobileRaspberry 3Python 2.7 进行 FFT。

目前,我得到了原始数据,即脑电波采样数据。

我们可以每秒 512 次获取原始数据。也就是说,采样频率为 512Hz, 但我不知道该怎么办。我在互联网上发现我应该先安装numpy,但我似乎无法让 FFT 工作。

如何使用实时数据(使用 Mindwave Mobile 测量的原始数据)进行 FFT?

你们能帮我从第一阶段(安装numpy)到最后阶段(做FFT)吗?

下图是实测的原始数据,接下来是我的代码:

# -*- coding: utf-8 -*-
import time
import bluetooth
from mindwavemobile.MindwaveDataPoints import RawDataPoint
from mindwavemobile.MindwaveDataPointReader import MindwaveDataPointReader
import textwrap
from mindwavemobile.MindwaveDataPoints import EEGPowersDataPoint


if __name__ == '__main__': #외부에서 호출시
    mindwaveDataPointReader = MindwaveDataPointReader() #인스턴스 생성
    mindwaveDataPointReader.start()
    if (mindwaveDataPointReader.isConnected()):    
        while(True):
            dataPoint = mindwaveDataPointReader.readNextDataPoint() 
            #if (not dataPoint.__class__ is RawDataPoint):
                #print dataPoint        
            if (dataPoint.__class__ is RawDataPoint): 
                print dataPoint
    else:
        print(textwrap.dedent("""\
            Exiting because the program could not connect
            to the Mindwave Mobile device.""").replace("\n", " "))

【问题讨论】:

    标签: python python-2.7 numpy raspberry-pi mindwave


    【解决方案1】:

    你可以看看这个关于如何用 numpy 绘制 fft link

    如果您想离线绘制数据,或者必须创建一个循环来实时绘制数据,这可能很简单

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-18
      • 1970-01-01
      • 1970-01-01
      • 2013-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多