MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / runExample

Function runExample

nodejs_package/tests/transforms.ts:15–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15async function runExample (): Promise<void>
16{
17 const boardId = BoardIds.SYNTHETIC_BOARD;
18 const board = new BoardShim (boardId, {});
19 board.prepareSession();
20 board.startStream();
21 await sleep (3000);
22 board.stopStream();
23 const data = board.getCurrentBoardData(64);
24 board.releaseSession();
25 const eegChannels = BoardShim.getEegChannels(boardId);
26 const oldData = data[eegChannels[0]];
27 console.info(oldData);
28 const fftData = DataFilter.performFft(oldData, WindowOperations.NO_WINDOW);
29 console.info(fftData);
30 const newData = DataFilter.performIfft(fftData);
31 console.info(newData);
32 const waveletData = DataFilter.performWaveletTransform(
33 newData, WaveletTypes.DB2, 2, WaveletExtensionTypes.SYMMETRIC);
34 const restoredData = DataFilter.performInverseWaveletTransform(
35 waveletData, newData.length, WaveletTypes.DB2, 2, WaveletExtensionTypes.SYMMETRIC);
36 console.info(restoredData);
37}
38
39runExample ();

Callers 1

transforms.tsFile · 0.70

Calls 11

prepareSessionMethod · 0.95
startStreamMethod · 0.95
stopStreamMethod · 0.95
getCurrentBoardDataMethod · 0.95
releaseSessionMethod · 0.95
getEegChannelsMethod · 0.80
performFftMethod · 0.80
performIfftMethod · 0.80
sleepFunction · 0.70

Tested by

no test coverage detected