Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: PSD and PowerByBand show out of range data #91

Open
andrewjaykeller opened this issue Aug 10, 2022 · 0 comments
Open

Bug: PSD and PowerByBand show out of range data #91

andrewjaykeller opened this issue Aug 10, 2022 · 0 comments

Comments

@andrewjaykeller
Copy link
Contributor

andrewjaykeller commented Aug 10, 2022

The PSD and PowerByBand come after the notch and bandpass filter. Therefore their useable range is limited to the range of the bandpass filters. For example, today, the bandpass goes from 2 to 45Hz for the Crown. The PSD and PowerBy Band use constants from eeg-pipes but has a much narrower range than the constants found in EEG-pipes.

For example, the PSD gives:

  label: 'psd',
  freqs: [
      0,   2,   4,   6,   8,  10,  12,  14,  16,  18,  20,  22,
     24,  26,  28,  30,  32,  34,  36,  38,  40,  42,  44,  46,
     48,  50,  52,  54,  56,  58,  60,  62,  64,  66,  68,  70,
     72,  74,  76,  78,  80,  82,  84,  86,  88,  90,  92,  94,
     96,  98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
    120, 122, 124, 126
  ],
  info: {
    notchFrequency: '60Hz',
    samplingRate: 256,
    startTime: 1628197298732
  },

But the 0, and everything above 44, maybe 46 is invalid and should not be used. A solution would be to limit what PSD shows dynamically based on the bandpass:

  label: 'psd',
  freqs: [
      2,   4,   6,   8,  10,  12,  14,  16,  18,  20,  22,
     24,  26,  28,  30,  32,  34,  36,  38,  40,  42,  44,  46
  ],
  info: {
    notchFrequency: '60Hz',
    bandpassLow: '2Hz',
    bandpassHigh: '45Hz',
    samplingRate: 256,
    startTime: 1628197298732
  },

The docs are therefore not correct and should be updated: https://docs.neurosity.co/docs/api/brainwaves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant