【问题标题】:How to use elliptic filter in matlab for edf data如何在matlab中使用椭圆滤波器处理edf数据
【发布时间】:2016-11-12 16:17:04
【问题描述】:

我使用 edfread 来读取 EEG 数据,并将其存储到一个名为 plotData 的变量中。我想知道如何实现一个椭圆滤波器,从其中一个通道中提取 7-9 Hz(阿尔法波段)。

存储在 plotData 中的 EDF 数据如下所示。

plotData = 

            ver: 0
      patientID: 'test                                                                            '
       recordID: 'test                                                                            '
      startdate: '23.06.16'
      starttime: '12.10.38'
          bytes: 9472
        records: 3
       duration: 1
             ns: 36
          label: {1x36 cell}
     transducer: {1x36 cell}
          units: {1x36 cell}
    physicalMin: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
    physicalMax: [1x36 double]
     digitalMin: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
     digitalMax: [1x36 double]
      prefilter: {1x36 cell}
        samples: [1x36 double]

【问题讨论】:

  • 嗨。我认为您的问题不仅限于 EDF 文件。但是:根据您在 EDF 文件中使用的采样频率设计您的滤波器。

标签: matlab filtering signal-processing


【解决方案1】:

如果我理解您提供的 EDF 数据正确,则在 1 秒的 duration 中有 36 个样本 (ns),这为您提供了 36Hz 的采样率。

然后可以使用内置的ellip 函数来完成数字椭圆滤波器的设计。您需要填写通带波纹、阻带衰减和过渡带的滤波器要求。以提供的一些参数为例,这看起来像:

fs    = 36; % sampling rate in Hz
fmin  = 7;  % minimum passband frequency in Hz
fmax  = 9;  % maximum passband frequency in Hz
order = 5;  % filter order (the higher the narrower the transition band)
Rs    = 20; % stopband attenuation in dB
Rp    = 1;  % passband ripples in dB

[b,a] = ellip(order, Rp, Rs, [fmin/(fs/2), fmax/(fs/2)]);

然后,您可以使用 freqz 可视化生成的响应(并根据需要进行调整)。对于上述参数,频率响应如下所示:

最后,要过滤掉您的数据,您可以使用filter 函数,上面设计的过滤器系数ab 以及您的输入plotData

filtered_data = filter(b,a,plotData);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-18
    • 2015-02-19
    • 1970-01-01
    • 2013-02-25
    • 1970-01-01
    • 2014-02-08
    • 2021-06-25
    • 1970-01-01
    相关资源
    最近更新 更多