|
28 | 28 | from moabb.datasets import SSVEPExo |
29 | 29 | from moabb.evaluations import CrossSubjectEvaluation |
30 | 30 | from moabb.paradigms import SSVEP, FilterBankSSVEP |
31 | | -from moabb.pipelines import SSVEP_CCA, ExtendedSSVEPSignal |
| 31 | +from moabb.pipelines import SSVEP_CCA, SSVEP_TRCA, ExtendedSSVEPSignal |
32 | 32 |
|
33 | 33 |
|
34 | 34 | warnings.simplefilter(action="ignore", category=FutureWarning) |
|
55 | 55 | # Choose paradigm |
56 | 56 | # --------------- |
57 | 57 | # |
58 | | -# We define the paradigms (SSVEP and FilterBankSSVEP) and use the dataset |
| 58 | +# We define the paradigms (SSVEP, SSSVEP_TRCA and FilterBankSSVEP) and use the dataset |
59 | 59 | # SSVEPExo. The SSVEP paradigm applied a bandpass filter (10-25 Hz) on |
60 | | -# the data while the FilterBankSSVEP paradigm uses as many bandpass filters as |
| 60 | +# the data, SSVEP_TRCA applied a bandpass filter (1-110 Hz) which correspond to almost |
| 61 | +# no filtering, while the FilterBankSSVEP paradigm uses as many bandpass filters as |
61 | 62 | # there are stimulation frequencies (here 2). For each stimulation frequency |
62 | 63 | # the EEG is filtered with a 1 Hz-wide bandpass filter centered on the |
63 | 64 | # frequency. This results in ``n_classes`` copies of the signal, filtered for each |
64 | 65 | # class, as used in filterbank motor imagery paradigms. |
65 | 66 |
|
66 | 67 | paradigm = SSVEP(fmin=10, fmax=25, n_classes=3) |
| 68 | +paradigm_TRCA = SSVEP(fmin=1, fmax=110, n_classes=3) |
67 | 69 | paradigm_fb = FilterBankSSVEP(filters=None, n_classes=3) |
68 | 70 |
|
69 | 71 | ############################################################################### |
|
83 | 85 | # covariance matrices from the signal filtered around the considered |
84 | 86 | # frequency and applying a logistic regression in the tangent plane. |
85 | 87 | # The second pipeline relies on the above defined CCA classifier. |
| 88 | +# The third pipeline relies on TRCA algorithm. |
86 | 89 |
|
87 | 90 | pipelines_fb = {} |
88 | 91 | pipelines_fb["RG+LogReg"] = make_pipeline( |
|
95 | 98 | pipelines = {} |
96 | 99 | pipelines["CCA"] = make_pipeline(SSVEP_CCA(interval=interval, freqs=freqs, n_harmonics=3)) |
97 | 100 |
|
| 101 | +pipelines_TRCA = {} |
| 102 | +pipelines_TRCA["TRCA"] = make_pipeline( |
| 103 | + SSVEP_TRCA(interval=interval, freqs=freqs, n_fbands=5) |
| 104 | +) |
| 105 | + |
98 | 106 | ############################################################################## |
99 | 107 | # Evaluation |
100 | 108 | # ---------- |
|
123 | 131 | results_fb = evaluation_fb.process(pipelines_fb) |
124 | 132 |
|
125 | 133 | ############################################################################### |
126 | | -# After processing the two, we simply concatenate the results. |
| 134 | +# TRCA processing also relies on filter bank that is automatically designed. |
| 135 | + |
| 136 | +evaluation_TRCA = CrossSubjectEvaluation( |
| 137 | + paradigm=paradigm_TRCA, datasets=dataset, overwrite=overwrite |
| 138 | +) |
| 139 | +results_TRCA = evaluation_TRCA.process(pipelines_TRCA) |
| 140 | + |
| 141 | +############################################################################### |
| 142 | +# After processing the three, we simply concatenate the results. |
127 | 143 |
|
128 | | -results = pd.concat([results, results_fb]) |
| 144 | +results = pd.concat([results, results_fb, results_TRCA]) |
129 | 145 |
|
130 | 146 | ############################################################################## |
131 | 147 | # Plot Results |
|
0 commit comments