()
| 6 | } |
| 7 | |
| 8 | async function runExample (): Promise<void> |
| 9 | { |
| 10 | const boardId = BoardIds.SYNTHETIC_BOARD; |
| 11 | const board = new BoardShim (boardId, {}); |
| 12 | board.prepareSession(); |
| 13 | board.startStream(); |
| 14 | await sleep (5000); |
| 15 | board.stopStream(); |
| 16 | const data = board.getCurrentBoardData(128); |
| 17 | board.releaseSession(); |
| 18 | const eegChannels = BoardShim.getEegChannels(boardId); |
| 19 | const samplingRate = BoardShim.getSamplingRate(boardId); |
| 20 | const oldData = data[eegChannels[1]]; |
| 21 | const psd = DataFilter.getPsdWelch(oldData, 64, 0.5, samplingRate, WindowOperations.HAMMING); |
| 22 | const alpha = DataFilter.getBandPower(psd, 7.0, 13.0); |
| 23 | const beta = DataFilter.getBandPower(psd, 14.0, 30.0); |
| 24 | console.info(alpha / beta); |
| 25 | } |
| 26 | |
| 27 | runExample (); |
no test coverage detected