# How window window size is inferred?

**URL:** https://mne.discourse.group/t/how-window-window-size-is-inferred/1843
**Category:** Mailing List Archive (read-only)
**Tags:** list-archive
**Created:** [May 12, 2019, 2:47pm UTC](https://mne.discourse.group/t/how-window-window-size-is-inferred/1843 "2019-05-12T14:47:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)
#### Post date: [May 12, 2019, 2:47pm UTC](https://mne.discourse.group/t/how-window-window-size-is-inferred/1843/1 "2019-05-12T14:47:26Z")

</div>

External Email - Use Caution

Dear MNE-community,

In example "Decoding in time-frequency space data using the Common Spatial  
Pattern (CSP)" (  
[https://mne-tools.github.io/dev/auto\_examples/decoding/plot\_decoding\_csp\_timefreq.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-timefreq-py](https://mne-tools.github.io/dev/auto_examples/decoding/plot_decoding_csp_timefreq.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-timefreq-py)),  
I did not understand the concept behind inferring window size based on  
frequency being used(line 81-82). Can you please explain shortly why and  
how window size is inferred?

Regards  
Manoj  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190512/b70ce92e/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190512/b70ce92e/attachment.html)

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)
#### Post date: [May 12, 2019, 7:08pm UTC](https://mne.discourse.group/t/how-window-window-size-is-inferred/1843/2 "2019-05-12T19:08:40Z")

</div>

External Email - Use Caution

I guess you refer to these lines:

&nbsp;&nbsp;&nbsp;&nbsp;# Infer window size based on the frequency being used  
&nbsp;&nbsp;&nbsp;&nbsp;w\_size = n\_cycles / ((fmax + fmin) / 2.) # in seconds

the size of the filter applied depends on the filtering. For low frequencies  
you need longer filters. I guess this is a way to inject this idea  
when cropping time windows.

Hope this helps  
Alex
