Skip to content

Commit

Permalink
Fix: Ensure power features have shape (64, 129) in BCIProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed Oct 18, 2024
1 parent a6abfb7 commit 5dea08e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NeuroFlex/bci_integration/bci_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def extract_features(self, filtered_data: Dict[str, np.ndarray]) -> Dict[str, np
elif psd.shape[1] < 129:
psd = np.pad(psd, ((0, 0), (0, 129 - psd.shape[1])))

features[f'{band}_power'] = psd.T # Transpose to get shape (129, 64)
features[f'{band}_power'] = psd # Shape is now (64, 129)

# Apply wavelet transform
coeffs = pywt.wavedec(data, 'db4', level=min(5, data.shape[-1] // 2), axis=-1)
Expand Down

0 comments on commit 5dea08e

Please sign in to comment.